Skip to main content

Buy Fulfillment Order Label

POST 

/api/fulfillment-orders/:fulfillmentOrder/labels

Buys the label for one rate from Get Fulfillment Order Label Rates, right away. The rate is re-quoted on exactly that service first, so a rate the provider no longer offers fails here instead of at the carrier. A marketplace rate (walmart_sww, amazon_buy_shipping) is bought through Walmart or Amazon; any other through the label account.

Required scope: orders:write

Grant this scope to your token under Settings → Developer → Personal Access Tokens.

Body:

  • item_id (integer, required): the item_id returned by Get Fulfillment Order Label Rates for this order. It may also be the id of a label already bought for this order in any label batch (from Get Fulfillment Order Label): then nothing is bought or re-rated, and Buy only records the order's shipment for that label (a retry when recording it failed).
  • service_token (string, max 191, required): the rate's service_token.
  • provider (required): the rate's provider — easypost, shippo, shipstation, starshipit, shiprush, shiptheory, shippit, walmart_sww or amazon_buy_shipping.
  • integration_instance_id (integer, required): the rate's integration_instance_id (the label account, or the Walmart / Amazon store).
  • benefits (array of strings, optional, max 10, each max 64): the protections the chosen rate showed, e.g. ["claims_protected"]. The label is only bought while the re-quoted rate still has them; if it lost one, nothing is bought and the call returns 422 (status no_rate) saying so. A rate Get Fulfillment Order Label Rates showed as A-to-z protected is held to that even when benefits is not sent.

Returns data (the label batch item, as Get Label Batch Item: status, quoted, purchased with tracking numbers, cost and benefits, marketplace_label, failure fields) and a message. 200 when the label is bought, and also when it already was (repeating the call never buys twice). 422 with the same data and the reason when it was not bought (status no_rate or failed; get rates again). Print the label with Download Label Batch Item Label and void it with Void Label Batch Labels, using shipping_label_batch_id and the item id.

Also 422 (with errors.item_id) when item_id is not this order's row from Get Fulfillment Order Label Rates, or its label was voided (get rates again), and for missing or invalid fields.

Requires the orders write scope and the fulfillment_orders.index and fulfillment_orders.ship permissions.

Request​

Responses​

OK

Response Headers
    Content-Type