4klyft API (1.0.0)

Download OpenAPI specification:

4klyft API Support: support@4klyft.com License: Proprietary

Logistics operations API for the 4klyft platform.

Overview

This API provides comprehensive endpoints for managing:

  • Routes & Execution: Create, manage, and execute delivery routes
  • Shipments & Loads: Track shipments from pickup to delivery
  • Fleet Management: Manage carriers, vehicles, and drivers
  • Proof of Delivery: Capture signatures, photos, and delivery confirmations
  • Settings: Configure system-wide and tenant-specific settings
  • Webhooks: Subscribe to real-time event notifications
  • Analytics: Access delivery performance metrics and reports

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

API requests are rate-limited to ensure fair usage. Standard limits are:

  • 1000 requests per minute for read operations
  • 100 requests per minute for write operations

Error Handling

The API uses RFC 7807 Problem Details for error responses.

Procurement Purchase Orders

A purchase order — the buy-side counterpart of a Sales Order. Placed against a supplier, carries priced lines referencing purchased items by opaque ResourceUri, and moves through Draft → Approved → Issued → Acknowledged → PartiallyReceived → Received → Closed (or Cancelled).

Receiving is NOT a user action on this resource — to receive against a PO you create a Goods Receipt with the PO as its subject; the received quantities flow back onto the PO lines automatically.

List purchase orders

Retrieve a paginated list of purchase orders, filterable by status and supplier.

Authorizations:
Bearer
query Parameters
page
integer
Default: 1

The collection page number

Responses

Response samples

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

Draft a purchase order

Draft a purchase order

Authorizations:
Bearer
Request Body schema:
required

The new PurchaseOrder resource

supplierId
required
string
currency
required
string = 3 characters
expectedDeliveryAt
string or null
incoterms
string or null
Enum: "EXW" "FCA" "FAS" "FOB" "CFR" "CIF" "CPT" "CIP" "DAP" "DPU" "DDP"
PurchaseOrderPaymentTermsInput (object) or null
Array of objects (PurchaseOrderLineRequest)

Responses

Request samples

Content type
{
  • "supplierId": "string",
  • "currency": "str",
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ]
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Get a purchase order

Get a purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Amend a draft purchase order's trade terms (Incoterms + payment terms)

Amend a draft purchase order's trade terms (Incoterms + payment terms)

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Request Body schema: application/merge-patch+json
required

The updated PurchaseOrder resource

incoterms
string or null
Enum: "EXW" "FCA" "FAS" "FOB" "CFR" "CIF" "CPT" "CIP" "DAP" "DPU" "DDP"
PurchaseOrderPaymentTermsInput (object) or null

Responses

Request samples

Content type
application/merge-patch+json
{
  • "incoterms": "EXW",
  • "paymentTerms": {
    }
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Record supplier acknowledgement of an issued purchase order

Record supplier acknowledgement of an issued purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Approve a draft purchase order

Approve a draft purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Record a vendor bill against a purchase order

Creates a Payables bill linked to this purchase order. Rejected with 409 (INVALID_OPERATION) if the PO has not reached at least APPROVED status.

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Request Body schema:
required

The new PurchaseOrder resource

billNumber
required
string <= 255 characters
currency
required
string = 3 characters
totalAmountInCents
required
integer > 0
subtotalInCents
integer or null >= 0

Net (tax-exclusive) amount, in minor units. Optional.

totalTaxInCents
integer or null >= 0

Input VAT the vendor charged, in minor units. Optional.

issuedAt
required
string
dueAt
required
string

Responses

Request samples

Content type
{
  • "billNumber": "string",
  • "currency": "str",
  • "totalAmountInCents": 0,
  • "subtotalInCents": 0,
  • "totalTaxInCents": 0,
  • "issuedAt": "string",
  • "dueAt": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "tenantId": "string",
  • "partnerId": "string",
  • "partnerName": "string",
  • "billNumber": "string",
  • "currency": "string",
  • "totalAmount": 0,
  • "subtotalCents": 0,
  • "totalTaxCents": 0,
  • "subject": "string",
  • "selfBilled": false,
  • "status": "string",
  • "issuedAt": "string",
  • "dueAt": "string",
  • "reviewedBy": "string",
  • "reviewedAt": "string",
  • "approvedBy": "string",
  • "approvedAt": "string",
  • "approvalNotes": "string",
  • "scheduledPaymentDate": "string",
  • "paidAt": "string",
  • "paymentReference": "string",
  • "paymentMethod": "string",
  • "disputedBy": "string",
  • "disputedAt": "string",
  • "disputeReason": "string",
  • "cancellationReason": "string",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Cancel a purchase order

Cancel a purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Close a fully-received purchase order

Close a fully-received purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Issue an approved purchase order to the supplier

Issue an approved purchase order to the supplier

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Add a line to a draft purchase order

Add a line to a draft purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

Request Body schema:
required

The new PurchaseOrder resource

shippableRef
required
string
description
required
string <= 1000 characters
quantityOrdered
integer > 0
unitPriceCents
integer >= 0
taxRate
number or null >= 0
destinationWarehouseId
string or null
expectedReceiptDate
string or null
lineId
string or null

Responses

Request samples

Content type
{
  • "shippableRef": "string",
  • "description": "string",
  • "quantityOrdered": 0,
  • "unitPriceCents": 0,
  • "taxRate": 0,
  • "destinationWarehouseId": "string",
  • "expectedReceiptDate": "string",
  • "lineId": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Remove a line from a draft purchase order

Remove a line from a draft purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

lineId
required
string

PurchaseOrder identifier

Responses

Response samples

Content type
{
  • "type": "/errors/validation-error",
  • "title": "Validation Error",
  • "status": 400,
  • "detail": "The provided input is invalid",
  • "violations": [
    ],
  • "instance": "string"
}

Update a line on a draft purchase order

Update a line on a draft purchase order

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseOrder identifier

lineId
required
string

PurchaseOrder identifier

Request Body schema: application/merge-patch+json
required

The updated PurchaseOrder resource

description
string <= 1000 characters
quantityOrdered
integer > 0
unitPriceCents
integer >= 0
taxRate
number or null >= 0
destinationWarehouseId
string or null
expectedReceiptDate
string or null

Responses

Request samples

Content type
application/merge-patch+json
{
  • "description": "string",
  • "quantityOrdered": 0,
  • "unitPriceCents": 0,
  • "taxRate": 0,
  • "destinationWarehouseId": "string",
  • "expectedReceiptDate": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "partnerId": "string",
  • "number": "PO2600001",
  • "status": "draft",
  • "currency": "USD",
  • "totalCents": 125000,
  • "estimatedTaxCents": 25000,
  • "estimatedGrandTotalCents": 150000,
  • "expectedDeliveryAt": "string",
  • "incoterms": "EXW",
  • "paymentTerms": {
    },
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Procurement Purchase Returns

A purchase return (return-to-vendor / RTV) — the buy-side mirror of the customer RMA. Returns goods to a supplier, optionally citing a source purchase order and/or inbound delivery, and moves through Draft → Approved → Issued → Completed (or Cancelled).

Issued is where goods physically leave back to the vendor; Completed is where a vendor debit note posts to Finance. Neither the physical (GoodsIssue) nor financial (debit note) leg is exposed on this resource yet — they are P1 follow-ups that attach to the Issued / Completed transitions.

List purchase returns

Retrieve a paginated list of purchase returns, filterable by status and supplier.

Authorizations:
Bearer
query Parameters
page
integer
Default: 1

The collection page number

Responses

Response samples

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

Draft a purchase return

Draft a purchase return

Authorizations:
Bearer
Request Body schema:
required

The new PurchaseReturn resource

supplierId
required
string
currency
required
string = 3 characters
reason
required
string
sourcePurchaseOrderId
string or null
sourceInboundDeliveryRef
string or null
Array of objects (PurchaseReturnLineRequest)

Responses

Request samples

Content type
{
  • "supplierId": "string",
  • "currency": "str",
  • "reason": "string",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "lines": [
    ]
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Get a purchase return

Get a purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Approve a draft purchase return

Approve a draft purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Cancel a purchase return

Cancel a purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Issue an approved purchase return to the supplier

Issue an approved purchase return to the supplier

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Add a line to a draft purchase return

Add a line to a draft purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

Request Body schema:
required

The new PurchaseReturn resource

sourceLineRef
required
string
quantity
integer > 0
perLineReason
string or null
lineId
string or null

Responses

Request samples

Content type
{
  • "sourceLineRef": "string",
  • "quantity": 0,
  • "perLineReason": "string",
  • "lineId": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Remove a line from a draft purchase return

Remove a line from a draft purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

lineId
required
string

PurchaseReturn identifier

Responses

Response samples

Content type
{
  • "type": "/errors/validation-error",
  • "title": "Validation Error",
  • "status": 400,
  • "detail": "The provided input is invalid",
  • "violations": [
    ],
  • "instance": "string"
}

Update a line on a draft purchase return

Update a line on a draft purchase return

Authorizations:
Bearer
path Parameters
id
required
string

PurchaseReturn identifier

lineId
required
string

PurchaseReturn identifier

Request Body schema: application/merge-patch+json
required

The updated PurchaseReturn resource

quantity
integer > 0
perLineReason
string or null

Responses

Request samples

Content type
application/merge-patch+json
{
  • "quantity": 0,
  • "perLineReason": "string"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "supplierId": "string",
  • "number": "PRET2600001",
  • "status": "draft",
  • "reason": "defective",
  • "currency": "USD",
  • "sourcePurchaseOrderId": "string",
  • "sourceInboundDeliveryRef": "string",
  • "totalQuantity": 25,
  • "lines": [
    ],
  • "createdAt": "string",
  • "updatedAt": "string"
}

Procurement Suppliers

A supplier (vendor) — the buy-side counterpart of a shipping Client. Links an existing Partner (carrying the Supplier role) to supplier-master fields: payment terms, lead time, and default currency.

Tenant-managed reference data.

List suppliers

Retrieve a paginated list of suppliers (vendors).

Authorizations:
Bearer
query Parameters
page
integer
Default: 1

The collection page number

Responses

Response samples

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

Register a supplier

Register a supplier

Authorizations:
Bearer
Request Body schema:
required

The new Supplier resource

partnerId
required
string
name
required
string [ 2 .. 255 ] characters
paymentTermsDays
integer or null >= 0
leadTimeDays
integer or null >= 0
defaultCurrency
string or null = 3 characters

Responses

Request samples

Content type
{
  • "partnerId": "string",
  • "name": "string",
  • "paymentTermsDays": 0,
  • "leadTimeDays": 0,
  • "defaultCurrency": "str"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "01H8XGJ...",
  • "name": "Acme Components Ltd",
  • "status": "active",
  • "paymentTermsDays": 30,
  • "leadTimeDays": 14,
  • "defaultCurrency": "USD",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Get a supplier

Get a supplier

Authorizations:
Bearer
path Parameters
id
required
string

Supplier identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "01H8XGJ...",
  • "name": "Acme Components Ltd",
  • "status": "active",
  • "paymentTermsDays": 30,
  • "leadTimeDays": 14,
  • "defaultCurrency": "USD",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Update a supplier

Update a supplier

Authorizations:
Bearer
path Parameters
id
required
string

Supplier identifier

Request Body schema: application/merge-patch+json
required

The updated Supplier resource

name
string [ 2 .. 255 ] characters
paymentTermsDays
integer or null >= 0
leadTimeDays
integer or null >= 0
defaultCurrency
string or null = 3 characters

Responses

Request samples

Content type
application/merge-patch+json
{
  • "name": "string",
  • "paymentTermsDays": 0,
  • "leadTimeDays": 0,
  • "defaultCurrency": "str"
}

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "01H8XGJ...",
  • "name": "Acme Components Ltd",
  • "status": "active",
  • "paymentTermsDays": 30,
  • "leadTimeDays": 14,
  • "defaultCurrency": "USD",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Reactivate a suspended supplier

Reactivate a suspended supplier

Authorizations:
Bearer
path Parameters
id
required
string

Supplier identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "01H8XGJ...",
  • "name": "Acme Components Ltd",
  • "status": "active",
  • "paymentTermsDays": 30,
  • "leadTimeDays": 14,
  • "defaultCurrency": "USD",
  • "createdAt": "string",
  • "updatedAt": "string"
}

Suspend an active supplier

Suspend an active supplier

Authorizations:
Bearer
path Parameters
id
required
string

Supplier identifier

Responses

Response samples

Content type
{
  • "@context": "string",
  • "@id": "string",
  • "@type": "string",
  • "id": "string",
  • "partnerId": "01H8XGJ...",
  • "name": "Acme Components Ltd",
  • "status": "active",
  • "paymentTermsDays": 30,
  • "leadTimeDays": 14,
  • "defaultCurrency": "USD",
  • "createdAt": "string",
  • "updatedAt": "string"
}