Cancel Order

circle-exclamation

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.

circle-info

All Bag's must be in a cancellable state. If any Bag has a status of IN_PROGRESS, REFUNDED, or CANCELED the request will be rejected.

Cancel Order

post

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.

Path parameters
order_idinteger · int64Required

ID of the order to cancel

Example: 11111
Header parameters
X-Violet-TokenstringRequired

API token for authentication

X-Violet-App-SecretstringRequired

Application secret key

X-Violet-App-Idinteger · int32Required

Application ID

Example: 10000
Body

Request 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.

reasonstring · max: 255Optional

Custom message describing the reason for the cancellation.

reason_codestring · enum · max: 255Optional

Code that best represents the reason for the cancellation.

Default: OTHERPossible values:
restock_itemsbooleanOptional

Should the items be restocked. In most cases this should be true since only unfulfilled orders can be cancelled.

Default: true
notify_customerbooleanOptional

Should the customer be notified by the merchants system that a cancellation has occurred.

Default: false
Responses
chevron-right
200

success

application/json

Order Refund

idinteger · int64Read-onlyRequired

Unique ID of the Refund.

order_idinteger · int64Required

ID of the Order being refunded

bag_idinteger · int64Optional

ID of the Bag being refunded

merchant_idinteger · int32Required

ID of the merchant making the refund

app_idinteger · int32Required

ID of the App that created the Order

transaction_idinteger · int64Required

ID of the Transaction being refunded

payment_transaction_idinteger · int64Required

ID of the Payment Transaction in Violet

gateway_transaction_idstringRequired

ID of the Transaction in the Payment Gateway

amountinteger · int32Required

Amount being refunded. In Cents

merchant_transfer_reversal_amount_usdinteger · int32Optional

Amount being taken back from the associated transfer to the merchant. In Cents

developer_transfer_reversal_amount_usdinteger · int32Optional

Amount being taken back from the associated transfer to the developer. In Cents

merchant_transfer_reversal_amount_platform_currencyinteger · int32Optional

Amount in fractional currency unit (e.g. cents) being taken back from the associated transfer to the merchant, in platform currency.

developer_transfer_reversal_amount_platform_currencyinteger · int32Optional

Amount in fractional currency unit (e.g. cents) being taken back from the associated transfer to the developer, in platform currency.

reasonstringOptional

Reason for refund

reason_codestring · enumOptional

Reason code for refund

Possible values:
refund_currencystringOptional

Currency set for this refund by the external ecom platform

platform_currencystringOptional

Currency used by the platform account for the payment provider that processed this Refund

statusstring · enumOptional

Status of the Refund

Possible values:
transfer_reversalsstring[]Optional

Unique identifiers of the Transfer Reversal objects in Violet that are associated with this transfer.

date_createdstring · date-timeOptional

Date of creation

date_last_modifiedstring · date-timeOptional

Date of last update

external_idstringOptional

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_amountinteger · int32 · nullableOptional

Tax amount being refunded. In Cents.

post
/orders/{order_id}/cancel

Last updated

Was this helpful?