Buy Label Batch Labels
POST/api/shipping-label-batches/:shippingLabelBatch/purchase
Buys labels in the background, at each item's quoted rate. Without item_ids it buys the batch's rated items and resumes those still purchasing; failed rows are bought only when named in item_ids (e.g. Retry). An item whose purchase was already started at the provider is always resumed on the same attempt, never bought twice. Returns 202 with a background job id (tracked_job_log_id); poll the job, then read the batch and its items. While the job runs the batch is purchasing. Each bought label records a shipment on its fulfillment order (sales_order_fulfillment_id); an item whose label could not be bought ends failed with a failure_code. The batch then ends completed or completed_with_failures. Items bought earlier whose shipment was not recorded are finished too.
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body (optional):
item_ids(array of item IDs, 1-500): buy only these items, failed ones included. Omit to buy the rated items and resume the purchasing ones.
409 when the batch is already being bought or rated. 422 when nothing is buyable, or when the run would start a fresh purchase (a rated row, or a purchasing / failed row with nothing at the provider) while rates are stale (options changed after rating: rate again) or the ship date is in the past. Resuming purchases already started and recording bought labels are never refused for those reasons.
Requires the orders write scope and the fulfillment_orders.index and fulfillment_orders.ship permissions.
Request
Responses
- 202
- 401
- 403
- 404
- 409
- 422
- 429
Accepted
Response Headers
Unauthenticated — the bearer token is missing, revoked, expired, or malformed. Never retry automatically; fix the credential. See the Errors guide.
Forbidden — the token lacks a required scope, the endpoint is not available to API tokens, or the user behind the token lacks the permission. A human must adjust the token scopes or user permissions; do not retry.
Not found — no record with the given identifier (or the route does not exist). Verify the ID before retrying.
Conflict
Response Headers
Unprocessable Entity
Response Headers
Rate limited — platform limit is 1,000 requests/min; individual tokens may carry lower limits. Honor the Retry-After header before retrying. See the Rate Limits guide.