Estimate Order Fee
This api is used to estimate order fee (support both GET/POST method)
- cURL
- JavaScript
curl --request POST \
--url https://apistg.ahamove.com/v1/order/estimated_fee \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--data-urlencode 'token=<TOKEN_STG>' \
--data-urlencode 'order_time=0' \
--data-urlencode '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":"Anh","mobile":"09xxxxxxxx","remarks":"call me"},{"lat":10.772594,"lng":106.69669,"address":"Chợ Bến Thành, Bến Thành, Quận 01, Hồ Chí Minh, Việt Nam","name":"Bao","mobie":"09xxxxxxxx","cod":100000}]' \
--data-urlencode 'service_id=SGN-BIKE' \
--data-urlencode 'requests=[]'
var myHeaders = new Headers();
myHeaders.append("Cache-Control", "no-cache");
myHeaders.append("Content-Type", "application/x-www-form-urlencoded");
var urlencoded = new URLSearchParams();
urlencoded.append("token", "<TOKEN_STG>");
urlencoded.append("order_time", "0");
urlencoded.append("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":"Anh","mobile":"09xxxxxxxx","remarks":"call me"},{"lat":10.772594,"lng":106.69669,"address":"Chợ Bến Thành, Bến Thành, Quận 01, Hồ Chí Minh, Việt Nam","name":"Bao","mobie":"09xxxxxxxx","cod":100000}]");
urlencoded.append("service_id", "SGN-BIKE");
urlencoded.append("requests", "[]");
var requestOptions = {
method: 'POST',
headers: myHeaders,
body: urlencoded,
redirect: 'follow'
};
fetch("https://apistg.ahamove.com/v1/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/v1/order/estimated_fee
or
GET https://apistg.ahamove.com/v1/order/estimated_fee
Parameters
The same as order/create API
Response
JSON response example:
{
"distance": 4.68,
"duration": 1291,
"user_main_account": 32000,
"user_bonus_account": 0,
"currency": "VND",
"total_pay": 0,
"total_balance": 0,
"is_postpaid": true,
"is_child_account": false,
"online_pay": 0,
"payment_method": "CASH",
"requests": [],
"distance_fee": 32000,
"request_fee": 0,
"stop_fee": 0,
"vat_fee": 0,
"discount": 0,
"total_fee": 32000,
"cod_commission_fee": 0,
"premium_service_fee": 0,
"weight_fee": 0,
"surcharge": 1.1,
"partner_surcharge": 1.1,
"stoppoint_price": 0,
"special_request_price": 0,
"vat": 0,
"cod_commission_price": 0,
"distance_price": 32000,
"voucher_discount": 0,
"subtotal_price": 32000,
"total_price": 32000,
"surge_rate": 1.1
}
Status-Code: 200 OK
Field | Description |
---|---|
distance | Distance |
duration | Estimated lead time |
currency | Currency |
distance_fee | Distance fee (Will be removed after December 1st, 2019) |
request_fee | Request fee (Will be removed after December 1st, 2019) |
stop_fee | Stop fee, for multiple dropoff locations (Will be removed after December 1st, 2019) |
vat_fee | VAT (Will be removed after December 1st, 2019) |
discount | Discount (Will be removed after December 1st, 2019) |
total_fee | Total fee (Will be removed after December 1st, 2019) |
surcharge | Surge pricing level, only returned if surcharge > 1. (Will be removed after December 1st, 2019) |
distance_price | Distance fee, alternaltive for distance_fee |
special_request_price | Request fee, alternaltive for request_fee |
stoppoint_price | Stop fee, alternaltive for stop_fee |
vat | VAT, alternaltive for vat_fee |
voucher_discount | Discount, alternaltive for discount |
subtotal_price | Total fee, alternaltive for total_fee |
total_price | Final price, equals subtotal_price - voucher_discount |
surge_rate | Sometimes, service price may increase due to the demand increasing unexpectedly. This rate will be returned if it is greater than 1, alternaltive for surcharge |
total_pay | Total pay by cash |
online_pay | Amount of money that user pay for ahamove through a 3rd party payment service (For example MOMO) |
Errors
The same as order/create API