Overview
Login
- Access
Onboarding
- Merchant Onboarding
Merchants
- Merchant
- Configuration
- Onboarding
- Explore
Catalog
- Offers
- SKUs
- Categories
- Collections
- Currencies
Orders & Checkout
- Carts
- Cart Items
- Cart Customer
- Cart Discounts
- Cart Shipping
- Cart Pricing
- Cart Payment
- Cart Completion
- Orders
- Order Refunds
- Order Cancellations
- Transfers
Payments
- Payout Accounts
- Distributions
- Transfers
- Transfer Reversals
Events
- Webhooks
- Webhook Events
- Webhook Headers
Apps
- Merchant/App Installs
- Commission Rates
Operations
- Connection
Relay
- Shipping
Ecom Syncs
- Offers
Order Cancellations
Cancel Bag
POST
/
orders
/
{order_id}
/
bags
/
{bag_id}
/
cancel
Copy
Ask AI
curl --request POST \
--url https://sandbox-api.violet.io/v1/orders/{order_id}/bags/{bag_id}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Violet-App-Id: <x-violet-app-id>' \
--header 'X-Violet-App-Secret: <x-violet-app-secret>' \
--header 'X-Violet-Token: <x-violet-token>' \
--data '{
"notify_customer": true,
"reason_code": "CUSTOMER",
"reason": "Customer requested refund."
}'
Copy
Ask AI
{
"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.000Z",
"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."
}
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
Body
application/json
Response
200
application/json
success
Order Refund
Was this page helpful?
Copy
Ask AI
curl --request POST \
--url https://sandbox-api.violet.io/v1/orders/{order_id}/bags/{bag_id}/cancel \
--header 'Content-Type: application/json' \
--header 'X-Violet-App-Id: <x-violet-app-id>' \
--header 'X-Violet-App-Secret: <x-violet-app-secret>' \
--header 'X-Violet-Token: <x-violet-token>' \
--data '{
"notify_customer": true,
"reason_code": "CUSTOMER",
"reason": "Customer requested refund."
}'
Copy
Ask AI
{
"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.000Z",
"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."
}
Assistant
Responses are generated using AI and may contain mistakes.