Cancel Order
Order cancellation is in beta. Please report any errors to Violet.
Cancel a complete Order. This action will attempt to cancel the external order in the merchants system for every Bag in the Order. The total amount paid for each Bag will be refunded to the shopper upon successful cancellation.
Path parameters
order_idinteger · int64Required
Header parameters
X-Violet-TokenstringRequired
X-Violet-App-SecretstringRequired
X-Violet-App-Idinteger · int32Required
Body
reasonstring · max: 255Optional
Custom message describing the reason for the cancellation.
reason_codestring · enum · max: 255OptionalDefault:
Code that best represents the reason for the cancellation.
OTHERPossible values: restock_itemsbooleanOptionalDefault:
Should the items be restocked. In most cases this should be true since only unfulfilled orders can be cancelled.
truenotify_customerbooleanOptionalDefault:
Should the customer be notified by the merchants system that a cancellation has occurred.
falseResponses
200
success
application/json
202
accepted
application/json
400
bad request
application/json
404
not found
application/json
post
/orders/{order_id}/cancelPOST /v1/orders/{order_id}/cancel HTTP/1.1
Host: sandbox-api.violet.io
X-Violet-Token: text
X-Violet-App-Secret: text
X-Violet-App-Id: 1
Content-Type: application/json
Accept: */*
Content-Length: 87
{
"notify_customer": true,
"reason_code": "CUSTOMER",
"reason": "Customer requested refund."
}{
"order_id": 10000,
"app_id": 10000,
"status": "CANCELED",
"cancelled_bags": [
{
"order_id": 10000,
"bag_id": 11111,
"merchant_id": 22222,
"external_order_id": "7438192837181",
"status": "CANCELED",
"originated_by": "VIOLET",
"date_cancelled": "2024-10-24T14:00:39.000+00:00",
"refund": {
"id": 99999,
"order_id": 10000,
"bag_id": 11111,
"merchant_id": 22222,
"app_id": 10000,
"transaction_id": 44444,
"amount": 9900,
"reason": "Order canceled",
"refund_currency": "USD",
"status": "COMPLETED",
"skus": [
{
"id": 55555,
"bag_id": 11111,
"quantity_refunded": 1,
"external_id": "41818918453315",
"order_sku_id": 8014657
},
{
"id": 55556,
"bag_id": 77777,
"quantity_refunded": 1,
"external_id": "41832890171459",
"order_sku_id": 77777
}
],
"date_created": "2024-10-24T14:00:35+0000",
"date_last_modified": "2024-10-24T14:00:35+0000",
"external_id": "943916482627",
"errors": []
}
}
],
"message": "All external orders were cancelled."
}Last updated
Was this helpful?