Shipments

Overview

Shipments: N:N items with the order, tracking, label and dispatch.

A shipment is the package that takes one or more order items to the buyer. marketapi syncs the shipment, tracking and dispatch deadline, and you request labels and dispatch through jobs.

The whole journey: The order lifecycle.

Endpoints

MethodPathWhat it does
GET/v1/shipmentsList shipments
GET/v1/shipments/{shipmentId}Get shipment
GET/v1/shipments/{shipmentId}/trackingGet tracking
GET/v1/shipments/{shipmentId}/dispatch-optionsGet dispatch options
POST/v1/shipments/{shipmentId}/label-requestsRequest label
POST/v1/shipments/{shipmentId}/dispatchesDispatch shipment
POST/v1/shipments/{shipmentId}/actionsRun shipment action

Rules

  • N:N with lines. Each shipment item links an order line to a quantity. One shipment carries lines from several orders, and one line can ship in several shipments.
  • The label is a confidential file (pdf or zpl). It never has a public URL. You download it through asset, and every read is logged.
  • The invoice blocks shipping. With invoice_required in statusReasons, label and dispatch answer 409 until the invoice is accepted.
  • Commands are jobs. Label, dispatch and actions answer 202 with a job. Without marketplace support: 422 CAPABILITY_UNSUPPORTED, and no job is created.

States

status: pending, ready_to_ship, shipped, delivered, not_delivered, cancelled. The order fulfillmentStatus follows. When the shipment moves to shipped, the reserved stock is written off (order policy).

Webhooks

shipment.updated (any change) and shipment.label_ready (carries assetId and format).