Multi-shipment and multi-stop orders
Book several parcels in one order, or one instant trip with several drop-off stops.
- Product
- APIShipping Engine API
- Section
- Guides
- Reading time
- 5 min read
Goal: book more than one delivery in a single call, either as several shipments in one order, or as one instant shipment that visits several stops.
Before you start: you can book a single shipment. For multi-stop, you can also book an instant courier.
Pick the right pattern
| You need… | Use | Example |
|---|---|---|
| Several parcels, each with its own courier, route or receiver | Several shipments in one order: one rate per shipment. | A cart split into two boxes; three customers' orders booked together. |
| One driver who drops parcels at several addresses in a row | One multi-stop shipment: one rate with several destinations. | A bakery delivering to five cafés in one trip with Lalamove. |
Several shipments: quote each one
Request one rate per parcel, as usual. Each parcel gets its own
shippingRateCode. Couriers can differ between shipments.All COD or all non-COD
An order can't mix COD and non-COD shipments:
All shipments in one order must be either COD or non-COD.If a cart needs both, create two orders.Several shipments: book them in one call
Put one entry per rate in
shipments:curl -s -X POST "$FASTRAC_API/b2b/orders" \ -H "Authorization: Bearer $FASTRAC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "shipments": [ { "shippingRateCode": "SR-7KQ2M9XA", "sender": { "name": "Toko Contoh", "email": "[email protected]", "phoneNumber": "081234567890" }, "receivers": [{ "name": "Budi Santoso", "phoneNumber": "081298765432", "addressNote": "Pagar hitam", "label": "Rumah", "stopSequence": 1 }], "shippingOptions": { "fulfillmentMethod": "DROPOFF" } }, { "shippingRateCode": "SR-P3N8V1DK", "sender": { "name": "Toko Contoh", "email": "[email protected]", "phoneNumber": "081234567890" }, "receivers": [{ "name": "Rina Lestari", "phoneNumber": "085677778888", "addressNote": "Kos putri, kamar 3", "label": "Kos", "stopSequence": 1 }], "shippingOptions": { "fulfillmentMethod": "DROPOFF" } } ] }'The price of every non-COD shipment is deducted from your balance in one step. If the total is more than your balance, no shipment is booked.
Several shipments: check each result
The order response lists every shipment with its own
code,statusandairwayBill. Match them to your parcels by receiver, or readGET /b2b/shipments/{code}/details, which includes theshippingRateCode.Then check each
status(see partial failures below).Multi-stop: quote one trip with ordered stops
Multi-stop delivery is available with Lalamove. Other couriers carry one destination per shipment: for them, use several shipments instead.
Quote with
courierCode: "LALAMOVE", coordinates for every point, and a uniquestopOrder(1, 2, 3…) on each destination. The driver visits the stops instopOrderorder.curl -s -X POST "$FASTRAC_API/b2b/shipping-rate" \ -H "Authorization: Bearer $FASTRAC_TOKEN" \ -H "Content-Type: application/json" \ -d '{ "origin": { "fullAddress": "Jl. Tebet Raya No. 12, Jakarta Selatan", "subdistrictId": "3174091001", "coordinate": { "latitude": -6.2262, "longitude": 106.8530 } }, "destinations": [ { "stopOrder": 1, "fullAddress": "Jl. Kemang Raya No. 5", "subdistrictId": "3174071004", "coordinate": { "latitude": -6.2607, "longitude": 106.8137 } }, { "stopOrder": 2, "fullAddress": "Jl. Senopati No. 20", "subdistrictId": "3174071002", "coordinate": { "latitude": -6.2297, "longitude": 106.8089 } } ], "courierCode": "LALAMOVE", "vehicle": "BIKE", "packages": [{ "itemValue": 100000, "isGlassware": false, "weight": 2000, "dimension": { "length": 30, "width": 20, "height": 20 } }] }'You get one rate covering the whole trip. Its
destinationscome back sorted bystopOrder.Multi-stop: send one receiver per stop, in stop order
In the order,
receiversare matched to the rate's destinations by position: the first receiver belongs tostopOrder1, the second tostopOrder2, and so on. SetstopSequenceto the same number so your request is easy to read.Order body { "shipments": [{ "shippingRateCode": "SR-LM9S2T7W", "sender": { "name": "Toko Contoh", "email": "[email protected]", "phoneNumber": "081234567890", "coordinate": { "latitude": "-6.2262", "longitude": "106.8530" } }, "receivers": [ { "name": "Kafe Satu", "phoneNumber": "081200000001", "addressNote": "Pintu samping", "label": "Kafe", "stopSequence": 1 }, { "name": "Kafe Dua", "phoneNumber": "081200000002", "addressNote": "Lantai 2", "label": "Kafe", "stopSequence": 2 } ], "shippingOptions": { "fulfillmentMethod": "PICKUP" } }] }Order matters
If you send the receivers in a different order from the stops, each parcel goes to the right address with the wrong name and phone number. Always sort receivers by
stopOrderbefore you send them, and send exactly one receiver per stop.
Partial failures
| What happens | Result | What to do |
|---|---|---|
| A request field is invalid, or any rate code is expired or unknown | 400, nothing is created. | Fix it or re-quote that parcel, then send the whole order again. |
| Your balance doesn't cover the total, or a courier can't be reached | 400 Payment failed, but order '…' was created successfully. Reason: …. The order stays DRAFT and everything is refunded. | Fix the reason, re-quote, and create a new order. Before that, check GET /b2b/shipments?orderCode=FSO-…: if any shipment of the failed order is listed, contact support instead of booking it again. |
| A courier rejects one shipment outright | 201. That shipment is CANCELLED and refunded; the others are booked. | Re-quote and book the rejected parcel in a new order. |
| Later, one shipment needs cancelling | Cancel it by its shipment code. | See Cancel a shipment. |
Checklist
- One rate per shipment; all COD or all non-COD in one order.
- Your balance covers the sum of all non-COD shipments.
- After booking, check every shipment's
statusand rebook anyCANCELLEDone. - Multi-stop only with Lalamove, with a unique
stopOrderper destination. - Receivers sorted by
stopOrder, one per stop.
Was this page helpful?