ShipBob Logistics API
This API lets you create shipping labels and sync tracking numbers for orders processed through ShipBob’s logistics system. It’s straightforward to integrate and works in both sandbox and production environments.
Create an Account
To get started, you’ll need a ShipBob account. Sign up here. After signing up, reach out to your ShipBob representative and they’ll guide you through the process and provide the necessary credentials.
Base URLs
Production (Live)
Sandbox (Testing)
Authentication
Authentication depends on the API you’re calling:
For logisticslabelprintingapi Endpoints
For https://logisticslabelprintingapi-stage.shipbob.dev/ or https://logisticslabelprintingapi.shipbob.com/:
Every endpoint accepts either of the following. Pick one — you do not need both.
Option 1 — Token (SBL_authToken or PAT)
Use an SBL_authToken provided by your ShipBob rep, or a Personal Access Token (PAT) generated in the ShipBob dashboard under Integrations > API Tokens > Generate new token.
The Bearer prefix is optional for this API — both of the following are accepted:
Option 2 — OAuth 2.0 (Authorization Code with PKCE)
Recommended for multi-user applications. Register an OAuth app in the ShipBob dashboard under Integrations > OAuth Apps > Create App, run the authorization code flow with PKCE, then send the returned access token as a Bearer token:
On sandbox, replace auth.shipbob.com with authstage.shipbob.com.
The same settings in Postman’s Authorization tab:

The token exchange call carries the PKCE verifier:
Access tokens expire after 1 hour. For the full step-by-step flow, including how to generate the code_verifier and code_challenge, see Authentication.
For sandbox-api or api.shipbob.com Endpoints
For https://sandbox-api.shipbob.com/ or https://api.shipbob.com/:
Use a Personal Access Token (PAT), which you can generate in the ShipBob dashboard by going to Integrations > API Tokens > Generate new token.
Create an Order and Purchase a Label
POST /api/v1/CreateOrderAndPurchaseLabel
Creates a packed order and purchases its final-mile carrier label in a single synchronous call, returning the carrier, tracking number, and a URL to the label.
If an order with the same reference_id already exists but has no final-mile label yet, the existing order is reused and only the label is purchased. If it already has a label, the call returns 409 — retrieve the existing label instead.
Headers
This endpoint does not use the Label-Type header. Request the label format with the order.label_file_format field in the body instead.
Request Body
Key Fields
Unlike POST /api/order:createLabel, measurements and products are mandatory here, and every measurement must be a positive whole number. Unrecognized fields are ignored.
Response
On success (HTTP 200):
tracking_urlmay benullif the carrier URL is not yet available. This is never fatal — the label is still valid.
Error Responses
400 responses include the failing fields:
How This Differs From POST /api/order:createLabel
Both endpoints create a ShipBob order and return a shipping label, and both produce a normal ShipBob shipment. Choose based on how much of the order you know upfront:
Both endpoints behave identically downstream. Orders created here appear in Sync Tracking Numbers — including the order.shipment.tracking_received webhook — and can be refunded or resubmitted through Bulk Cancel Labels using the same reference_id.
Available in sandbox at https://logisticslabelprintingapi-stage.shipbob.dev. Use location_id 33 or 19 when testing; contact your ShipBob rep for your production location_id.
Create a Shipping Label
POST /api/order:createLabel
Generate a shipping label for an order. Labels default to ZPL format, but you can request PDF by adding a Label-Type header.
Headers
Request Body
Send a JSON object with order details:
Key Fields
Response
On success (HTTP 200):
label: ZPL string or PDF data (based onLabel-Type).
Error Responses
400: Bad request (check your JSON).401: Invalid or missing credentials (SBL_authToken, PAT, or OAuth 2.0 access token).500: Server issue—try again later.
Bulk Cancel Labels
POST /api/order:bulk-cancel
You can use this endpoint to refund or cancel shipping labels. Additionally, it allows you to cancel and resubmit one or more orders using the same reference_id. Once an order is canceled through this endpoint, it can be resubmitted as needed. However, please note that canceled orders will no longer be accessible in the UI or via the API.
Headers
Request Body
Send a JSON object with order details:
Sync Tracking Numbers
Option 1 - Webhook
Option 2 - Polling
To receive tracking updates, subscribe to the order.shipment.tracking_received webhook that fires usually within 5 minutes after creating a shipping label.
Learn how to subscribe here.
Tips for Success
- Test in the sandbox first (use
location_id: 33for label creation). - Generate your Personal Access Token in the ShipBob dashboard for
sandbox-apiorapi.shipbob.comcalls. - Contact your ShipBob rep for your production
location_idor if you hit a 401 error with yourSBL_authToken. - Poll at least every 30 minutes to avoid missing tracking updates.
Diagram
FAQs
How to sign up for a sandbox account?
Sign up for a sandbox by following this link.

