Update Order Information
Allows partners to update order information after creation
Conditions for updating order information:
- Allowed statuses for updates:
IDLE
,ASSIGNING
,ACCEPTED
- Fields allowed for updates within the path:
Parameter | Update Limit | Allowed Services | Allowed Path | Allowed Payment Methods |
---|---|---|---|---|
name | Unlimited | Ahamove and OnWheel services (VNM-PARTNER-XXX) | Pickup and delivery points in path | BALANCE, CASH, CASH_BY_RECIPIENT |
mobile | Unlimited | Ahamove and OnWheel services | Pickup and delivery points in path | BALANCE, CASH, CASH_BY_RECIPIENT |
remarks | Unlimited | Ahamove and OnWheel services | Pickup and delivery points in path | BALANCE, CASH, CASH_BY_RECIPIENT |
cod | Once per path | OnWheel service | Delivery points in path | BALANCE, CASH |
address | Once per path | OnWheel service | Delivery points in path | BALANCE, CASH |
- cURL
- JavaScript
curl --location --request PATCH 'https://partner-apistg.ahamove.com/v3/orders/<order_id>' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"path_index": 1,
"name": "Anh",
"mobile": "09xxxxxxxx",
"remarks": "Cổng đón khách A",
"cod": 220000,
"address_info": {
"lat": 10.798026,
"lng": 106.696369,
"address": "Bệnh Viện Quận Bình Thạnh, 132 Lê Văn Duyệt, Phường 1, Quận Bình Thạnh, Thành phố Hồ Chí Minh, Việt Nam"
}
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const raw = JSON.stringify({
path_index: 1,
name: 'Anh',
mobile: '09xxxxxxxx',
remarks: 'Cổng đón khách A',
cod: 220000,
address_info: {
lat: 10.798026,
lng: 106.696369,
address:
'Bệnh Viện Quận Bình Thạnh, 132 Lê Văn Duyệt, Phường 1, Quận Bình Thạnh, Thành phố Hồ Chí Minh, Việt Nam',
},
});
const requestOptions = {
method: 'PATCH',
headers: myHeaders,
body: raw,
redirect: 'follow',
};
fetch('https://partner-apistg.ahamove.com/v3/orders/<order_id>', requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
HTTP Request
PATCH https://partner-apistg.ahamove.com/v3/orders/<order_id>
Headers
Parameter | Value | Required | Description |
---|---|---|---|
Authorization | Bearer <token> | Yes | Token of the order creator |
Body
{
"path_index": 1,
"name": "Anh",
"mobile": "09xxxxxxxx",
"remarks": "Cổng đón khách A",
"cod": 220000,
"address_info": {
"lat": 10.798026,
"lng": 106.696369,
"address": "Bệnh Viện Quận Bình Thạnh, 132 Lê Văn Duyệt, Phường 1, Quận Bình Thạnh, Thành phố Hồ Chí Minh, Việt Nam"
}
}
Parameters
Parameter | Type | Required | Description |
---|---|---|---|
path_index | Int | Yes | Index of the path to update (path_index = 0 for the pickup point, with the maximum value being the last delivery point) |
name | String | No | Name field in each path |
mobile | String | No | Mobile field in each path |
remarks | String | No | Remarks field in each path |
cod | Int | No | COD value for each delivery point |
address_info | Object | No | Address information for delivery points |
Model của address_info
Cập nhật từ path[x], x > 0
Parameter | Type | Yêu cầu | Mô tả |
---|---|---|---|
address | String | Có | Địa chỉ giao hàng đúng định dạng |
lat | Float | Không | Vĩ độ của điểm giao (Không bắt buộc nhưng đề xuất Đối tác nên sử dụng) |
lng | Float | Không | Kinh độ của điểm giao (Không bắt buộc nhưng đề xuất Đối tác nên sử dụng) |
Model of address_info
Update from path[x], x > 0
Parameter | Type | Required | Description |
---|---|---|---|
address | String | Yes | Formatted delivery address |
lat | Float | No | Latitude of the delivery point (optional but recommended) |
lng | Float | No | Longitude of the delivery point (optional but recommended) |
Response
JSON response example:
{}
Status-Code: 200 OK
Errors
Error | Text | Description |
---|---|---|
400 | BAD_REQUEST | Bad request |
400 | MISSING_REQUIRED_INFO | Missing required fields |
400 | INVALID_DATA | Data in request body is invalid |
401 | NOT_AUTHORIZED | Invalid token |
403 | SUPPLIER_NOT_ENOUGH_MONEY_FOR_CHANGE_ADDRESS | Unable to change address due to insufficient balance for deduction in the driver's account |
403 | STOP_POINT_EDITED | Stop point information already changed |
403 | ORDER_STATUS_NOT_ALLOWED | Order status does not allow information changes |
403 | CHANGE_ADDRESS_NOT_ALLOWED | Address change not allowed |
404 | ORDER_NOT_FOUND | Order not found |
406 | NOT_ALLOW_ORDER_WITH_PROMO_CODE | Order updates not allowed with applied promo code |
406 | NOT_ALLOW_CHANGE_PICKUP_ADDRESS | Pickup address changes not allowed |
406 | INVALID_PAYMENT_METHOD | Order payment method does not support information changes |
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 |