Cancel Order
Sample test case of cancel order
Cancel by user
- cURL
- JavaScript
curl --location --request DELETE 'https://partner-apistg.ahamove.com/v3/orders/22ZPGW7V' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer <token>' \
--data '{
"comment": "Cannot contact the driver"
}'
const myHeaders = new Headers();
myHeaders.append('Content-Type', 'application/json');
myHeaders.append('Authorization', 'Bearer <token>');
const raw = JSON.stringify({
comment: 'Cannot contact the driver',
});
const requestOptions = {
method: 'DELETE',
headers: myHeaders,
redirect: 'follow',
};
fetch('https://partner-apistg.ahamove.com/v3/orders/22ZPGW7V', requestOptions)
.then((response) => response.text())
.then((result) => console.log(result))
.catch((error) => console.error(error));
- Check the callback return
{
"_id": "22ZPGW7V",
"accept_time": 1663835863.1100876,
"cancel_by_user": true,
"cancel_comment": "Cannot contact the driver",
"cancel_image_url": "",
"cancel_time": 1663835909.464646,
"city_id": "SGN",
"complete_time": 0,
"create_time": 1663835764.3251476,
"path": [...]
"payment_method": "CASH",
"pickup_time": 0,
"service_id": "SGN-BIKE"
"status": "CANCELLED",
"sub_status": "",
...
}
Cancel by driver
- Driver will submit the reason when cancel order
- User check order status on partner portal