Delete an Order
Endpoint
POST /v1/orders/:id/cancel
DELETE /v1/orders/:id // deprecated
Order can be cancelled or rejected based on order id upon request.
Cancellation Reason Codes
To cancel an order, please use one of the codes provided by this endpoint. Each code is paired with a cancellation reason. The cancellation reasons are available in two languages: Bahasa (id
) and English (en
), represented by the lang
query parameter. The default language is Bahasa if you do not specify a language upon retrieval.
Endpoint
GET /v1/orders/cancellation_reasons?lang=id // in bahasa
GET /v1/orders/cancellation_reasons?lang=en // in english
Cancellation Reasons in Bahasa
Response Example
{
"success": true,
"message": "Order cancellation reasons successfully retrieved",
"cancellation_reasons": [
{
"code": "change_courier",
"reason": "Ingin mengganti kurir"
},
{
"code": "pickup_delay",
"reason": "Waktu penjemputan terlalu lama"
},
{
"code": "change_address",
"reason": "Ingin mengganti alamat"
},
{
"code": "others",
"reason": "Pesanan dibatalkan oleh pedagang karena alasan lain"
}
]
}
Cancellation Reasons in English
Response Example
{
"success": true,
"message": "Order cancellation reasons successfully retrieved",
"cancellation_reasons": [
{
"code": "change_courier",
"reason": "Want to change courier"
},
{
"code": "pickup_delay",
"reason": "Pickup time too long"
},
{
"code": "change_address",
"reason": "Want to change address"
},
{
"code": "others",
"reason": "Order cancelled by merchant for other reason"
}
]
}
Type of Requests
Using Cancellation Reason Code
JSON Body Request
{
"cancellation_reason_code": "change_courier"
}
Custom Cancellation Reason
JSON Body Request
{
"cancellation_reason_code": "others",
"cancellation_reason": "Accidentally ordered"
}
API Response
Response
{
"success": true,
"message": "Order successfully deleted",
"object": "order",
"id": "5dd5a396248481164a225af4",
"status": "cancelled",
"cancellation_reason_code": "others"
"cancellation_reason": "Accidentally ordered"
}