Skip to main content
Version: 3.0.0

Estimate Order Fee

Estimate order fees for one or multiple services simultaneously

Estimate order fees using service_id and requests

curl --location 'https://partner-apistg.ahamove.com/v3/orders/estimates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"order_time": 0,
"path": [
{
"lat": 10.76975346,
"lng": 106.6636615,
"address": "7/28 Thành Thái, Phường 14, Quận 10, Thành phố Hồ Chí Minh",
"short_address": "Thành Thái, Quận 10",
"name": "Lan",
"mobile": "84944309348",
"remarks": "Đến nơi lấy hàng đọc mã đơn để nhận hàng"
},
{
"lat": 10.8018493,
"lng": 106.714466,
"address": "475A Điện Biên Phủ, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh",
"short_address": "Đại Học Hutech, Quận Bình Thạnh, Hồ Chí Minh",
"name": "Anh",
"mobile": "0912345678",
"cod": 100000,
"item_value": 250000,
"tracking_number": "ABCD1234",
"remarks": "Gọi điện trước khi giao. Giao hàng cẩn thận"
}
],
"services": [
{
"_id": "SGN-BIKE",
"requests": [
{
"_id": "SGN-BIKE-TIP",
"num": 1
},
{
"_id": "SGN-BIKE-BULKY",
"tier_code": "TIER_2"
}
]
},
{
"_id": "SGN-ECO",
"requests": []
},
{
"_id": "SGN-TRUCK-1000",
"requests": []
},
{
"_id": "VNM-PARTNER-AHAMOVE",
"requests": [
{
"_id": "VNM-PARTNER-AHAMOVE-DONG-KIEM",
"num": 1
}
]
}
],
"payment_method": "CASH",
"remarks": "Ghi chú đơn hàng",
"promo_code" : "AHMKM",
"items": [
{
"_id": "TG",
"num": 1,
"name": "Tủ gỗ nhỏ",
"price": 450000
},
{
"_id": "GDB",
"num": 2,
"name": "Gương để bàn",
"price": 120000
}
],
"package_detail": [
{
"weight": 10,
"length": 1.2,
"width": 0.8,
"height": 2.0,
"description": "Nội thất"
}
]
}'

Estimate order fees using group_service_id and group_requests

Ahamove will automatically determine the service_id based on the pickup address location and group_service_id

curl --location 'https://partner-apistg.ahamove.com/v3/orders/estimates' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"order_time": 0,
"path": [
{
"lat": 10.76975346,
"lng": 106.6636615,
"address": "7/28 Thành Thái, Phường 14, Quận 10, Thành phố Hồ Chí Minh",
"short_address": "Thành Thái, Quận 10",
"name": "Lan",
"mobile": "84944309348",
"remarks": "Đến nơi lấy hàng đọc mã đơn để nhận hàng"
},
{
"lat": 10.8018493,
"lng": 106.714466,
"address": "475A Điện Biên Phủ, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh",
"short_address": "Đại Học Hutech, Quận Bình Thạnh, Hồ Chí Minh",
"name": "Anh",
"mobile": "0912345678",
"cod": 100000,
"item_value": 250000,
"tracking_number": "ABCD1234",
"remarks": "Gọi điện trước khi giao. Giao hàng cẩn thận"
}
],
"group_services": [
{
"_id": "BIKE",
"group_requests": [
{
"_id": "TIP",
"num": 1
},
{
"_id": "BULKY",
"tier_code": "TIER_2"
}
]
},
{
"_id": "ECO",
"group_requests": []
},
{
"_id": "TRUCK-2000",
"group_requests": []
},
{
"_id": "VNM-PARTNER-AHAMOVE",
"group_requests": [
{
"_id": "DONG-KIEM",
"num": 1
}
]
}
],
"payment_method": "CASH",
"remarks": "Ghi chú đơn hàng",
"promo_code" : "AHMKM",
"items": [
{
"_id": "TG",
"num": 1,
"name": "Tủ gỗ nhỏ",
"price": 450000
},
{
"_id": "GDB",
"num": 2,
"name": "Gương để bàn",
"price": 120000
}
],
"package_detail": [
{
"weight": 10,
"length": 1.2,
"width": 0.8,
"height": 2.0,
"description": "Nội thất"
}
]
}'

HTTP Request

POST https://partner-apistg.ahamove.com/v3/orders/estimates

Headers

ParameterValueRequiredDescription
Content-Typeapplication/jsonYes
AuthorizationBearer <token>YesToken of the order creator

Body

{
"order_time": 0,
"path": [
{
"lat": 10.76975346,
"lng": 106.6636615,
"address": "7/28 Thành Thái, Phường 14, Quận 10, Thành phố Hồ Chí Minh",
"short_address": "Thành Thái, Quận 10",
"name": "Lan",
"mobile": "84944309348",
"remarks": "Đến nơi lấy hàng đọc mã đơn để nhận hàng"
},
{
"lat": 10.8018493,
"lng": 106.714466,
"address": "475A Điện Biên Phủ, Phường 25, Bình Thạnh, Thành phố Hồ Chí Minh",
"short_address": "Đại Học Hutech, Quận Bình Thạnh, Hồ Chí Minh",
"name": "Anh",
"mobile": "0912345678",
"cod": 100000,
"item_value": 250000,
"tracking_number": "ABCD1234",
"remarks": "Gọi điện trước khi giao. Giao hàng cẩn thận"
}
],
"services": [
{
"_id": "SGN-BIKE",
"requests": [
{
"_id": "SGN-BIKE-TIP",
"num": 1
},
{
"_id": "SGN-BIKE-BULKY",
"tier_code": "TIER_2"
}
]
},
{
"_id": "SGN-ECO",
"requests": []
},
{
"_id": "SGN-TRUCK-1000",
"requests": []
},
{
"_id": "VNM-PARTNER-AHAMOVE",
"requests": [
{
"_id": "VNM-PARTNER-AHAMOVE-DONG-KIEM",
"num": 1
}
]
}
],
"payment_method": "CASH",
"remarks": "Ghi chú đơn hàng",
"promo_code": "AHMKM",
"items": [
{
"_id": "TG",
"num": 1,
"name": "Tủ gỗ nhỏ",
"price": 450000
},
{
"_id": "GDB",
"num": 2,
"name": "Gương để bàn",
"price": 120000
}
],
"package_detail": [
{
"weight": 10,
"length": 1.2,
"width": 0.8,
"height": 2.0,
"description": "Nội thất"
}
]
}

Parameters

ParameterTypeRequiredDescription
order_timeFloat (Unix timestamp)YesDelivery time. For immediate orders, set order_time = 0.
pathArrayYesList of pickup and delivery points. There must be at least 2 paths (pickup and delivery information).
servicesArrayYesList service code of AhaMove (SGN-BIKE, SGN-ECO, ...).
requestsArrayYesList of special requests.
group_servicesArrayYesGroup service code of AhaMove (BIKE, ECO, TRUCK-500, ...).
group_requestsArrayYesGroup codes of special requests (TIP, BULKY, D2D,...)
payment_methodStringYesPayment method for the order:
- BALANCE: Paid from the account of the order creator.
- CASH: Cash payment by the sender.
- CASH_BY_RECIPIENT: Cash payment by the recipient.
promo_codeStringNoPromo code to discount shipping fee.
remarksStringNoNotes for the driver.
idle_untilFloat (Unix timestamp)NoSchedule for delivery. Set idle_until = order_time (if order_time > 0) as the time the order starts looking for a driver.
itemsArrayNoList of goods (if any).
package_detailArrayNoPackage size specifications.
route_optimizedBooleanNoTrue if the partner wants Ahamove to optimize delivery to save costs (1 pickup point, more than 2 delivery points).

How to get group_service_id and group_requests

Structure of service_id:

services._id = city_id + group_services._id

For SAAS services (VNM-PARTNER-XXXX), the structure is: services._id = group_services._id

Example:

services._idgroup_services._id
SGN-BIKEBIKE
SGN-ECOECO
SGN-2H2H
SGN-2H-PUBLIC2H-PUBLIC
SGN-SAMEDAYSAMEDAY
SGN-TRUCK-500TRUCK-500
SGN-TRUCK-1000TRUCK-1000
SGN-VAN-500VAN-500
VNM-PARTNER-AHAMOVEVNM-PARTNER-AHAMOVE
Structure of requests._id:

requests._id = services._id + group_requests._id

For SAAS services (VNM-PARTNER-XXXX), the structure is: requests._id = group_requests._id

Example:

requests._idgroup_requests._id
SGN-BIKE-TIPTIP
SGN-BIKE-BULKYBULKY
SGN-BIKE-INSURANCEINSURANCE
SGN-BIKE-D2DD2D
SGN-BIKE-SMSSMS
SGN-BIKE-FRAGILEFRAGILE
SGN-BIKE-ROUND-TRIPROUND-TRIP
VNM-PARTNER-AHAMOVE-TIPVNM-PARTNER-AHAMOVE-TIP

Path

Display from path[0] to multiple path[x], x > 0.

ParameterTypeRequiredDescription
addressStringYesPickup and delivery address in the correct format.
latNumberYesLatitude of the location (optional but recommended for partners to use).
lngNumberYesLongitude of the location (optional but recommended for partners to use).
nameStringYesName of the sender or recipient.
mobileStringYesPhone number of the sender or recipient.
tracking_numberStringNoTracking number of the package (partner's internal order code, not mandatory but Ahamove recommends including this in path[x]).
remarksStringNoNotes for the driver for each pickup and delivery point.
codIntNoAmount of COD the sender needs to collect from the recipient (only provided at the delivery point).
item_valueInt64NoActual value of the package, used for insurance purposes.

Model of requests and group_requests

KeyTypeRequiredDescription
_idStringYesID of the special requests (example: SGN-BIKE-TIP for requests or TIP for group_requests).
numIntNoQuantity, applicable only for special requests with Group ID as PER_UNIT.
tier_codeStringNoSize category, applicable only for special requests with Group ID as BULKY.

Model of items

KeyTypeRequiredDescription
_idIntYesID of the goods.
nameStringYesName of the goods.
priceIntYesPrice of the goods.
numIntYesTotal quantity of the goods.

Model of package_detail

KeyTypeRequiredDescription
weightFloatYesWeight of the package (kg).
lengthFloatNoLength of the package (m).
widthFloatNoWidth of the package (m).
heightFloatNoHeight of the package (m).
descriptionStringNoDescription of the type of goods.

Note

lat and lng is not required but address field in parameters needs to have correct information as shown in the format below

[House number] [Street name], [Ward], [District], [Province/City], Việt nam

Ex: 117 Hùng Vương, Phường 4, Quận 5, Thành phố Hồ Chí Minh, Việt Nam
or 117 Hùng Vương, Phường 4, Quận 5, Hồ Chí Minh

Address Requirements for Sending to Ahamove

  1. Clear address with information segments separated by commas
  2. Address must be searchable on Google Maps (Google Plus Codes can be used)
  3. No redundant information in Ward/District/Province sections (for Partners allowing customers to select addresses from a dropdown)

Some types of Invalid Address :

  • 658 võ văn kiệt p1 Quận 5 Hồ Chí Minh
  • 58 Nghĩa Thục - Phường 5 - Quận 5 - Hồ Chí Minh - Việt Nam
  • 22 Bùi Hữu Nghĩa
  • 60/62 chiêu anh các
  • 930 vo văn Kiệt p5q5
  • Có ji e gởi đia chỉ 835/17c trần hung dao p1 q5 tphcm giúp c nha, Phường 01, Quận 5, Thành phố Hồ Chí Minh
  • 54 Bạch Vân (Nhà màu xanh cuối hẻm, gọi số 0908999999), Phường 5, Quận 5, TP Hồ Chí Minh
  • 189 Trần Tuấn Khải F.5 Q.5 Ngay ngã 3 Trần Hưng Đạo
  • địa chỉ: 53 Huỳnh Mẫn Đạt phường 5 Quận 5 TP.HCM ĐT: 0912123456
  • 14/20 .an binh p5q5
  • 155 Trần Tuần Khải, p5, q5
  • Số 1 bạch Vân phường 5 quận 5 TPHCM
  • đc hẻm 93/107/16 đường bạch vân p5 q5
  • 112 An Bình P5, Quận 5, HCM
  • 1025, Phường 5, Quận 5

Response

JSON response example:

[
{
"service_id": "SGN-BIKE",
"data": {
"distance": 11.98,
"duration": 3240,
"distance_fee": 69000,
"request_fee": 17000,
"stop_fee": 0,
"vat_fee": 0,
"discount": 0,
"total_fee": 86000,
"requests": [
{
"_id": "SGN-BIKE-TIP",
"num": 1,
"price": 5000
},
{
"_id": "SGN-BIKE-BULKY",
"num": 0,
"price": 10000,
"tier_code": "TIER_2"
}
],
"total_price": 86000
// order detail
}
},
{
"service_id": "SGN-ECO",
"data": {
"distance": 11.98,
"duration": 3240,
"distance_fee": 60000,
"request_fee": 0,
"stop_fee": 0,
"vat_fee": 0,
"discount": 0,
"total_fee": 60000,
"total_price": 60000
// order detail
}
},
{
"service_id": "SGN-TRUCK-1000",
"data": {
"distance": 13.47,
"duration": 954,
"distance_fee": 515000,
"request_fee": 0,
"stop_fee": 0,
"vat_fee": 0,
"discount": 0,
"total_fee": 515000,
"total_price": 515000
// order detail
}
},
{
"service_id": "VNM-PARTNER-AHAMOVE",
"data": {
"distance": 13.47,
"duration": 3240,
"distance_fee": 72000,
"request_fee": 10000,
"stop_fee": 0,
"vat_fee": 0,
"discount": 0,
"total_fee": 82000,
"total_price": 82000
// order detail
}
}
]

Status-Code: 200 OK

Errors

CodeTextDescription
400BAD_REQUESTThe request to create the order contains invalid data.
400MISSING_REQUIRED_INFOMissing required fields.
400MISSING_PATH_INFOPath does not contain enough stop point.
401NOT_AUTHORIZEDInvalid token (Token expired. When a new token is created, the old token will expire).
404SERVICE_NOT_FOUNDService not found.
404REQUEST_NOT_FOUNDSpecial request not found.
406INVALID_MAX_DISTANCEDelivery distance is invalid, exceeding the allowed distance of the service.
406INVALID_MAX_CODCOD exceeds the maximum COD limit of the service or exceeds the user's COD limit.
406INVALID_MAX_STOP_POINTThe number of delivery points exceeds the maximum number of delivery points allowed by the service.
406INVALID_MIN_STOP_POINTThe number of delivery points does not meet the minimum number of delivery points required by the service.
406SERVICE_NOT_VALID_AT_PICKUPThe service is not supported at the pickup point.
406INVALID_PICKUP_AREAThe service is not supported in the pickup area.
406INVALID_DELIVERY_AREAThe service is not supported in the delivery area.
406INVALID_FUTURE_ORDER_TIMEThe scheduled order time is not valid (e.g., scheduled order time is more than a month from the current time).
500INTERNAL_SERVER_ERRORWe had a problem with our server. Try again later.
- Unable to determine the province area of the address.
- The data transmitted contains fields with incorrect data types.
503SERVICE_UNAVAILABLEWe're temporarily offline for maintenance. Please try again later.