Available Service API
Query available shipping services from carriers.
Endpoint
| Method | Path | Description |
|---|---|---|
| POST | /api/v1/label/service/available | Get available services |
Request
Headers:
Content-Type: application/jsonAuthorization: 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
| Field | Type | Required | Description |
|---|---|---|---|
carrier_ids | string[] | Yes | List of carrier IDs |
from_address | object | Yes | Sender address |
dst_address | object | Yes | Recipient address |
parcels | object[] | No | Package dimensions and weight |
service_type | string | No | Service type: delivery or Collection |
Parcel Fields
| Field | Type | Required | Description |
|---|---|---|---|
length | object | Yes | {length: number, unit: "cm"} |
width | object | Yes | {length: number, unit: "cm"} |
height | object | Yes | {length: number, unit: "cm"} |
gross_weight | object | Yes | Gross weight including packaging |
net_weight | object | No | Net 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
- Service Type: Default is
delivery. UseCollectionfor pickup services - Caching: Results are cached based on address and parcel fingerprint
- Multiple Carriers: Query multiple carriers simultaneously for comparison