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.
Cancels all bags within an order by forwarding cancellation requests to each merchant's external commerce platform. Each bag must be in an ACCEPTED, SUBMITTED, COMPLETED, or PARTIALLY_REFUNDED state to qualify for cancellation. If all external cancellations succeed, full refunds are automatically processed for each bag. Returns an OrderCancellation object containing the cancellation status, individual bag cancellation records, and any associated refunds. If some bags fail cancellation on the external platform, the response will include error details for those bags.
ID of the order to cancel
11111API token for authentication
Application secret key
Application ID
10000Request to cancel an Order. Only orders that have not yet been fulfilled can be canceled. By default, items will be restocked and the customer will not be notified.
Custom message describing the reason for the cancellation.
Code that best represents the reason for the cancellation.
OTHERPossible values: Should the items be restocked. In most cases this should be true since only unfulfilled orders can be cancelled.
trueShould the customer be notified by the merchants system that a cancellation has occurred.
falsesuccess
Order Refund
Unique ID of the Refund.
ID of the Order being refunded
ID of the Bag being refunded
ID of the merchant making the refund
ID of the App that created the Order
ID of the Transaction being refunded
ID of the Payment Transaction in Violet
ID of the Transaction in the Payment Gateway
Amount being refunded. In Cents. This value can be null.
Amount being taken back from the associated transfer to the merchant. In Cents. This value can be null.
Amount being taken back from the associated transfer to the developer. In Cents. This value can be null.
Amount in fractional currency unit (e.g. cents) being taken back from the associated transfer to the merchant, in platform currency. This value can be null.
Amount in fractional currency unit (e.g. cents) being taken back from the associated transfer to the developer, in platform currency. This value can be null.
Reason for refund
Reason code for refund
Currency set for this refund by the external ecom platform
Currency used by the platform account for the payment provider that processed this Refund
Status of the Refund
Unique identifiers of the Transfer Reversal objects in Violet that are associated with this transfer.
Date of creation
Date of last update
ID of the refund on the external commerce platform. This value will only be populated if the external commerce platform supports refund ID's.
Tax amount being refunded. In Cents. This value can be null.
accepted
bad request
not found
internal server error
POST /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: 93
{
"notify_customer": true,
"reason_code": "CUSTOMER",
"reason": "Customer requested cancellation."
}{
"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?