Get List Of Service
Get a list of services available based on each province or via geolocation
- cURL
- JavaScript
curl --location 'https://partner-apistg.ahamove.com/v3/services?city_id=SGN&delivery_type=INSTANT' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const requestOptions = {
method: 'GET',
headers: myHeaders,
redirect: 'follow',
};
fetch(
'https://partner-apistg.ahamove.com/v3/services?city_id=SGN&delivery_type=INSTANT',
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
HTTP Request
GET https://partner-apistg.ahamove.com/v3/services?city_id=SGN
Headers
Parameter | Value | Required | Description |
---|---|---|---|
Content-Type | application/json | Yes | |
Authorization | Bearer <token> | Yes | Token of the user account |
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
lat | String | Yes | Latitude, Optional if city_id is provided |
lng | String | Yes | Longitude, Optional if city_id is provided |
city_id | String | Yes | City Id, Required if lat/lng is not provided |
delivery_type | String | No | Type of delivery. INSTANT for public services, TRUCK for truck services |
Response
JSON response example:
[
{
"_id": "SGN-BIKE",
"advance_broadcast_distance": 2000,
"auto_assign": false,
"auto_assign_distance": 1000,
"city_id": "SGN",
"cod": 10000000,
"commission_type": "PERCENTAGE",
"commission_value": 0.212,
"currency": "VND",
"delivery_type": "INSTANT",
"description_en_us": "Giao hàng nội thành trong 1 giờ",
"description_vi_vn": "Lấy hàng ngay, giao hỏa tốc",
"distance_fee": "(25000 if x <= 2 else 19636 if x <= 3 else 19636 + (x - 3) * 5400)",
...
# List of special requests
"requests": [
{
"_id": "SGN-BIKE-TIP",
"description_en_us": "This will show your support or compliment to the driver, especially in rush hours, hand to hand delivery, bad weather. Also, this feature will prioritize your request in peak time.",
"description_vi_vn": "Hãy chọn dịch vụ này nếu bạn muốn hỗ trợ tài xế trong giờ cao điểm, khi cần giao hàng lên lầu, nơi phải tốn phí giữ xe, khi thời tiết khó khăn, hoặc đơn giản là muốn thưởng thêm cho tài xế. Ngoài ra, tính năng này sẽ giúp cho đơn hàng của bạn được ưu tiên hơn trong thời gian cao điểm.",
"device_types": [],
"enable": true,
"group_id": "TIP",
"max_input": 6,
"name": "Hỗ trợ tài xế (PER_UNIT)",
"price": 5000,
}
],
}
]
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
404 | CITY_NOT_FOUND | - City not found - Unable to determine city from latitude/longitude |
406 | INVALID_DELIVERY_TYPE | Invalid delivery type |
500 | INTERNAL_SERVER_ERROR | We had a problem with our server. Try again later |
503 | SERVICE_UNAVAILABLE | We're temporarily offline for maintenance. Please try again later |