Skip to main content

Track Fulfillments

Fulfillments represent the shipping and delivery information for orders.

Full API Reference

Response examples are simplified. See the complete endpoint documentation for the full response schema.

Get Fulfillments by Order

Use the dedicated endpoint to get all fulfillments for a specific order:

const response = await fetch(
`https://na1-prod.okcapsule.app/v2/orders/${orderId}/fulfillments`,
{
headers: { Authorization: `Bearer ${access_token}` },
}
);

const { fulfillments } = await response.json();

Get Fulfillment Details

const response = await fetch(
`https://na1-prod.okcapsule.app/v2/fulfillments/${fulfillmentId}`,
{
headers: { Authorization: `Bearer ${access_token}` },
}
);

const { fulfillment } = await response.json();

Response:

{
"fulfillment": {
"id": "d290f1ee-6c54-4b01-90e6-d701748f0851",
"order_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"consumer_id": "f1e2d3c4-b5a6-7890-1234-567890abcdef",
"status_id": "shipped-status-uuid",
"delivery_date": "2024-01-20T14:30:00Z",
"pickup_date": "2024-01-18T09:00:00Z",
"tracking_info": {
"shipping_carrier": "FedEx",
"shipping_method": "Ground",
"tracking_number": "123456789012",
"tracking_url": "https://www.fedex.com/fedextrack/?trknbr=123456789012"
},
"shipment_order_id": "SO-12345",
"shipment_order_number": "1234567890",
"label_url": "https://okc-labels-bucket.s3.amazonaws.com/...",
"shipping_net_charge": 12.5,
"weight": 2.5,
"created_at": "2024-01-17T10:00:00Z",
"updated_at": "2024-01-18T09:00:00Z",
"order_lines": [
{
"id": "orderline-uuid",
"name": "Monthly Pack"
}
]
}
}

List Fulfillments

const response = await fetch(
"https://na1-prod.okcapsule.app/v2/fulfillments?limit=20",
{
headers: { Authorization: `Bearer ${access_token}` },
}
);

const { fulfillments } = await response.json();

Query Parameters

ParameterDescription
limitNumber of results (default: 20)
cursorPagination cursor
order_idFilter by order ID

Tracking Information

The tracking_info object contains:

FieldDescription
shipping_carrierCarrier name (FedEx, UPS, USPS, etc.)
shipping_methodService level
tracking_numberCarrier tracking number
tracking_urlDirect link to carrier tracking page

Fulfillment Dates

FieldDescription
pickup_dateWhen the package was picked up by carrier
delivery_dateWhen the package was delivered

Shipping Label

The label_url field provides a pre-signed S3 URL to download the shipping label.

Label URL Expiration

The label_url is a pre-signed URL that expires after 15 minutes. Request a fresh fulfillment if you need a new label URL.

Best Practices

Store Tracking Info

Cache tracking numbers and URLs in your system to reduce API calls and provide faster customer support.