Book Freight
POST/api/freight/shipments/:id/book
Book one of the load's rates with the freight provider. This books a real truck and is charged to the merchant's freight account unless the connection uses a sandbox key (is_sandbox is then true and nothing is charged).
orders:writeGrant this scope to your token under Settings → Developer → Personal Access Tokens.
Body fields
rate_id(required): one of the load's current rates.pickup_date(Y-m-d, today or later; defaults to the load's pickup date).pickup_window/delivery_window:fromandto(H:i, required together,toafterfrom).pickup_contact/delivery_contact:name(max 80),phone(max 30),email; each overrides the stop's contact for this booking.acknowledge_retailer_routing(boolean): required astruewhen the retailer already routed the linked shipment to a carrier (seeretailer_routingon Get Freight Load); booking replaces that carrier on the ship notice.
The booking is reserved before the provider is called, so two calls can't book twice. If the provider's answer is lost the load stays booking_unknown and the call returns 502; use Check Freight Booking to resolve it. A provider refusal returns the load to quoted with a 422.
Refused with 409 when: the load is not quoted, the quote is stale or the rate expired or was replaced, the shipment already has an active booking, the retailer routing was not acknowledged (reasons: ["retailer_routing"]), or a stop lacks company, street, city, state, ZIP, contact name, phone or email.
On success the load is booked and gets a bill of lading number (SKU.io numbers it when the provider does not), the carrier PRO, SCAC and carrier name.
Side effect on the linked shipment. When the load is linked to a sales order shipment, booking writes the load's references into that shipment's freight details, which retailer EDI ship notices (856) are built from: bill_of_lading_number, carrier_pro_number, carrier_scac, carrier_name, transportation method M (motor) and the scheduled delivery date (the estimated delivery date). Fields the booking does not set (ship notice number, routing sequence, status code) are kept. If the shipment's ship notice was already sent, nothing is changed and booking.fulfillment_locked is true. Cancelling the load later restores the previous values of any field still holding the booked value.
Errors. 409 when the load is in a state that does not allow this action; the body carries message and reasons (every problem, one per entry). 422 when the freight provider rejected the request; errors maps each field the provider named to its messages (an invalid API key appears under credentials). 502 when the freight provider did not answer; code carries the provider's error code when it sent one.
Authentication: Requires Bearer token with the orders:write scope.
Requires permission: freight.book
Request
Responses
- 200
- 401
- 403
- 404
- 409
- 422
- 429
- 502
OK
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 Content
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.
Bad Gateway