Skip to Content
FastracDocs
API reference

Get shipping rates

POST
/b2b/shipping-rate

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.

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

Request Body

application/json
  1. body
origin*
destinations*array<>
Items1 <= items
courierCode*string

A courier code such as JNE, JNT, SPX, LALAMOVE, or one of these to compare many couriers at once: REGULAR (all regular couriers), INSTANT (all instant couriers), ALL (everything). Case-insensitive.

vehicle?string

Required when courierCode is PAXEL, LALAMOVE, DASH, GRAB or INSTANT. For example BIKE or CAR.

packages*array<>

Every package travels together. Multiple packages are combined into one parcel for pricing.

Items1 <= items
insurance?boolean

Add insurance to the price. Required for every courier except PAXEL, LALAMOVE, DASH and GRAB.

scheduledAt?string

Pickup time to quote, ISO 8601 with offset. Omit for as soon as possible. LALAMOVE and DASH book exactly this time.

Formatdate-time
codOption?

Cash on delivery. Requires the USE_COD permission.

Response Body

One rate per courier service that can carry the shipment.

application/json
  1. response
statusCode*integer
message*string
data*array<>
curl -X POST 'https://sandbox-api.fastrac.example/b2b/shipping-rate' \  -H 'Content-Type: application/json' \  -d '{  "origin": {    "fullAddress": "Jl. Tebet Raya No. 12, Tebet Barat, Jakarta Selatan",    "subdistrictId": "3174091001"  },  "destinations": [    {      "fullAddress": "Jl. Braga No. 8, Braga, Sumur Bandung, Kota Bandung",      "subdistrictId": "3273011003"    }  ],  "courierCode": "JNE",  "insurance": true,  "packages": [    {      "itemValue": 500000,      "isGlassware": false,      "weight": 1200,      "dimension": {        "length": 30,        "width": 20,        "height": 10      }    }  ]}'
Example Response
{  "statusCode": 201,  "message": "Shipping rate created successfully.",  "data": [    {      "shippingRateCode": "SR-7KQ2M9XA",      "validUntil": "2026-11-20T09:15:00.000Z",      "courierCode": "JNE",      "serviceName": "JNE Reguler",      "serviceType": "REGULAR",      "etdRange": "2 - 3 Days",      "isSupportCod": true,      "isSupportDropOff": true,      "isSupportPickup": true,      "priceDetail": {        "basePrice": 10000,        "fastracPrice": 9000,        "discountBreakdown": {          "discountPercentage": 10,          "discountAmount": 1000        },        "insuranceBreakdown": {          "insurancePercent": 0.25,          "insuranceMinimum": 1500,          "insuranceAdminFee": 2000,          "insurance": 3500        },        "taxBreakdown": {          "ppnInsurance": 385,          "ppnShipment": 99,          "ppnCod": 0        },        "totalPrice": 12984,        "currency": "IDR",        "totalPriceCalculation": "fastracPrice + insurance + ppnInsurance + ppnShipment"      },      "dimension": {        "length": 30,        "width": 20,        "height": 10,        "weight": 1200      },      "origin": {        "fullAddress": "Jl. Tebet Raya No. 12, Tebet Barat, Jakarta Selatan",        "subdistrictId": "3174091001"      },      "destinations": [        {          "fullAddress": "Jl. Braga No. 8, Braga, Sumur Bandung, Kota Bandung",          "coordinate": {            "latitude": "",            "longitude": ""          },          "stopOrder": 1,          "packages": [            {              "packageCode": "PKG-3M8XQ1",              "packageTypeId": null,              "value": "500000",              "isGlassware": false,              "length": 30,              "width": 20,              "height": 10,              "weight": 1200,              "description": null,              "packageNote": null            }          ]        }      ]    }  ]}

Was this page helpful?