Delivery and Shipping

These endpoints cover everything that happens after an order has been processed: recording the delivery, confirming it, uploading evidence (photos/documents), attaching information for an external shipment, and managing its cost. For the fulfillment/shipping preparation itself, see Fulfillment.

Response envelope

Every successful single-resource response follows { "data": {...} }. Errors are always { "error": { "code", "message", "details?" } } with namespace:snake_case codes. Full catalog: Error Reference.

Mark as delivered

Marks the order as delivered. The delivery date is optional — if you omit it, the server's time is used.

{
  "deliveredAt": "2026-07-20T18:30:00.000Z"
}
200Order marked as delivered
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "delivered",
    "_links": {
      "returns": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/returns"
    }
  }
}
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/mark-delivered \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"deliveredAt":"2026-07-20T18:30:00.000Z"}'

Returns the order marked as delivered, wrapped in data.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

deliveredAtstring

ISO 8601 date/time of the delivery. If omitted, the moment the request arrives is used.

Confirm delivery

Formally confirms an order's delivery, with optional notes.

{
  "notes": "Recibido por el cliente en recepción"
}
200
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "delivered",
    "_links": {}
  }
}
curl -X PUT https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/confirm-delivery \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"notes":"Recibido por el cliente en recepción"}'

Returns the order with delivery confirmed, wrapped in data.

Required permission: orders:fulfill

Parameters

orderIdstringrequired

Order ID.

notesstring

Notes associated with the delivery confirmation.

Upload delivery evidence

Registers delivery evidence (photos, documents) associated with the order.

{
  "evidenceUrl": "https://fenicia-order-attachments-prod.s3.us-east-2.amazonaws.com/evidence/delivery-photo.jpg",
  "evidenceType": "photo",
  "notes": "Entregado en la puerta principal"
}
200
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "delivered",
    "_links": {}
  }
}

Returns the updated order after registering the evidence, wrapped in data.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

evidenceUrlstringrequired

URL of the evidence (photo or document). Must be a valid URL.

evidenceTypestring

Type of evidence (free text, e.g. 'photo', 'signature').

notesstring

Notes associated with the evidence.

It doesn't upload the file — it only registers its URL

This endpoint is NOT a two-step upload flow like order attachments (S3 presigned URL + confirmation). evidenceUrl is the already-existing URL of the evidence (for example, a photo you uploaded yourself to your own storage or via the attachments flow) — this endpoint just associates it with the order; it doesn't host the file.

Attach an external shipping label

Attaches to the order the data of a shipping label generated outside Fenicia (for example, purchased directly with the carrier). It only records the package: it does not change the order status.

{
  "trackingNumber": "1Z999AA10123456784",
  "carrier": "fedex",
  "packageItems": [{ "sku": "PROD-001", "quantity": 2 }]
}
200
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "accepted",
    "fulfillmentMode": "manual",
    "deliveryInfo": {
      "carrier": "fedex",
      "waybill": "1Z999AA10123456784",
      "shipments": [
        {
          "source": "seller-manual",
          "carrier": "fedex",
          "trackingNumber": "1Z999AA10123456784",
          "label": { "available": false },
          "structuredItems": [{ "sku": "PROD-001", "quantity": 2 }]
        }
      ]
    },
    "_links": {
      "self": "/orders/65f3a1b2c4d5e6f7a8b9c0d1",
      "attachments": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/attachments",
      "activityLog": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/activity-log",
      "validTransitions": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/valid-transitions",
      "prepare": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/prepare",
      "cancel": "/orders/65f3a1b2c4d5e6f7a8b9c0d1/cancel"
    }
  }
}
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/upload-guide \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"trackingNumber":"1Z999AA10123456784","carrier":"fedex"}'

Returns the order with the label registered, wrapped in data, under deliveryInfo — the shipments[] array (with the newly registered package entry) lives nested inside deliveryInfo, not as a sibling field.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

trackingNumberstringrequired

Tracking number of the label.

carrierstringrequired

Carrier code. 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.

trackingUrlstring

Public tracking URL.

packageItemsarray

Which SKUs travel in THIS package. Omit it and the package takes every shippable line of the order.

packageItems.skustringrequired

SKU of the order line to include in the package.

packageItems.quantitynumberrequired

Quantity of that SKU traveling in this package.

It does NOT change the order status

This endpoint only records the package: it writes deliveryInfo (carrier, waybill, tracking URL), adds the entry to shipments[] with source: "seller-manual" and sets fulfillmentMode: "manual". It does not touch items, does not mark anything as prepared and does not move orderStatus — in the example above the order stays in accepted because that is where it was. To advance the fulfillment lifecycle use POST /orders/{orderId}/prepare.

Only T1 notifies the marketplace

If the order comes from T1 Comercios (origin = sears, sanborns or t1-comercios), the label is also uploaded to the marketplace. On any other channel (Shopify, Walmart, MercadoLibre, …) the label is stored in Fenicia only: the marketplace is never told. If you need the channel to receive the shipment, use prepare.

Idempotent by trackingNumber

Re-posting the same label overlays the existing package in place; it never creates a duplicate. That makes retrying the call safe.

An unknown SKU is dropped, not rejected

If a packageItems entry carries a sku that is not a shippable line of the order, that entry is skipped (it is logged) and the rest of the package is still saved — the request returns 200. Validate SKUs on your side before sending.

An unknown key is silently ignored too

Unlike prepare, whose schema is strict and returns 400 on an unknown field, the upload-guide schema is permissive: a misspelled key (for example trackingnumber in lowercase) produces no error — it is ignored, and the request then fails for a missing trackingNumber, or worse, is saved without the data you thought you sent. Check the exact spelling of the fields.

Attach shipment information

Attaches to the order the complete information of a shipment: carrier, cost, tracking label, estimated dates, origin/destination, and package dimensions.

{
  "trackingNumber": "1Z999AA10123456784",
  "carrier": "fedex",
  "cost": { "providerCost": 180.00, "feniciaFee": 15.00, "totalCost": 195.00, "currency": "MXN" }
}
200
{
  "data": {
    "_id": "65f3a1b2c4d5e6f7a8b9c0d1",
    "orderStatus": "fulfilled",
    "fulfillmentMode": "fenicia-shippments",
    "_links": {}
  }
}
curl -X POST https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/attach-shipment \
  -H "Authorization: Bearer fkapi_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "trackingNumber": "1Z999AA10123456784",
    "carrier": "fedex",
    "cost": { "providerCost": 180.00, "feniciaFee": 15.00, "totalCost": 195.00, "currency": "MXN" }
  }'

Returns the order with the shipment information attached, wrapped in data.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

trackingNumberstringrequired

Tracking number.

carrierstringrequired

Carrier code. If it's 'other', check whether your integration requires a descriptive name — use carrierName for that. 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.

shipmentIdstring

Shipment ID, if one already exists to update.

waybillIdstring

Waybill ID.

carrierNamestring

Visible carrier name.

serviceNamestring

Shipping service name (e.g. 'Express', 'Ground').

providerstring

Provider that originated the shipment (e.g. carrier aggregator).

providerShipmentIdstring

Shipment ID in the provider's system.

costobject

Shipment cost.

cost.providerCostnumber

Cost charged by the shipping provider.

cost.feniciaFeenumber

Fenicia's commission on the shipment.

cost.totalCostnumber

Total cost (providerCost + feniciaFee, unless adjusted).

cost.currencystring

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

trackingUrlstring

Public tracking URL.

labelUrlstring

URL of the PDF label.

labelS3Keystring

S3 key where the label lives, if Fenicia stored it.

deliveryDaysnumber

Estimated transit days.

estimatedDeliveryDatestring

Estimated delivery date (ISO 8601).

purchasedAtstring

Date the shipment was purchased (ISO 8601).

printingFormatstring

'standard' or 'thermal'.

originobject

Shipment origin address. All fields are optional — it's an informational snapshot, not a validated address.

origin.namestring

Name associated with the address.

origin.streetstring

Street.

origin.citystring

City.

origin.statestring

State.

origin.zipCodestring

ZIP/postal code.

origin.countrystring

Country.

destinationobject

Shipment destination address. Same shape as origin.

destination.namestring

Name associated with the address.

destination.streetstring

Street.

destination.citystring

City.

destination.statestring

State.

destination.zipCodestring

ZIP/postal code.

destination.countrystring

Country.

packageobject

Package dimensions.

package.weightnumber

Package weight.

package.weightUnitstring

Weight unit (e.g. kg).

package.lengthnumber

Length.

package.widthnumber

Width.

package.heightnumber

Height.

package.dimensionUnitstring

Dimension unit (e.g. cm).

Shipment cost

Updates or sets the cost of a specific shipment within the order.

{
  "amount": 195.00,
  "currency": "MXN"
}
200
{
  "data": {
    "orderId": "65f3a1b2c4d5e6f7a8b9c0d1",
    "shipmentId": "65f3a1b2c4d5e6f7a8b9c0e2",
    "shippingCost": { "amount": 195.00, "currency": "MXN" }
  }
}

Returns the order ID, the shipment ID, and the assigned cost (shippingCost), wrapped in data.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

shipmentIdstringrequired

Shipment ID within the order.

amountnumberrequired

Amount paid for the shipment (≥ 0).

currencystringrequired

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

This endpoint is only the cost — it doesn't replace attach-shipment

PUT .../shipping-cost only captures or updates the amount paid for a shipment that already exists on the order (identified by shipmentId); it doesn't create the shipment nor accept attach-shipment's other fields (label, carrier, dates). Each operation emits a domain event that lambda-finance-events reflects as an Expense in @fenicia/finance-service.

Remove a shipment's cost

Removes the cost previously assigned to a shipment on the order.

200
{
  "data": {
    "orderId": "65f3a1b2c4d5e6f7a8b9c0d1",
    "shipmentId": "65f3a1b2c4d5e6f7a8b9c0e2",
    "removed": true
  }
}
curl -X DELETE https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/shipments/65f3a1b2c4d5e6f7a8b9c0e2/shipping-cost \
  -H "Authorization: Bearer fkapi_your_api_key"

Returns the order ID, the shipment ID, and whether there was a prior cost (removed), wrapped in data.

Required permission: orders:update

Parameters

orderIdstringrequired

Order ID.

shipmentIdstringrequired

Shipment ID within the order.

Idempotent: removed indicates whether there was a prior cost

If the shipment already had no cost assigned, the call still responds 200 with removed: false — that's not an error, it's intentional idempotency (event consumers may deliver the same removal twice). A shipmentId that doesn't exist on the order does return orders:shipment_not_found (404).

Download an order's shipping labels

Returns presigned S3 URLs to download the order's shipping labels. Each PDF is persisted as an order attachment (the first time) or served from S3 cache on subsequent calls.

200
{
  "data": {
    "orderId": "65f3a1b2c4d5e6f7a8b9c0d1",
    "totalLabels": 1,
    "labels": [
      {
        "identifier": "T1-2026-04-27-00042",
        "downloadUrl": "https://fenicia-order-attachments-prod.s3.us-east-2.amazonaws.com/attachments/...?X-Amz-Signature=...",
        "filename": "t1-T1-2026-04-27-00042_shipping_label.pdf",
        "contentType": "application/pdf",
        "size": 51234,
        "expiresIn": 900,
        "source": "live",
        "carrier": "estafeta",
        "attachmentId": "65f3a1b2c4d5e6f7a8b9c0e5"
      }
    ],
    "processingTimeMs": 432
  }
}
LABEL_URL=$(curl -s https://api.fenicia.io/orders/65f3a1b2c4d5e6f7a8b9c0d1/download-shipping-label \
  -H "Authorization: Bearer fkapi_your_api_key" \
  | jq -r '.data.labels[0].downloadUrl')
 
curl -o label.pdf "$LABEL_URL"

Returns the order's presigned label URLs (labels), their total (totalLabels), and the processing time (processingTimeMs), wrapped in data.

Required permission: orders:read

Parameters

orderIdstringrequired

Order ID.

The PDF never travels as base64

It's persisted as an order attachment in S3 and the API responds with a presigned URL (TTL ~15 min). Download the PDF directly from that URL — you don't need your API key for that second step. Repeated calls for the same order reuse the cached attachment.

Tip

For high-volume batch printing, use POST /orders/fulfillment/labels (see Fulfillment) with several order IDs at once.

Next steps