Download OpenAPI specification:
Commerce and order-fulfilment platform API for 4klyft.
This API provides endpoints for managing:
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>
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 sizeX-RateLimit-Remaining — tokens left in the current windowX-RateLimit-Reset — Unix timestamp when a token next frees upExceeding 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.
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.
Retrieve a paginated list of custodians with optional filters.
| type | string |
| status | string Enum: "active" "suspended" "disconnected" |
| partnerId | string <uuid> |
| search | string |
| page | integer >= 1 Default: 1 |
| itemsPerPage | integer [ 1 .. 100 ] Default: 20 |
{- "totalItems": 0,
- "search": {
- "@type": "string",
- "template": "string",
- "variableRepresentation": "string",
- "mapping": [
- {
- "@type": "string",
- "variable": "string",
- "property": "string",
- "required": true
}
]
}, - "view": {
- "@id": "string",
- "@type": "string",
- "first": "string",
- "last": "string",
- "previous": "string",
- "next": "string"
}, - "member": [
- {
- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}
]
}Create a new custodian (warehouse operator).
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. |
{- "partnerId": "bf408d53-df49-40a6-8455-a34bd4360901",
- "type": "internal",
- "name": "string",
- "enabledCapabilities": [
- "string"
], - "connectionConfig": {
- "publicKey": "string",
- "secretKey": "string",
- "integrationId": "string",
- "apiKey": "string",
- "accountId": "string",
- "accessToken": "string",
- "channelId": "string",
- "webhookSecret": "string"
}
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Resolve the custodian profile held by a partner. Returns 404 when the partner holds no custodian.
| partnerId required | string <uuid> Custodian identifier |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Returns the default Capabilities each CustodianType supports. Used by the custodian creation wizards to display the technical baseline before the tenant opts in.
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "default",
- "catalog": {
- "property1": [
- "string"
], - "property2": [
- "string"
]
}
}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.
Onboarding data
| partnerId required | string <uuid> |
| type required | string Enum: "internal" "amazon_fba" "bol_fbb" "shiphero" "shipbob" "flexport" "sendcloud" "custom" |
| name required | string |
{- "partnerId": "bf408d53-df49-40a6-8455-a34bd4360901",
- "type": "internal",
- "name": "string"
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Validate the supplied connection config for a given CustodianType without persisting any state. Used by the wizard UI for live feedback.
Custodian type + connection config to validate
| type required | string Enum: "internal" "amazon_fba" "bol_fbb" "shiphero" "shipbob" "flexport" "sendcloud" "custom" |
required | object |
{- "type": "internal",
- "connectionConfig": { }
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "test-connection",
- "ok": false,
- "code": "string",
- "message": ""
}Retrieve a single custodian by its UUID.
| id required | string Custodian identifier |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Disable a capability on a custodian
| id required | string Custodian identifier |
The new Custodian resource
| capability required | string Enum: "tenant_picks_warehouse" "provider_picks_warehouse" "list_inventory" "push_inventory" "cancel_order" "webhook_receipt" "label_generation" |
{- "capability": "tenant_picks_warehouse"
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Enable a capability on a custodian
| id required | string Custodian identifier |
The new Custodian resource
| capability required | string Enum: "tenant_picks_warehouse" "provider_picks_warehouse" "list_inventory" "push_inventory" "cancel_order" "webhook_receipt" "label_generation" |
{- "capability": "tenant_picks_warehouse"
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Update custodian connection configuration
| id required | string Custodian identifier |
The new Custodian resource
required | object (ConnectionConfigInput) |
{- "connectionConfig": {
- "publicKey": "string",
- "secretKey": "string",
- "integrationId": "string",
- "apiKey": "string",
- "accountId": "string",
- "accessToken": "string",
- "channelId": "string",
- "webhookSecret": "string"
}
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Disconnect an external custodian
| id required | string Custodian identifier |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Reactivate a custodian
| id required | string Custodian identifier |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}Suspend a custodian
| id required | string Custodian identifier |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "string",
- "partnerId": "string",
- "partnerName": "string",
- "type": "internal",
- "name": "string",
- "status": "active",
- "enabledCapabilities": [
- "string"
], - "connectionConfigured": false,
- "createdAt": "string",
- "updatedAt": "string"
}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).
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.
| provider required | string Enum: "amazon_fba" "bol_fbb" "flexport" CustodianWizard identifier |
Wizard completion payload
| custodianId required | string <ulid> |
| state required | string |
| code | string |
object | |
object |
{- "custodianId": "string",
- "state": "string",
- "code": "string",
- "credentials": { },
- "resourceSelection": { }
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "wizard",
- "provider": "",
- "authorizationUrl": "string",
- "state": "",
- "expiresInSeconds": 0,
- "requiredFields": [
- {
- "property1": "string",
- "property2": "string"
}
], - "requiresAuthorizationUrl": false,
- "resources": {
- "property1": "string",
- "property2": "string"
}
}For OAuth providers returns an authorizationUrl + signed state; for API-key providers returns a requiredFields schema for the wizard form.
| provider required | string Enum: "amazon_fba" "bol_fbb" "flexport" CustodianWizard identifier |
Wizard start payload
| custodianId required | string <ulid> |
| redirectUri | string or null |
{- "custodianId": "string",
- "redirectUri": "string"
}{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "wizard",
- "provider": "",
- "authorizationUrl": "string",
- "state": "",
- "expiresInSeconds": 0,
- "requiredFields": [
- {
- "property1": "string",
- "property2": "string"
}
], - "requiresAuthorizationUrl": false,
- "resources": {
- "property1": "string",
- "property2": "string"
}
}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).
| provider required | string Enum: "amazon_fba" "bol_fbb" "flexport" CustodianWizard identifier |
| custodianId required | string <ulid> |
{- "@context": "string",
- "@id": "string",
- "@type": "string",
- "id": "wizard",
- "provider": "",
- "authorizationUrl": "string",
- "state": "",
- "expiresInSeconds": 0,
- "requiredFields": [
- {
- "property1": "string",
- "property2": "string"
}
], - "requiresAuthorizationUrl": false,
- "resources": {
- "property1": "string",
- "property2": "string"
}
}