POST
/
orders
/
{order_id}
/
bags
/
{bag_id}
/
cancel

Bag cancellation is in beta. Please report any errors to Violet.

Cancel a single Bag from an Order. This action will attempt to cancel the external order in the merchants system. The total amount paid for this Bag will be refunded to the shopper upon successful cancellation.

The Bag must be in a cancellable state. Any Bag’s that have a status of IN_PROGRESS, REFUNDED, or CANCELED cannot be cancelled.

Headers

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

Path Parameters

order_id
integer
required
bag_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.