Skip to Content
FastracDocs
API reference

Retrieve a shipping rate

GET
/b2b/shipping-rate/{code}

Returns a rate you quoted earlier, for example to re-display it before checkout. Expired rates are still returned; check validUntil before you use the code to create an order.

Requires the READ_SHIPPING_RATES permission.

Authorization

bearerAuth
headerAuthorizationBearer <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>.

Path Parameters

code*string

The shippingRateCode returned by Get shipping rates.

Response Body

The shipping rate.

application/json
  1. response
statusCode*integer
message*string
data*
Example Request
curl -X GET 'https://sandbox-api.fastrac.example/b2b/shipping-rate/string'
Example Response
{  "statusCode": 0,  "message": "string",  "data": {    "shippingRateCode": "string",    "validUntil": "2019-08-24T14:15:22Z",    "courierCode": "string",    "serviceName": "string",    "serviceType": "INSTANT",    "etdRange": "string",    "isSupportCod": true,    "isSupportDropOff": true,    "isSupportPickup": true,    "priceDetail": {      "basePrice": 0,      "fastracPrice": 0,      "discountBreakdown": {        "discountPercentage": 0,        "discountAmount": 0      },      "insuranceBreakdown": {        "insurancePercent": 0,        "insuranceMinimum": 0,        "insuranceAdminFee": 0,        "insurance": 0      },      "taxBreakdown": {        "ppnInsurance": 0,        "ppnShipment": 0,        "ppnCod": 0      },      "totalPrice": 0,      "currency": "string",      "totalPriceCalculation": "string",      "codBreakdown": {        "itemValue": 0,        "codBilled": 0,        "codDisbursement": 0,        "codFee": 0,        "codFeePercent": 0,        "codCustom": 0      },      "codCalculation": "string"    },    "dimension": {      "length": 0,      "width": 0,      "height": 0,      "weight": 0    },    "origin": {      "fullAddress": "string",      "subdistrictId": "string",      "coordinate": {        "latitude": -90,        "longitude": -180      },      "googleAddress": "string"    },    "destinations": [      {        "fullAddress": "string",        "coordinate": {          "latitude": "string",          "longitude": "string"        },        "stopOrder": 0,        "packages": [          {            "packageCode": "string",            "packageTypeId": 0,            "value": "string",            "isGlassware": true,            "length": 0,            "width": 0,            "height": 0,            "weight": 0,            "description": "string",            "packageNote": "string"          }        ]      }    ]  }}

Was this page helpful?

Get shipping rates POST

Quotes a shipment for one courier or for every courier of a type. Each result is saved as a **shipping rate** with a `shippingRateCode` that is valid until `validUntil`. Pass that code to **Create an order** to book the shipment at the quoted price. Requires the `READ_SHIPPING_RATES` permission. Quoting with `codOption.isCod: true` also requires `USE_COD`.

Create an order POST

Books one or more quoted shipments **and pays for them in the same call**. Each shipment references a `shippingRateCode` from **Get shipping rates**; price, courier service, insurance, COD and packages are taken from that rate. The courier is booked before the response returns, so a successful response already carries each shipment's `airwayBill` and status `PENDING_PICKUP` or `PENDING_DROPOFF`. Requires the `CREATE_ORDER` permission. Orders that use a COD rate also require `USE_COD`. **Payment.** Non-COD orders deduct each shipment's `priceDetail.totalPrice` from your `shippingCredit` balance. COD orders deduct nothing upfront, and every shipment in one order must be either COD or non-COD. **Receivers** are matched to the rate's destinations by position: send them in the same order as the rate's `destinations` (`stopOrder`). If you send fewer receivers than destinations, the last receiver is reused. **Fulfilment.** `shippingOptions.fulfillmentMethod` defaults to `PICKUP` for instant services and `DROPOFF` otherwise. A regular-courier pickup needs `sender.coordinate`. A pickup `schedule` must be at least 15 minutes ahead (Asia/Jakarta); omitted, it is now + 15 minutes. For Lalamove and Dash instant services the pickup time is fixed by the quote: send the same `scheduledAt` you quoted with, or omit `schedule`. **If payment or courier booking fails**, the response is `400` with the message `Payment failed, but order '<code>' was created successfully. Reason: …`. The order stays unpaid and any charge is refunded; quote again and create a new order. If a courier rejects one shipment outright, the order still succeeds and that shipment is returned as `CANCELLED` and refunded. This call is not idempotent. On a timeout, check **List shipments** (filter by `search` or date) before you retry.