Cancel a shipment
Cancels one shipment and refunds what was paid for it to where the payment came from. Before the courier has an airway bill, the shipment is cancelled immediately. After that, the courier is asked to cancel first; if the courier refuses (for example because the parcel is already picked up), the error is returned and nothing changes.
Calling it again on a cancelled shipment succeeds without doing anything. Delivered shipments and shipments already being returned to the sender can't be cancelled.
Requires the CANCEL_ORDER permission. No request body.
bearerAuthAuthorizationBearer <token>An access token from the OAuth2 client-credentials grant. Exchange your API key
(client_id + client_secret) at the token endpoint and send
Authorization: Bearer <access_token>.
shipmentCode*stringThe shipment code from Create an order or List shipments.
^SHP-[0-9]{6}-[A-Z0-9]{6}$The shipment is cancelled (or already was).
application/json- response
statusCode*integermessage*stringdata?nullAlways empty.
curl -X POST 'https://sandbox-api.fastrac.example/b2b/shipments/cancel/string'{ "statusCode": 200, "message": "Shipment successfully cancelled."}Was this page helpful?
Track a shipment GET
Asks the courier for the latest tracking events and returns them merged with the stored history. If the courier reports a new status, the shipment is updated (and the matching webhook is sent) as part of this call. If the courier can't be reached, the stored history is returned. Pass either the shipment code or the courier's airway bill. A shipment can be tracked only after the courier has assigned an airway bill. Prefer webhooks for status changes; call this when a user opens a tracking page. Requires the `READ_ORDER` permission.
Simulate a status (sandbox only) POST
**Sandbox only.** Production returns `403`. Pretends that the courier reported an event for one of your sandbox shipments, so you can test your webhook handler and status logic end to end without waiting for a real courier. Use a shipment that already has an airway bill. | `status` | Webhook sent | Effect on the shipment | | --- | --- | --- | | `DRIVER_ASSIGNED` | `shipment.pending_pickup` | Sample driver details are attached | | `TRANSIT` | `shipment.in_transit` | Status becomes `IN_TRANSIT` | | `DELIVERED` | `shipment.delivered` | Status becomes `DELIVERED` | | `CANCELLED` | none (use **Cancel a shipment** to receive `shipment.cancelled`) | Status becomes `CANCELLED` and the shipment is refunded | | `RTS` | `shipment.rts_billed` if a return fee applies | Status becomes `RTS_DELIVERED` (returned to the sender) | | `AIRWAYBILL_UPDATED` | `shipment.airway_bill_updated` | The airway bill is replaced by a `SIM-…` number | | `PRICE_CHANGED` | `shipment.price_changed` | None: webhook only, sample values (Rp 10.000 → Rp 15.000) | | `WEIGHT_CHANGED` | `shipment.measurement_changed` | None: webhook only, sample values | | `RTS_BILLED` | `shipment.rts_billed` | None: webhook only, sample fee Rp 15.000 | Requires the `CANCEL_ORDER` permission.