GatewayPost API, version 1
For shops, factories, ERPs, marketplaces and apps that want to ship with GatewayPost from their own software: get prices from every seller, book, track, print courier labels and be told when things move. Carriers that want GatewayPost to call their system read the carrier API guide instead.
Start in four steps
- Sign up or sign in, then open API keys (customers: Tools; partners: My services).
- Make a sandbox key (it starts
gp_test_). Prices are real; bookings, parcels, confirmations and cancellations are pretend and their numbers startSANDBOX-. - Try the calls below. When your software works, make a live key (
gp_live_). - Copy the key when it is shown: it is shown once. Keep it on your server, never in a web page or phone app. Lost it? Take it back and make a new one.
Sign-in
Send the key with every call: Authorization: Bearer gp_live_… (or the header X-Api-Key). A key acts as the person who made it and can never do more than they can. Each key only does what its scopes allow: rates, bookings, tracking, parcels, webhooks.
Calls
Base address: https://<your GatewayPost site>/api. JSON in and out. Amounts are in rupees (and in paise as totalMinor), GST shown separately in tax.
| Call | Scope | What it does |
|---|---|---|
GET /v1/ping | any | Checks the key; tells its mode, scopes and limit |
POST /v1/rates | rates | Prices from every seller for a route and packages |
POST /v1/bookings | bookings | Books one price (a draft shipment with its payment plan) |
POST /v1/bookings/{number}/confirm | bookings | Confirms the booking once what is due is paid |
GET /v1/shipments/{number} | tracking | Status and tracking events |
POST /v1/shipments/{number}/cancel | bookings | Cancels, with an optional reason |
POST /v1/parcels | parcels | Books a courier parcel; gives its AWB |
GET /v1/parcels/{awb} | tracking | A parcel with its tracking, NDR and COD |
POST /v1/parcels/labels | parcels | Labels for many AWBs, as PDF or ZPL |
GET /v1/webhooks/events | webhooks | The events you can be told about |
GET / POST /v1/webhooks | webhooks | Your webhook addresses; add one |
POST /v1/webhooks/{id}/disable | webhooks | Switch a webhook off |
Prices
curl -X POST https://gatewaypost.net/api/v1/rates \
-H "Authorization: Bearer gp_test_…" -H "Content-Type: application/json" \
-d '{ "serviceType": "ROAD_FTL", "from": "110057", "to": "400001",
"packages": [{ "quantity": 2, "lengthCm": 120, "widthCm": 100, "heightCm": 150, "weightKg": 300 }] }'{ "quoteId": "6c1f…", "serviceType": "ROAD_FTL", "from": "110057", "to": "400001",
"options": [ { "optionId": "a3b9…", "seller": "Sample Roadways", "verified": true, "byGateway": false,
"soldBy": "Sample Roadways", "gstBy": "Sample Roadways", "rating": { "average": 4.6, "count": 31 },
"livePrice": false, "vehicle": "TRUCK_20FT", "total": 42480, "totalMinor": 4248000, "currency": "INR",
"charges": [ { "code": "FREIGHT", "name": "Freight", "amount": 36000, "optional": false } ],
"transitDays": { "min": 3, "max": 3 }, "deliverBy": { "from": "2026-11-28", "to": "2026-11-28" },
"co2eKg": 412.5, "badges": ["cheapest"], "bookable": true, "validUntil": "2026-11-25T18:30:00Z" } ] }Service types include ROAD_FTL, ROAD_PTL, COURIER_EXPRESS, COURIER_SURFACE, rail and air services; they are listed on the site. Only options with "bookable": true can be booked straight away; prices hold until validUntil.
Book, pay, confirm
POST /v1/bookings
{ "quoteId": "6c1f…", "optionId": "a3b9…", "reference": "PO-1042",
"consignor": { "name": "Asha Verma", "phone": "+91 98100 00000", "line1": "53 Vasant Apartment", "city": "New Delhi", "postalCode": "110057" },
"consignee": { "name": "Ravi Patil", "phone": "+91 98200 00000", "line1": "12 Marine Drive", "city": "Mumbai", "postalCode": "400001" },
"payment": { "route": "R1" } }{ "sandbox": false, "number": "GP000000123", "status": "DRAFT", "total": 42480, "paymentPlan": { … },
"next": "Pay what is due before booking (if anything), then POST /v1/bookings/{number}/confirm." }The addresses must use the PIN codes the price was given for. If something is due before booking (your payment terms), pay it on the site or by your usual method, then confirm.
Track and cancel
GET /v1/shipments/GP000000123{ "number": "GP000000123", "status": "IN_TRANSIT", "statusName": "In transit", "milestone": "On the way",
"from": "110057", "to": "400001", "events": [ { "status": "BOOKED", "at": "2026-11-25T04:30:00Z" }, … ] }POST /v1/shipments/GP000000123/cancel
{ "reason": "Customer changed the plan" }Courier parcels and labels
POST /v1/parcels
{ "serviceType": "COURIER_EXPRESS", "orderNo": "SHOP-5521", "paymentMode": "prepaid",
"pickup": { "name": "Shop store", "phone": "+91 98100 00000", "line1": "…", "postalCode": "110057" },
"deliverTo": { "name": "Ravi Patil", "phone": "+91 98200 00000", "line1": "…", "postalCode": "400001" },
"packages": [ { "quantity": 1, "lengthCm": 30, "widthCm": 20, "heightCm": 10, "weightKg": 1.2 } ] }POST /v1/parcels/labels
{ "awbs": ["GP12345678"], "format": "pdf" } → a PDF (or ZPL text for label printers)Webhooks
Add an https address and the events you want (GET /v1/webhooks/events lists them). Each message is signed with your webhook secret in the x-gatewaypost-signature header (t=(HMAC-SHA256 of the body)lt;time(HMAC-SHA256 of the body)gt;,v1=(HMAC-SHA256 of the body)lt;HMAC-SHA256 of "time.body"(HMAC-SHA256 of the body)gt;); failed messages are tried again.
POST /v1/webhooks
{ "url": "https://shop.example.com/gatewaypost", "events": ["parcel.in_transit", "parcel.delivered"] }Limits and errors
- Each key has a limit of calls a minute (120 unless GatewayPost or you set lower). Above it you get
429; wait a minute. 401the key is missing, wrong, expired or taken back.403the key or its owner may not do this.400something in your request is wrong (fieldstells which).404not found or not yours.409the state does not allow it (for example already booked).- Every call is logged for 30 days; you see them under API keys → Show calls.
{ "statusCode": 403, "message": "This key may not do this; it needs the \"bookings\" scope", "error": "Forbidden" }Version 1 stays as it is; new fields may be added, but nothing is taken away or renamed. A change that would break software comes as version 2.