Fulfillment Pricing Endpoint
Only use this if you use Fulfillment x Logistics Integration
Introduction
This OpenAPI document describes the API for calculating the pricing of domestic shipments for a given origin and destination.
- Authorizations : X-API-Key_Header
- Request Body Schema : application/json
POST Pricing
Method | Endpoint |
---|---|
POST | /v3/fulfillment/pricing/domestic |
Request Parameter
Field | Type | Mandatory | Description |
---|---|---|---|
origin | object | Yes | An object containing information about the origin location. |
origin.area_id | integer | Yes | ID of the area where the shipment will originate. |
origin.suburb_id | integer | ID of the suburb within the area where the shipment will originate. | |
origin.lat | string | No | Latitude of the pickup location.eg:"-6.2614927" Mandatory for instant and same day service |
origin.lng | string | No | Longitude of the pickup location.eg:"54.321" Mandatory for instant and same day service |
destination | object | Yes | An object containing information about the destination location. |
destination.area_id | integer | Yes | ID of the area where the shipment will be delivered. |
destination.suburb_id | integer | No | ID of the suburb within the area where the shipment will be delivered. |
destination.lat | string | No | Latitude of the delivery location.eg"-6.2614927" Mandatory for instant and same day service |
destination.lng | string | No | Longitude of the delivery location.eg:"54.321" Mandatory for instant and same day service |
for_order | boolean | Yes | A boolean indicating whether the request is for an order. |
rate_type_id | string | No | rate_type, optional value possible values: - regular - express - trucking - instant - same-day |
cod | boolean | No | A boolean indicating whether the request includes cash on delivery. |
with_insurance | boolean | No | A boolean indicating whether the request includes insurance. |
order_price | integer | No | The total price of this order |
skus | array | Yes | An array of objects representing the products being shipped. |
skus[i] | object | Yes | An object representing a single product being shipped. |
skus[i].height | integer | Yes | The height of the product. unit: cm |
skus[i].length | integer | Yes | The length of the product. unit: cm |
skus[i].width | integer | Yes | The width of the product. unit: cm |
skus[i].weight | BigDecimal | Yes | The weight of the product. unit: kg |
skus[i].name | string | Yes | The name of the product. |
skus[i].item_value | Integer | Yes | The declared value of the product. |
skus[i].qty | integer | Yes | The quantity of the product being shipped. |
sort_by | array | No | An array of fields to sort the response by. Only final_price/ delivery_time. use +/- to order by asc/ desc |
page | integer | No | the page of the response |
limit | integer | No | limit for each page |
Request Example
{
"origin": {
"area_id": 4744,
"suburb_id": 487,
"lat": "-6.2614927",
"lng": "54.321"
},
"destination": {
"area_id": 4744,
"lat": "6.2614927",
"lng": "87.654",
"suburb_id": 487
},
"rate_type_id":"instant",
"order_price":199000,
"sort_by": [
"final_price"
],
"for_order": true,
"cod": false,
"with_insurance": true,
"skus": [
{
"height": 1,
"length": 1,
"width": 1,
"weight": 1,
"name": "Product 1",
"item_value": 199000,
"qty": 1
}
]
}
Response Example
{
"metadata": {
"path": "/v1/openapi/pricing/domestic",
"http_status_code": 200,
"http_status": "",
"timestamp": 1680749884
},
"data": {
"origin": {
"area_id": 4744,
"area_name": "Pejaten Timur",
"suburb_id": 487,
"suburb_name": "Pasar Minggu",
"city_id": 41,
"city_name": "Jakarta Selatan",
"province_id": 6,
"province_name": "DKI Jakarta",
"country_id": 228,
"country_name": "INDONESIA",
"lat": -6.270095,
"lng": 106.8502879
},
"destination": {
"area_id": 4744,
"area_name": "Pejaten Timur",
"suburb_id": 487,
"suburb_name": "Pasar Minggu",
"city_id": 41,
"city_name": "Jakarta Selatan",
"province_id": 6,
"province_name": "DKI Jakarta",
"country_id": 228,
"country_name": "INDONESIA",
"lat": -6.270095,
"lng": 106.8502879
},
"pricings": [
{
"id": 157638794,
"logistic": {
"id": 26,
"name": "Paxel",
"logo_url": "https://global-cdn.shipper.id/images/png/logistic/paxel.240x90.png",
"code": "PXL",
"status": true,
"company_name": "Paxel Indonesia",
"insurance_free": 100000,
"insurance_free_pricing": "x9999",
"insurance": 0.2,
"min_premium": 0,
"admin_fee": 0,
"weight_allowance": 0,
"extra_allowance": 0,
"liability": "f10",
"max_liability": 1000000,
"enable_pickup": true,
"high_value": 0,
"high_value_insurance": 0,
"int_insurance_free": 0,
"int_max_liability": 0,
"int_insurance": null,
"int_min_premium": 0,
"int_admin_fee": 0,
"int_liability": "",
"updated_by": null
},
"rate": {
"id": 566,
"name": "Next Day",
"type_id": 2,
"type_name": "Express",
"rate_type": 0,
"rate_logo": "https://global-cdn.shipper.id/images/png/logistic/paxel.240x90.png",
"description": "Next Day - Large",
"ref": "NEXTDAY",
"full_description": "",
"volumetric": 6000,
"min_kg": 1,
"max_kg": 5,
"is_pickup_by_agent": false,
"use_geoloc": false,
"must_be_selected": false,
"is_hubless": false,
"ppn": 1,
"is_inclusive": false
},
"route": {
"id": 117169259,
"stop_id_origin": 86964,
"stop_id_destination": 86964,
"logistic_id": 26,
"rate_id": 566,
"rate_enabled": 1,
"valid_to_order": 1,
"cod_origin_enabled": 0,
"cod_destination_enabled": 0,
"city_id": 41,
"postcode_origin": "12510",
"postcode_destination": "12510",
"administrative_level_origin": 5,
"administrative_level_destination": 5
},
"logistic_id": 26,
"logistic_id_actual": 26,
"actual_logistic_name": "Paxel",
"rate_id": 566,
"actual_rate_name": "Next Day",
"rate_id_actual": 566,
"type_id_actual": 0,
"prerequisite": 0,
"min_kg": 0,
"max_kg": 5,
"weight": 1,
"volume": 1,
"volume_weight": 0.00016666666666666666,
"final_weight": 1,
"min_day": 1,
"max_day": 2,
"unit_price": 12000,
"base_price": 12000,
"base_price_actual": 12000,
"total_price": 12000,
"discount": 0,
"discount_value": 0,
"discounted_price": 12000,
"insurance_fee": 398,
"surcharge_fee": 0,
"final_price": 12400,
"insurance_applied": true,
"liability_value": 199000,
"currency": "IDR",
"_score": 0,
"must_use_insurance": true,
"updated_at": "2023-04-03 07:09:12.670",
"mandatory_fee": 0,
"mitra_commission": 0
}
],
"pricing_errors": [
{
"code": 3007,
"message": "Destination is not available",
"logistic_id": 3,
"logistic_name": "RPX",
"rate_id": 7,
"rate_name": "REP"
}
]
},
"pagination": {
"current_page": 1,
"current_elements": 1,
"total_pages": 1,
"total_elements": 1,
"sort_by": [
"final_price"
]
}
}
{
"metadata": {
"path": "/v3/fulfillment/pricing/domestic",
"http_status_code": 400,
"http_status": "Bad Request",
"errors": [
{
"code": 810,
"message": "invalid rate_type_id."
}
],
"timestamp": 1680753159
}
}
{
"metadata": {
"path": "/v3/fulfillment/pricing/domestic",
"http_status_code": 400,
"http_status": "Bad Request",
"errors": [
{
"code": 810,
"message": "sku.height is required."
}
],
"timestamp": 1681095090
}
}
{
"metadata": {
"path": "/v3/fulfillment/pricing/domestic",
"http_status_code": 400,
"http_status": "Bad Request",
"errors": [
{
"code": 810,
"message": "Cannot deserialize value of type `long` from String \"4744a\": not a valid `long` value\n at [Source: (PushbackInputStream); line: 1, column: 144] (through reference chain: id.shipper.oms.facade.request.openapi.pricing.PricingRequest[\"origin\"]->id.shipper.oms.facade.request.openapi.pricing.PricingOriginRequest[\"area_id\"])"
}
],
"timestamp": 1681095495
}
}
Updated about 2 months ago