Skip to content

Price Estimate API

Get shipping price estimates from multiple carriers.

Endpoint

MethodPathDescription
POST/api/v1/label/price/estimateGet price estimates

Request

Headers:

  • Content-Type: application/json
  • Authorization: appToken {token}

Request Body:

json
{
  "request_id": "req_20250303_001",
  "from_address": {
    "postcode": "10001",
    "country_code": "US",
    "province": "NY",
    "city": "New York",
    "suburb": "Manhattan",
    "address_1": "123 Main St"
  },
  "dst_address": {
    "postcode": "90001",
    "country_code": "US",
    "province": "CA",
    "city": "Los Angeles",
    "suburb": "Downtown",
    "address_1": "456 Oak Ave"
  },
  "carrier_ids": ["dhl_express", "ups_ground", "fedex"],
  "parcels": [
    {
      "length": { "length": 30, "unit": "cm" },
      "width": { "length": 20, "unit": "cm" },
      "height": { "length": 10, "unit": "cm" },
      "weight": { "weight": 2.5, "unit": "kg" },
      "package_type_code": "package"
    }
  ]
}

Field Description

FieldTypeRequiredDescription
request_idstringYesUnique request ID (used for idempotency)
from_addressobjectYesSender address
dst_addressobjectYesRecipient address
carrier_idsstring[]YesList of carrier IDs to query
parcelsobject[]YesPackage details

Address Fields

FieldTypeRequiredDescription
postcodestringYesPostal code
country_codestringYesISO 2-letter country code (e.g., "US", "CN")
provincestringYesState/Province
citystringYesCity
suburbstringNoSuburb/District
address_1stringYesPrimary address

Parcel Fields

FieldTypeRequiredDescription
lengthobjectYes{length: number, unit: "cm"}
widthobjectYes{length: number, unit: "cm"}
heightobjectYes{length: number, unit: "cm"}
weightobjectYes{weight: number, unit: "kg"}
package_type_codestringYesPackage type code

Response

Success Response

json
{
  "code": 200,
  "msg": "success",
  "data": {
    "dhl_express": [
      {
        "ref_record_id": 123,
        "price": {
          "amount": 10.50,
          "currency": "USD"
        },
        "carrier_id": "dhl_express",
        "shipper_name": "DHL Express",
        "shipper_code": "DHL",
        "remark": "Estimated delivery in 3-5 days",
        "estimated_time": "3-5 days"
      }
    ],
    "ups_ground": [
      {
        "ref_record_id": 123,
        "price": {
          "amount": 8.00,
          "currency": "USD"
        },
        "carrier_id": "ups_ground",
        "shipper_name": "UPS Ground",
        "shipper_code": "UPS",
        "remark": "Estimated delivery in 5-7 days",
        "estimated_time": "5-7 days"
      }
    ]
  }
}

Error Response

json
{
  "code": 400,
  "msg": "the price estimate task exist",
  "data": null
}

Notes

  1. Idempotency: Duplicate requests with the same request_id will return an error
  2. Async Processing: Price estimation runs asynchronously across multiple carriers
  3. Address Storage: Address information is saved for future use