Cancel order
Cancels an order using its identification code (orderId). A common scenario is when the seller has a problem fulfilling the order and requests the marketplace to cancel it.
Orders that cannot be canceled
The following situations do not allow order cancellation:
-
Partial invoices: Partially invoiced orders cannot be canceled. However, the customer can change the order to replace or remove items from it.
-
Invoiced status: Orders with invoiced status cannot be canceled. If the order has already been invoiced, you can use the Order invoice notification endpoint to generate a return invoice.
-
Incomplete orders: Incomplete orders cannot be canceled.
Declining order cancelation
The order flow has a cancellation window (grace period) in which the customer can automatically cancel the order. Except for that period, the seller can decline an order cancellation request, regardless of whether the customer or the marketplace initiated it.
For more information, see Order canceling improvements.
Permissions
Any user or API key must have at least one of the appropriate License Manager resources to be able to successfully run this request. Otherwise they will receive a status code 403 error. These are the applicable resources for this endpoint:
| Product | Category | Resource |
|---|---|---|
| OMS | OMS access | Cancel order |
You can create a custom role with that resource or use one of the following predefined roles:
| Role | Resource |
|---|---|
| OMS - Full access | Cancel order |
| IntegrationProfile - Fulfillment Oms | Cancel order |
❗ Assigning a predefined role to users or application keys usually grants permission to multiple License Manager resources. If some of these permissions are not necessary, consider creating a custom role instead. For more information regarding security, see Best practices for using application keys.
To learn more about machine authentication at VTEX, see Authentication overview.
Path parameters
ID that identifies the order in the seller.
Headers
HTTP Client Negotiation Accept Header. Indicates the types of responses the client can understand.
Describes the type of the content being sent.
Request body
Response
OK