API Lấy gói dịch vụ
Sử dụng API này để lấy các gói dịch vụ theo tuyến.
Lưu ý : Ở API này cần truyền token ở header.
post/gethttps://online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/available-services
https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/available-services
curl --location --request POST 'https://dev-online-gateway.ghn.vn/shiip/public-api/v2/shipping-order/available-services' \
--header 'token: 637170d5-942b-11ea-9821-0281a26fb5d4' \
--header 'Content-Type: application/json' \
--data-raw '{
"shop_id":885,
"from_district": 1447,
"to_district": 1442
}'
Cấu trúc Request
| Trường dữ liệu | Kiểu dữ liệu | Mô tả |
|---|---|---|
| token | String |
Dùng để xác định định danh của tài khoản và dùng cho các trường hợp gọi tới các API. |
| from_district | Int | |
| to_district | Int | |
| shop_id | Int |
Mã định danh của cửa hàng. |
{
"code": 200,
"message": "Success",
"data":[
{
"short_name":"Hàng nặng"
"service_type_id":5
},
{
"short_name":"Hàng nhẹ"
"service_type_id":2
}]
}
Cấu trúc Response
| Trường dữ liệu | Mô tả |
|---|---|
| service_id |
Mã dịch vụ. |
| short_name |
Tên dịch vụ. |
| service_type_id |
Loại hình dịch vụ. |
{
"code": 400,
"message": "code=400, message=Syntax error: offset=30, error=invalid character '}' after array element"
"data": null
"code_message": "USER_ERR_COMMON"
}