Skip to content

Available Service API

Query available shipping services from carriers.

Endpoint

MethodPathDescription
POST/api/v1/label/service/availableGet available services

Request

Headers:

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

Request Body:

json
{
  "carrier_ids": ["dhl_express", "ups_ground"],
  "from_address": {
    "postal_code": "10001",
    "country_code": "US",
    "province": "NY",
    "city": "New York",
    "suburb": "Manhattan",
    "address_1": "123 Main St"
  },
  "dst_address": {
    "postal_code": "90001",
    "country_code": "US",
    "province": "CA",
    "city": "Los Angeles",
    "address_1": "456 Oak Ave"
  },
  "parcels": [
    {
      "length": { "length": 30, "unit": "cm" },
      "width": { "length": 20, "unit": "cm" },
      "height": { "length": 10, "unit": "cm" },
      "gross_weight": { "weight": 2.5, "unit": "kg" },
      "net_weight": { "weight": 2.0, "unit": "kg" }
    }
  ],
  "service_type": "delivery"
}

Field Description

FieldTypeRequiredDescription
carrier_idsstring[]YesList of carrier IDs
from_addressobjectYesSender address
dst_addressobjectYesRecipient address
parcelsobject[]NoPackage dimensions and weight
service_typestringNoService type: delivery or Collection

Parcel Fields

FieldTypeRequiredDescription
lengthobjectYes{length: number, unit: "cm"}
widthobjectYes{length: number, unit: "cm"}
heightobjectYes{length: number, unit: "cm"}
gross_weightobjectYesGross weight including packaging
net_weightobjectNoNet weight of goods only

Response

Success Response

json
{
  "code": 200,
  "msg": "success",
  "data": [
    {
      "id": 1,
      "carrier_id": "dhl_express",
      "service_code": "DHL_EXPRESS_WORLDWIDE",
      "service_name": "DHL Express Worldwide",
      "transit_time": "3-5 days",
      "pickup_available": true,
      "delivery_available": true
    },
    {
      "id": 2,
      "carrier_id": "ups_ground",
      "service_code": "UPS_GROUND",
      "service_name": "UPS Ground",
      "transit_time": "5-7 days",
      "pickup_available": true,
      "delivery_available": true
    }
  ]
}

Error Response

json
{
  "code": 400,
  "msg": "can't find the available service or the channel unavailable this time,please retry later",
  "data": null
}

Notes

  1. Service Type: Default is delivery. Use Collection for pickup services
  2. Caching: Results are cached based on address and parcel fingerprint
  3. Multiple Carriers: Query multiple carriers simultaneously for comparison