Cancel Order
This API is used to cancel an order
- cURL
- JavaScript
curl -X GET \
'https://apistg.ahamove.com/v1/order/cancel?token=<TOKEN_STG>&order_id=ABCDEF&comment=User changes pick up&cancel_code=user_incorrect_pickup' \
-H 'cache-control: no-cache'
var requestOptions = {
method: 'GET',
redirect: 'follow',
};
fetch(
'https://apistg.ahamove.com/v1/order/cancel?token=<TOKEN_STG>&order_id=ABCDEF&comment=User changes pick up&cancel_code=user_incorrect_pickup',
requestOptions
)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.log('error', error));
Can cancel an order which has one of statuses below:
ASSIGNING, ACCEPTED, CONFIRMING, PAYING, IDLE
comment
andcancel_code
parameters have been standardized by Ahamove at Cancel Reason. Partners only need to use the reasons for User, thecomment
corresponding to the En or Vi column and the correspondingcancel_code
with column Ahamove's Cancel Reason Code when Partners needs to cancel the order
HTTP Request
GET https://apistg.ahamove.com/v1/order/cancel
Query Parameters
Parameter | Type | Required | Description |
---|---|---|---|
token | String | Yes | The user Token. |
order_id | String | Yes | The order ID. |
comment | String | Yes if order in ACCEPTED status | The cancel reason for User (En/Vi column). |
cancel_code | String | Yes if order in ACCEPTED status | The cancel code reason for User (Ahamove's Cancel Reason Code column)(Optional). |
Response
JSON response example:
{}
Status-Code: 200 OK
Errors
Code | Text | Description |
---|---|---|
404 | Not Found | - Token not found - Order not found |
402 | Not allowed | Not authorized. |
406 | Not Acceptable | Order not in valid status. |
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. |