Fulfillment and Shipping

Fulfillment endpoints cover the path from an accepted order to a package ready to go out: preparation, carrier selection, label generation, and tracking updates. There are two families:

  • Per order (/orders/{orderId}/prepare, /orders/{orderId}/fulfill): built for interactive flows, one order at a time.
  • Batch (/orders/fulfillment/*): built to process many orders in a single call, typically from the merchant dashboard or a scheduled task.

Response envelope

Every successful single-resource response follows { "data": {...} }; lists use { "data": [...], "meta": { "pagination": {...} } }. Errors are always { "error": { "code", "message", "details?" } } with namespace:snake_case codes (e.g. orders:cannot_fulfill). Full catalog: Error Reference.

For post-shipment events (marking as delivered, uploading delivery evidence, attaching an external label) see Delivery and Shipping.

Mark an order as preparing

Marks an order as preparing. Requires specifying which items and how much of each are being prepared in this batch.

{
  "items": [{ "itemIndex": 0, "quantityToPrepare": 2 }],
  "shippingInfo": {
    "carrier": "dhl",
    "trackingNumber": "1234567890",
    "trackingUrl": "https://track.example.com/1234567890",
    "shippingCost": { "amount": 120.50, "currency": "MXN" }
  }
}
200Order prepared or partially prepared, depending on the quantities sent
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "fulfilled",
    "items": [
      { "sku": "PROD-001", "quantity": 2, "quantityPrepared": 2, "status": "prepared" }
    ],
    "_links": {
      "self": "/orders/65f3a1b2c4d5e6f7a8b9c0d1",
      "attachments": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/attachments",
      "activityLog": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/activity-log",
      "validTransitions": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/valid-transitions",
      "fulfill": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/fulfill"
    }
  }
}
502The channel rejected the sync; the order is left untouched
{
  "error": {
    "code": "channels:sync_failed",
    "message": "Channel sync failed during prepareOrder: <reason>"
  }
}
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/prepare \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"items":[{"itemIndex":0,"quantityToPrepare":2}]}'

Returns the prepared or partially prepared order, wrapped in data.

Required permission: orders:fulfill

Parameters

orderIdstringrequired

Order ID.

itemsarrayrequired

Items to prepare in this batch. Minimum 1 element. The schema is strict: any unknown field in the body (for example sku or quantity instead of itemIndex/quantityToPrepare) returns 400 — it is not ignored.

items.itemIndexnumberrequired

Index (≥0) of the item within the order's items array — identifies the item by position, not by SKU.

items.quantityToPreparenumberrequired

Quantity of that item to prepare (> 0).

shippingInfoobject

Shipping information. Required on every channel except manual orders and MercadoLibre ME2/Full — see the table below.

shippingInfo.carrierstringrequired

Carrier code. Required if you send shippingInfo. Accepted values: fedex, dhl, ups, estafeta, redpack, 99minutos, other. If your carrier is not on the list, send `other` and put its name in `carrierName`. Do not send `manual`, `automatic`, `automatica` or similar: those are capture modes —how the label was obtained—, not carriers, and the API rejects them.

shippingInfo.trackingNumberstringrequired

Tracking number. Required if you send shippingInfo.

shippingInfo.trackingUrlstring

Public tracking URL.

shippingInfo.customCarrierNamestring

Carrier name when it's not in the catalog. Required if carrier is 'other'.

shippingInfo.shippingCostobject

Shipping cost for this package.

shippingInfo.shippingCost.amountnumberrequired

Shipping cost amount (≥ 0).

shippingInfo.shippingCost.currencystringrequired

3-letter ISO 4217 currency code (e.g. MXN).

shippingInfo.providerstring

Shipping provider that originated the quote.

Resulting status

prepare does not leave the order in preparing. The status is derived from the quantities:

SituationResulting orderStatus
Every line reaches quantityPrepared = quantityfulfilled
Units are still pendingpartially-fulfilled

Each line's status is derived too, never sent by you: pending (0 prepared) → partially-prepared (0 < prepared < quantity) → prepared (prepared = quantity).

If the channel rejects, nothing is saved

The channel sync happens before anything is written to the database. If the marketplace rejects the shipment, the response is 502 and the order is left untouched: no prepared quantities, no status change, no label. There is no half-written state to clean up.

When is shippingInfo required?

The order's channel decides, not you:

ChannelshippingInfoNotifies the marketplace?
Shopify, Walmart, T1 Comercios (Sears/Sanborns)RequiredYes
MercadoLibreRequired only for ME1 (seller-managed shipping)Yes
Manual / internal orders (manual, api, pos, web)Not requiredN/A
Any other channel — Amazon, Coppel, Shein, TikTok Shop, Liverpool, WooCommerce, Claro Shop, TiendaNube…Not requiredNo

If the channel requires it and you omit it, the response is 400 with orders:shipping_info_required.

Channels without a dedicated adapter are treated as manual

Only Shopify, Walmart, T1 and MercadoLibre have their own fulfillment adapter. An order from any other channel falls through to the manual adapter: prepare returns 200, moves quantities and status inside Fenicia, but sends nothing to the marketplace — with no error and no warning. If you integrate one of those channels, sync the shipment through whatever means that marketplace offers; do not assume prepare did it.

prepare is not the same as upload-guide

prepare advances the fulfillment lifecycle: it moves quantities, changes the status and — on channels with a dedicated adapter (Shopify, Walmart, T1, MercadoLibre ME1) — notifies the marketplace. If all you want is to record the tracking number of a label you bought elsewhere — without moving the status or notifying the channel — use POST /orders/{orderId}/upload-guide.

Fulfill an order

Marks the indicated items as fulfilled. Does not accept tracking information directly.

{
  "items": ["65f3a1b2c4d5e6f7a8b9c0e0"]
}
204No body
(no content)
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/fulfill \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"items":["65f3a1b2c4d5e6f7a8b9c0e0"]}'

Returns nothing: responds 204 No Content with no body.

Required permission: orders:fulfill

Parameters

orderIdstringrequired

Order ID.

itemsstring[]required

Identifiers of the items to mark as fulfilled. Minimum 1 element.

204 No Content — no body

This endpoint always responds with 204 No Content and no body. It does not include trackingNumber or carrier in the request or the response — those fields don't exist on this endpoint. To attach tracking, use POST /orders/fulfillment/tracking or POST /orders/{orderId}/attach-shipment.

Fulfillment capabilities (batch)

Returns, for each order, which fulfillment actions are available and which are blocked.

{
  "orderIds": ["65f3a1b2c4d5e6f7a8b9c0d1"]
}
200Each capabilities object carries more flags beyond the ones shown (around 13 fields per order in total); the ones listed here are confirmed.
{
  "data": {
    "capabilities": {
      "65f3a1b2c4d5e6f7a8b9c0d1": {
        "canDownloadLabel": true,
        "labelBlockedReason": null,
        "canUpdateTracking": true,
        "canMarkAsShipped": false,
        "fulfillmentType": "carrier",
        "channelType": "shopify"
      }
    },
    "orderCount": 1
  }
}
curl -X POST https://api.fenicia.io/orders/fulfillment/capabilities \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"orderIds":["65f3a1b2c4d5e6f7a8b9c0d1"]}'

Returns the fulfillment capabilities map per order (capabilities) and the total number of orders inspected (orderCount), wrapped in data.

Required permission: orders:read

Parameters

orderIdsstring[]required

Order IDs to inspect. Minimum 1.

Generate shipping labels (batch)

Generates shipping labels for one or more orders in a single call.

{
  "orderIds": ["65f3a1b2c4d5e6f7a8b9c0d1"],
  "options": { "format": "pdf", "size": "medium" }
}
200summary is confirmed exactly as shown. The exact shape of each element in labels[] (and the optional mergedLabel field) was not audited field-by-field — confirm the exact contract with support before depending on a specific field inside each result.
{
  "data": {
    "labels": [ { "...": "..." } ],
    "summary": { "total": 2, "success": 2, "failed": 0, "skipped": 0 }
  }
}
curl -X POST https://api.fenicia.io/orders/fulfillment/labels \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"orderIds":["65f3a1b2c4d5e6f7a8b9c0d1"],"options":{"format":"pdf","size":"medium"}}'

Returns the generated labels (labels) and a summary of the batch (summary), wrapped in data.

Required permission: orders:fulfill

Parameters

orderIdsstring[]required

Order IDs.

optionsobject

Generation options. They travel nested inside options, not at the root of the body.

options.format'pdf' | 'zpl' | 'png'

Output format of the label.

options.size'small' | 'medium' | 'large'

Label size (relevant for thermal printers).

Update tracking (batch)

Attaches or updates tracking information for one or more orders in a single call.

{
  "updates": [
    { "orderId": "65f3a1b2c4d5e6f7a8b9c0d1", "tracking": { "trackingNumber": "1Z999AA10123456784", "carrierId": "fedex" } }
  ]
}
200
{
  "data": {
    "updated": 1,
    "failed": 0,
    "results": [
      { "orderId": "65f3a1b2c4d5e6f7a8b9c0d1", "success": true }
    ]
  }
}
curl -X POST https://api.fenicia.io/orders/fulfillment/tracking \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"updates":[{"orderId":"65f3a1b2c4d5e6f7a8b9c0d1","tracking":{"trackingNumber":"1Z999AA10123456784","carrierId":"fedex"}}]}'

Returns the count of updates (updated, failed) and the per-order detail (results), wrapped in data.

Required permission: orders:fulfill

Parameters

updatesarrayrequired

Array of updates, one per order. Minimum 1 element.

updates.orderIdstringrequired

ID of the order to update.

updates.trackingobjectrequired

Tracking information, nested under this key.

updates.tracking.trackingNumberstringrequired

Tracking number.

updates.tracking.carrierIdstring

Carrier code.

updates.tracking.carrierNamestring

Visible carrier name.

updates.tracking.trackingUrlstring

Public tracking URL.

This endpoint processes a batch, not a single order

The body is not { "orderId", "trackingNumber", "carrier" } at the root level — it's the updates[] array above. The field carrier (on its own) does not exist on this endpoint.

Mark as shipped (batch)

Marks multiple orders as shipped in a single call.

{
  "orderIds": ["65f3a1b2c4d5e6f7a8b9c0d1"],
  "shipmentInfo": { "notifyCustomer": true }
}
200
{
  "data": {
    "shipped": 2,
    "failed": 0,
    "results": [
      { "orderId": "65f3a1b2c4d5e6f7a8b9c0d1", "success": true, "markedAsShipped": true, "customerNotified": true },
      { "orderId": "65f3a1b2c4d5e6f7a8b9c0d2", "success": true, "trackingUpdated": true }
    ]
  }
}
curl -X POST https://api.fenicia.io/orders/fulfillment/ship \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"orderIds":["65f3a1b2c4d5e6f7a8b9c0d1"],"shipmentInfo":{"notifyCustomer":true}}'

Returns the count of orders marked as shipped (shipped, failed) and the per-order detail (results), wrapped in data.

Required permission: orders:fulfill

Parameters

orderIdsstring[]required

Order IDs to mark as shipped.

shipmentInfoobject

Shipping information to apply to all orders in the batch. There is no carrier field at the root of the body — carrier information, if applicable, goes inside shipmentInfo.tracking.

shipmentInfo.trackingobject

Tracking information to apply. Same shape as tracking in the update-tracking endpoint (above).

shipmentInfo.tracking.trackingNumberstringrequired

Tracking number.

shipmentInfo.tracking.carrierIdstring

Carrier code.

shipmentInfo.tracking.carrierNamestring

Display name of the carrier.

shipmentInfo.tracking.trackingUrlstring

Public tracking URL.

shipmentInfo.shippedAtstring (ISO)

Ship date/time to record.

shipmentInfo.notifyCustomerboolean

Whether to send a notification to the customer.

Available carriers

Returns the available carriers, depending on how you query it: by orders, by channel, or the default catalog.

{
  "orderIds": ["65f3a1b2c4d5e6f7a8b9c0d1"]
}
200The exact shape depends on the resolved mode (by-orders, by-channel, or default) and was not audited field-by-field for each variant — the mode field is confirmed as the discriminator.
{
  "data": {
    "mode": "by-orders"
  }
}
curl -X POST https://api.fenicia.io/orders/fulfillment/carriers \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"orderIds":["65f3a1b2c4d5e6f7a8b9c0d1"]}'

Returns the available carriers; the mode field indicates how the response was resolved (by-orders, by-channel, or default) — the exact shape of the rest of the fields was not audited field-by-field for each variant.

Required permission: orders:read

Parameters

orderIdsstring[]

Order IDs — if you send these, the response is resolved per order.

channelTypestring

Channel type — if you send this (without orderIds), the response is resolved per channel.

Next steps