Estimated Order Fee With Many Services At Once
Return estimated fee for trip that has the same pick up and drop off points within many services
- cURL
- JavaScript
curl -X POST \
https://apistg.ahamove.com/v2/order/estimated_fee \
-H 'Content-Type: application/json' \
-d '{"token":"5d4bcb47ed4f1f0b3b5e9b20","order_time": 0, "path": [{"lat":10.7692105, "lng":106.6637935, "address":"725 Hẻm số 7 Thành Thái, Phường 14, Quận 10, Hồ Chí Minh, Việt Nam", "short_address":"Quận 10", "name":"nmbmb", "remarks":"call me"}, {"lat":10.7828887, "lng":106.704898, "address":"Miss Ao Dai Building, 21 Nguyễn Trung Ngạn, Bến Nghé, Quận 1, Hồ Chí Minh, Vietnam", "name":"Bao","cod":100000}], "services":[{"_id":"SGN-BIKE","requests":[{"_id":"SGN-BIKE-ROUND-TRIP","price":18400}]}, {"_id": "SGN-TRICYCLE"}], "payment_method": "CASH"}'
var myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
var raw = JSON.stringify({
token: '5d4bcb47ed4f1f0b3b5e9b20',
order_time: 0,
path: [
{
lat: 10.7692105,
lng: 106.6637935,
address:
'725 Hẻm số 7 Thành Thái, Phường 14, Quận 10, Hồ Chí Minh, Việt Nam',
short_address: 'Quận 10',
name: 'nmbmb',
remarks: 'call me',
},
{
lat: 10.7828887,
lng: 106.704898,
address:
'Miss Ao Dai Building, 21 Nguyễn Trung Ngạn, Bến Nghé, Quận 1, Hồ Chí Minh, Vietnam',
name: 'Bao',
cod: 100000,
},
],
services: [
{
_id: 'SGN-BIKE',
requests: [
{
_id: 'SGN-BIKE-ROUND-TRIP',
price: 18400,
},
],
},
{
_id: 'SGN-TRICYCLE',
},
],
payment_method: 'CASH',
});
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('https://apistg.ahamove.com/v2/order/estimated_fee', requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
HTTP Request
POST https://apistg.ahamove.com/v2/order/estimated_fee
Response
Success response example:
Status-Code: 200 OK
[
{
"distance": 11.72,
"duration": 3220,
"requests": [],
"user_main_account": 0,
"user_bonus_account": 0,
"currency": "VND",
"total_pay": 80000,
"total_balance": 0,
"is_postpaid": false,
"is_child_account": false,
"online_pay": 0,
"payment_method": "CASH",
"distance_fee": 75000,
"request_fee": 0,
"stop_fee": 5000,
"vat_fee": 0,
"discount": 0,
"total_fee": 80000,
"surcharge": 1.21,
"stoppoint_price": 5000,
"special_request_price": 0,
"vat": 0,
"distance_price": 75000,
"voucher_discount": 0,
"subtotal_price": 80000,
"total_price": 80000,
"surge_rate": 1.21,
"_id": "SGN-BIKE"
},
{
"distance": 11.72,
"duration": 3220,
"requests": [],
"user_main_account": 0,
"user_bonus_account": 0,
"currency": "VND",
"total_pay": 307000,
"total_balance": 0,
"is_postpaid": false,
"is_child_account": false,
"online_pay": 0,
"payment_method": "CASH",
"distance_fee": 297000,
"request_fee": 0,
"stop_fee": 10000,
"vat_fee": 0,
"discount": 0,
"total_fee": 307000,
"stoppoint_price": 10000,
"special_request_price": 0,
"vat": 0,
"distance_price": 297000,
"voucher_discount": 0,
"subtotal_price": 307000,
"total_price": 307000,
"_id": "SGN-TRICYCLE"
}
]
Errors
Return list detail error with status_code, title, description by each service_id.
Error response example:
Status-Code: 200 OK
[
{
"_id": "SGN-TRICYCLE-NOT-EXIST",
"title": "Service not found",
"description": "Service SGN-TRICYCLE-NOT-EXIST not found"
},
{
"distance": 11.72,
"duration": 3220,
"user_main_account": 0,
"user_bonus_account": 0,
"currency": "VND",
"total_pay": 80000,
"total_balance": 0,
"is_postpaid": false,
"is_child_account": false,
"online_pay": 0,
"payment_method": "CASH",
"requests": [],
"distance_fee": 75000,
"request_fee": 0,
"stop_fee": 5000,
"vat_fee": 0,
"discount": 0,
"total_fee": 80000,
"surcharge": 1.21,
"stoppoint_price": 5000,
"special_request_price": 0,
"vat": 0,
"distance_price": 75000,
"voucher_discount": 0,
"subtotal_price": 80000,
"total_price": 80000,
"surge_rate": 1.21,
"_id": "SGN-BIKE"
}
]