Skip to main content

Create Warehouse order

Create a new Warehouse order by user

curl --request POST \
--url https://apistg.ahamove.com/v1/order/create \
--header 'Cache-Control: no-cache' \
--header 'accept: application/json' \
--header 'content-type: application/x-www-form-urlencoded' \
--data-urlencode 'service_id=SGN-WAREHOUSE' \
--data-urlencode 'payment_method=BALANCE' \
--data-urlencode 'remarks=This is note for order' \
--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":"nmbmb","mobile":"84xxxxxxxxx"},{"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","mobile":"84xxxxxxxxx","remarks":"call me","cod":520000,"item_value":830000,"weight":28,"height":42,"width":30,"length":64,"tracking_number":"ABCXXXXXXXX"}]' \
--data-urlencode 'items=[{"_id": "DG","num": 2,"name": "Combo dầu gội và sữa tắm Dove","price": 520000},{"_id": "ST","num": 1,"name": "Thùng sữa tươi Vinamilk","price": 310000}]' \
--data-urlencode 'token=<TOKEN_STG>'

HTTP Request

POST https://apistg.ahamove.com/v1/order/create (x-wwww-form-urlencoded)

or

GET https://apistg.ahamove.com/v1/order/create

Parameters

# Parameters
{
"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",
"mobile":"84xxxxxxxxx"
},
{
"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",
"mobile":"84xxxxxxxxx",
"remarks": "call me",
"cod": 520000,
"tracking_number": "ABCXXXXXXXX",
"weight": 28,
"height": 42,
"width": 30,
"length": 64,
"item_value": 830000
}
],
"service_id": "SGN-WAREHOUSE",
"remarks": "This is note for order",
"payment_method": "BALANCE",
"items": [
{
"_id": "DG",
"num": 2,
"name": "Combo dầu gội và sữa tắm Dove",
"price": 520000
},
{
"_id": "ST",
"num": 1,
"name": "Thùng sữa tươi Vinamilk",
"price": 310000
}
]
}
ParameterTypeRequiredDescription
tokenStringYesThe user Token. Get token from API Register Account
order_timeNumber (Unix timestamp)YesThe pickup time (order_time = 0)
pathStringYesAt least 2 pairs (described in more detail below)
service_idStringYesWarehouse Service ID, available in 2 cities are Ho Chi Minh City (SGN-WAREHOUSE) and Ha Noi (HAN-WAREHOUSE)
payment_methodStringYesPayment method for Warehouse service is BALANCE
remarksStringNoRemarks
itemsArrayNoList items

Path

Representing from path[0] to path[1]

ParameterTypeRequiredDescription
addressStringYesAddress of the location
latNumberYesLatitude of the location (Optional but highly recommended)
lngNumberYesLongitude of the location (Optional but highly recommended)
nameStringYesSender or Recipient's name
mobileStringYesSender or Recipient's mobile phone number
tracking_numberStringYesPartner's internal order code, at least 6 characters, no special characters (_, -, ., /, etc.) and must be unique. This code needs to be printed on the package
weightFloatYesActual weight of the package (Kg)
heightFloatYesActual height of the package (cm)
lengthFloatYesActual length of the package (cm)
widthFloatYesActual width of the package (cm)
item_valueNumberYesActual value of the package
codNumberNoAmount of COD (Cash on Delivery) to be collected
remarksStringNoNotes for the driver

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

Items

Field InformationTypeRequiredDescription
_idStringYesItem ID
nameStringYesItem name
priceIntYesTotal item value after being multiplied by the quantity
numIntYesQuantity of the item

Response

JSON response example:

{
"_id": "PARTNER_ABCXXXXXXXX", # ID of warehouse order, generated from partner name and partner’s tracking_number (upper case)
"tracking_number": "ABCXXXXXXXX",
"status": "VERIFYING" # For every successfully created orders, this value is VERIFYING
}

Status-Code: 200 OK

Errors

CodeTextDescription
404Not Found- Token not found (Token has expired. When a new token is created, the old token has expired)
- Path not found
- Service not found
406Not Acceptable- Booking time not valid
- Address not valid
- Duplicate tracking_number
- Distance not valid
- Invalid pickup area
- Invalid delivery area
- Concurrent order not allowed (If partner not in token)
- Large COD not allowed for first time user
- Post paid not set for partner
- Not supported payment method
- Not enough credit
- User’s phone number associated with
- Token has been used for a partner
- Child order status not valid (When creating parent order)
- Parent order existed for #ABCXYZ (When creating a parent order but child orders already had a parent)
- Idle until not valid (When client sent idle_until < current_time)
- COD is not valid ( When total COD exceeds the maximum value which was configured in service)
- Number of stop points are not valid
408Request timeoutGoogle Distance API does not return results in 10 seconds.
500Internal Server ErrorWe had a problem with our server. Try again later.
503Service UnavailableWe're temporarily offline for maintenance. Please try again later.