4klyft API (1.0.0)

Download OpenAPI specification:

4klyft API Support: [email protected] License: Proprietary

Commerce and order-fulfilment platform API for 4klyft.

Overview

This API provides endpoints for managing:

  • Catalog (PIM/DAM): products, variants, attributes, options, categories, brands, collections, assortments, and media
  • Sales: orders, customers, merchants, sales channels, and channel order import
  • Inventory: stock items, levels, lots, and serial units across custodians
  • Warehousing & Operations: goods receipt/issue, holds, and custodian operations
  • Fulfilment: fulfilment orders dispatched to third-party (3PL) providers
  • Shipping: carriers, shipments, labels, tracking, returns, and proof of delivery
  • Finance & Billing: payments, settlements, invoices, credit notes, tax, and subscriptions
  • Integration: sales-channel connections, providers, webhooks, and catalog/order sync
  • Documents: operational document generation and requests
  • Storage: file/drive storage with chunked upload and signed access
  • Identity & Access (IAM): authentication, users, roles, permissions, and tenants
  • Platform services: notifications, scheduling, numbering, data exchange, analytics, and workspace tables & views

Authentication

All API endpoints (except /api/docs and /api/v1/iam/auth/*) require JWT Bearer token authentication. Include the token in the Authorization header:

Authorization: Bearer <your-jwt-token>

Rate Limiting

Every /api/ request is rate-limited per caller — by your authenticated identity when a token is present, otherwise by client IP. The authentication endpoints (/auth/login, /auth/refresh, /auth/request-password-reset) carry stricter, IP-based limits.

Each response advertises your current budget via headers:

  • X-RateLimit-Limit — the bucket size
  • X-RateLimit-Remaining — tokens left in the current window
  • X-RateLimit-Reset — Unix timestamp when a token next frees up

Exceeding a limit returns 429 Too Many Requests (RFC 6585) with a Retry-After header (seconds to wait). Back off and retry after the indicated delay rather than hammering the endpoint.

Error Handling

The API uses RFC 7807 Problem Details for error responses.

Warehousing - Custodians

Wizard-time custodian connection validation endpoint.

POST /api/warehousing/custodians/test-connection with {type, connectionConfig}. Returns {ok, code, message} indicating whether the supplied credentials pass the per-provider validator. Phase 4 only validates structural shape; Phase 5 will round-trip against the upstream adapter API.

List custodians

Retrieve a paginated list of custodians with optional filters.

Authorizations:
Bearer
query Parameters
type
string
status
string
Enum: "active" "suspended" "disconnected"
partnerId
string <uuid>
search
string
page
integer >= 1
Default: 1
itemsPerPage
integer [ 1 .. 100 ]
Default: 20

Responses

Response samples

Content type
{
  • "totalItems": 0,
  • "search": {
    },
  • "view": {
    },
  • "member": [
    ]
}

Create a custodian

Create a new custodian (warehouse operator).

Authorizations:
Bearer
Request Body schema: application/json
required

Custodian creation data

partnerId
required
string <uuid>
type
required
string
Enum: "internal" "amazon_fba" "bol_fbb" "shiphero" "shipbob" "flexport" "sendcloud" "custom"
name
required
string [ 1 .. 255 ] characters
enabledCapabilities
Array of strings
object or null

Direct-credential providers only (SendCloud, ShipHero, ShipBob). OAuth providers (Amazon FBA, Bol FBB, Flexport) connect via the wizard.

Responses

Request samples

Content type
application/json
{
  • "partnerId": "bf408d53-df49-40a6-8455-a34bd4360901",
  • "type": "internal",
  • "name": "string",
  • "enabledCapabilities": [
    ],
  • "connectionConfig": {
    }
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Find a custodian by partner

Resolve the custodian profile held by a partner. Returns 404 when the partner holds no custodian.

Authorizations:
Bearer
path Parameters
partnerId
required
string <uuid>

Custodian identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Get capability catalog

Returns the default Capabilities each CustodianType supports. Used by the custodian creation wizards to display the technical baseline before the tenant opts in.

Authorizations:
Bearer

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "default",
  • "catalog": {
    }
}

Onboard an existing partner as a custodian

Create a custodian for an EXISTING partner and assign the Partner.Custodian role. Idempotent: returns the existing custodian (200) when the partner already holds one.

Authorizations:
Bearer
Request Body schema: application/json
required

Onboarding data

partnerId
required
string <uuid>
type
required
string
Enum: "internal" "amazon_fba" "bol_fbb" "shiphero" "shipbob" "flexport" "sendcloud" "custom"
name
required
string

Responses

Request samples

Content type
application/json
{
  • "partnerId": "bf408d53-df49-40a6-8455-a34bd4360901",
  • "type": "internal",
  • "name": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Test custodian connection credentials

Validate the supplied connection config for a given CustodianType without persisting any state. Used by the wizard UI for live feedback.

Authorizations:
Bearer
Request Body schema: application/json
required

Custodian type + connection config to validate

type
required
string
Enum: "internal" "amazon_fba" "bol_fbb" "shiphero" "shipbob" "flexport" "sendcloud" "custom"
required
object

Responses

Request samples

Content type
application/json
{
  • "type": "internal",
  • "connectionConfig": { }
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "test-connection",
  • "ok": false,
  • "code": "string",
  • "message": ""
}

Get a custodian

Retrieve a single custodian by its UUID.

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Disable a capability on a custodian

Disable a capability on a custodian

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Request Body schema:
required

The new Custodian resource

capability
required
string
Enum: "tenant_picks_warehouse" "provider_picks_warehouse" "list_inventory" "push_inventory" "cancel_order" "webhook_receipt" "label_generation"

Responses

Request samples

Content type
{
  • "capability": "tenant_picks_warehouse"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Enable a capability on a custodian

Enable a capability on a custodian

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Request Body schema:
required

The new Custodian resource

capability
required
string
Enum: "tenant_picks_warehouse" "provider_picks_warehouse" "list_inventory" "push_inventory" "cancel_order" "webhook_receipt" "label_generation"

Responses

Request samples

Content type
{
  • "capability": "tenant_picks_warehouse"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Update custodian connection configuration

Update custodian connection configuration

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Request Body schema:
required

The new Custodian resource

required
object (ConnectionConfigInput)

Responses

Request samples

Content type
{
  • "connectionConfig": {
    }
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Disconnect an external custodian

Disconnect an external custodian

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Reactivate a custodian

Reactivate a custodian

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Suspend a custodian

Suspend a custodian

Authorizations:
Bearer
path Parameters
id
required
string

Custodian identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "type": "internal",
  • "name": "string",
  • "status": "active",
  • "enabledCapabilities": [
    ],
  • "connectionConfigured": false,
  • "createdAt": "string",
  • "updatedAt": "string"
}

Warehousing - Custodian Wizard

OAuth / API-key wizard endpoints for the three external custodian providers:

POST /api/warehousing/custodian-wizard/{provider}/auth-start POST /api/warehousing/custodian-wizard/{provider}/auth-callback GET /api/warehousing/custodian-wizard/{provider}/resources?custodianId=...

{provider} is the CustodianType key — amazon_fba, bol_fbb, or flexport. Connection testing is exposed via the existing /custodians/test-connection endpoint (passing custodianId in the connectionConfig payload).

Finalise a custodian wizard flow

Exchanges the authorization code or API key for tokens, encrypts them, and persists the resulting ConnectionConfig on the target Custodian. Returns the updated Custodian resource.

Authorizations:
Bearer
path Parameters
provider
required
string
Enum: "amazon_fba" "bol_fbb" "flexport"

CustodianWizard identifier

Request Body schema: application/json
required

Wizard completion payload

custodianId
required
string <ulid>
state
required
string
code
string
object
object

Responses

Request samples

Content type
application/json
{
  • "custodianId": "string",
  • "state": "string",
  • "code": "string",
  • "credentials": { },
  • "resourceSelection": { }
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "wizard",
  • "provider": "",
  • "authorizationUrl": "string",
  • "state": "",
  • "expiresInSeconds": 0,
  • "requiredFields": [
    ],
  • "requiresAuthorizationUrl": false,
  • "resources": {
    }
}

Begin a custodian wizard flow

For OAuth providers returns an authorizationUrl + signed state; for API-key providers returns a requiredFields schema for the wizard form.

Authorizations:
Bearer
path Parameters
provider
required
string
Enum: "amazon_fba" "bol_fbb" "flexport"

CustodianWizard identifier

Request Body schema: application/json
required

Wizard start payload

custodianId
required
string <ulid>
redirectUri
string or null

Responses

Request samples

Content type
application/json
{
  • "custodianId": "string",
  • "redirectUri": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "wizard",
  • "provider": "",
  • "authorizationUrl": "string",
  • "state": "",
  • "expiresInSeconds": 0,
  • "requiredFields": [
    ],
  • "requiresAuthorizationUrl": false,
  • "resources": {
    }
}

Fetch provider-side resources for the wizard

Returns the marketplaces, retailers, or warehouseHints the wizard UI must let the user pick from. Requires a completed wizard (custodian must have a stored ConnectionConfig).

Authorizations:
Bearer
path Parameters
provider
required
string
Enum: "amazon_fba" "bol_fbb" "flexport"

CustodianWizard identifier

query Parameters
custodianId
required
string <ulid>

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "wizard",
  • "provider": "",
  • "authorizationUrl": "string",
  • "state": "",
  • "expiresInSeconds": 0,
  • "requiredFields": [
    ],
  • "requiresAuthorizationUrl": false,
  • "resources": {
    }
}