| Property Name | Data Type | Required | Notes |
|---|---|---|---|
origin | Number | Yes | ID of the origin region (subdistrict). |
destination | Number | Yes | ID of the destination region (subdistrict). |
items | Array<Object> | Yes | List of items in the shipment. See items object structure below. |
cod | String | No | Indicates if COD is requested. Allowed values: "0" (No) or "1" (Yes). |
insurance | String | No | Indicates if insurance is requested. Allowed values: "0" (No) or "1" (Yes). |
cod_amount | Number | No | Custom COD amount. If provided, this value overrides the item value calculation. |
items Object Fields| Property Name | Data Type | Required | Notes |
|---|---|---|---|
name | String | Yes | Name or description of the item. |
weight | Number | Yes | Weight of a single item in grams. |
width | Number | Yes | Width of a single item in centimeters. |
height | Number | Yes | Height of a single item in centimeters. |
length | Number | Yes | Length of a single item in centimeters. |
quantity | Number | Yes | Number of items of this type. |
value | Number | No | Price of a single item. Required if cod or insurance is set to "1". |
nextday, regular, sameday).data Objectdata object contains the following properties, each an array of B2bCourierItem objects:nextdayregularsamedaycargoB2bCourierItem Object| Property Name | Data Type | Description |
|---|---|---|
courier_name | String | Name of the courier (e.g., "AnterAja"). |
courier_code | String | Unique code for the courier (e.g., "anteraja"). |
dimension | String | The final dimension of the package used for calculation. |
service | String | Type of service (e.g., "Nextday"). |
code_service | String | Unique code for the service (e.g., "ND"). |
mapping_service | String | Internal service mapping (e.g., "nextday"). |
etd | String | Estimated time of delivery (e.g., "1-1 Days"). |
base_tariff | Number | Base shipping price. |
discount | Number | Discount amount. |
total | Number | Final shipping price (base_tariff - discount + insurance_detail.insurance if insurance is enabled). |
is_cod | Boolean | Indicates if COD is available for this service. |
is_pickup | Boolean | Indicates if pickup service is available. |
is_dropoff | Boolean | Indicates if drop-off service is available. |
weight | Number | The chargeable weight of the package in kilograms. |
matrix_volume_weight | Number | The calculated volumetric weight. |
actual_weight | Number | The actual weight of the package. |
unit_weight | String | Unit of weight ("kg" or "g"). |
cod_detail | Object | Details of the COD calculation. Only present if cod was requested and is available. |
insurance_detail | Object | Details of the insurance calculation. Only present if insurance was requested. |
CodDetail Object| Property Name | Data Type | Description |
|---|---|---|
cod_fee | Number | The calculated COD fee. |
cod_fee_percent | Number | The COD fee percentage used. |
cod_billed | Number | The total amount billed for COD. |
cod_disbursement | Number | The amount to be disbursed to the client. |
InsuranceDetail Object| Property Name | Data Type | Description |
|---|---|---|
insurance_percent | Number | The insurance premium percentage. |
insurance_minimum | Number | The minimum insurance fee. |
insurance | Number | The calculated insurance fee. |
curl --location --request POST '/tariff/express' \
--header 'Authorization: Basic <encoded-value>' \
--header 'Content-Type: application/json' \
--data-raw '{ "origin": 3571020010,// id_region
"destination": 3171020004,// id_region
"cod": "1", //optional // 1 = Yes | 0 = No
// "insurance":"1", //optional // 1 = Yes | 0 = No
"items": [
{
"name": "Contoh Barang 1",
"length": 10, //cm
"width": 10, //cm
"height": 10, //cm
"weight": 5000, //gram
"quantity": 1,
"value":2000//optional
}, {
"name": "Contoh Barang 1",
"length": 10, //cm
"width": 10, //cm
"height": 10, //cm
"weight": 5000, //gram
"quantity": 1,
"value":2000//optional
}
]
}'{
"success": false,
"message": "\"length\" is required"
}