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

MethodEndpoint
POST/v3/fulfillment/pricing/domestic

Request Parameter

FieldTypeMandatoryDescription
originobjectYesAn object containing information about the origin location.
origin.area_idintegerYesID of the area where the shipment will originate.
origin.suburb_idintegerID of the suburb within the area where the shipment will originate.
origin.latstringNoLatitude of the pickup location.eg:"-6.2614927"

Mandatory for instant and same day service
origin.lngstringNoLongitude of the pickup location.eg:"54.321"

Mandatory for instant and same day service
destinationobjectYesAn object containing information about the destination location.
destination.area_idintegerYesID of the area where the shipment will be delivered.
destination.suburb_idintegerNoID of the suburb within the area where the shipment will be delivered.
destination.latstringNoLatitude of the delivery location.eg"-6.2614927"

Mandatory for instant and same day service
destination.lngstringNoLongitude of the delivery location.eg:"54.321"

Mandatory for instant and same day service
for_orderbooleanYesA boolean indicating whether the request is for an order.
rate_type_idstringNorate_type, optional value

possible values:
- regular
- express
- trucking
- instant
- same-day
codbooleanNoA boolean indicating whether the request includes cash on delivery.
with_insurancebooleanNoA boolean indicating whether the request includes insurance.
order_priceintegerNoThe total price of this order
skusarrayYesAn array of objects representing the products being shipped.
skus[i]objectYesAn object representing a single product being shipped.
skus[i].heightintegerYesThe height of the product.

unit: cm
skus[i].lengthintegerYesThe length of the product.

unit: cm
skus[i].widthintegerYesThe width of the product.

unit: cm
skus[i].weightBigDecimalYesThe weight of the product.

unit: kg
skus[i].namestringYesThe name of the product.
skus[i].item_valueIntegerYesThe declared value of the product.
skus[i].qtyintegerYesThe quantity of the product being shipped.
sort_byarrayNoAn array of fields to sort the response by.

Only final_price/ delivery_time. use +/- to order by asc/ desc
pageintegerNothe page of the response
limitintegerNolimit 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
    }
}