POST
/
orders
/
{order_id}
/
cancel

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.

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.

Headers

X-Violet-Token
string
X-Violet-App-Secret
string
X-Violet-App-Id
integer

Path Parameters

order_id
integer
required

Body

application/json
reason
string

Custom message describing the reason for the cancellation.

reason_code
enum<string>
default: OTHER

Code that best represents the reason for the cancellation.

Available options:
OTHER,
CUSTOMER,
INVENTORY,
FRAUD,
DECLINED
restock_items
boolean
default: true

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

notify_customer
boolean
default: false

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

Response

200 - application/json

Cancellation record for an order.

order_id
integer

The ID of the order this cancellation relates to.

app_id
integer

The ID of the app that originated this order.

status
enum<string>

Status of the overall cancellation.

Available options:
CANCELED,
PARTIALLY_CANCELED,
CANCELLATION_FAILURE
cancelled_bags
object[]

Bags within the order that were cancelled.

message
string

Description of the outcome of the order cancellation request.