Getting started
Quickstart
Two requests get you live rates for a package. You don't need to create an order first.
-
Get a token
Send your Ship.com email and password as request headers. You get back a token that's good for 180 days and a refresh token that never changes. Token generation
GEThttps://app.ship.com/public/tokenRequestcurl https://app.ship.com/public/token \ -H "email: $SHIP_EMAIL" \ -H "password: $SHIP_PASSWORD"const res = await fetch("https://app.ship.com/public/token", { headers: { email: process.env.SHIP_EMAIL, password: process.env.SHIP_PASSWORD, }, }); const { oauth } = await res.json(); // oauth.token goes in every request. Store oauth.refreshToken safely.import os, requests res = requests.get( "https://app.ship.com/public/token", headers={"email": os.environ["SHIP_EMAIL"], "password": os.environ["SHIP_PASSWORD"]}, ) token = res.json()["oauth"]["token"] -
Ask for rates
Send origin and destination ZIP codes, plus package weight and dimensions for accurate pricing. Every quote comes back in one response. Field reference
POSThttps://app.ship.com/public/quoteRequestcurl -X POST https://app.ship.com/public/quote \ -H "Authorization: Bearer $SHIP_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "fromZip": "90210", "toZip": "10001", "weight": 2, "length": 10, "width": 8, "height": 4 }'const quote = await fetch("https://app.ship.com/public/quote", { method: "POST", headers: { Authorization: `Bearer ${oauth.token}`, "Content-Type": "application/json", }, body: JSON.stringify({ fromZip: "90210", toZip: "10001", weight: 2, length: 10, width: 8, height: 4, }), }).then((r) => r.json());quote = requests.post( "https://app.ship.com/public/quote", headers={"Authorization": f"Bearer {token}"}, json={ "fromZip": "90210", "toZip": "10001", "weight": 2, "length": 10, "width": 8, "height": 4, }, ).json()Response{ "success": true, "result": { "orderID": 0, "error": null, "prices": [ { "id": "string", "rate": 8.45, "retailRate": 10.20, "serviceLevel": "string", "deliveryDate": "date" } ] } } -
Buy the label
Pick a rate from
pricesand send its details to/public/purchase-label. The response gives you a secure link to download or print the label. Purchase label referencePOSThttps://app.ship.com/public/purchase-label