Cancel Order

Cancel an order. Calling this API creates a supplemental order and submits it to Order Management (XOM). After XOM processes the supplemental order, the original order is updated to canceled status.

1POST /v2/cpq/carts/{cart_ID}/cancel

The Cancel Order API uses the Supplemental and Cancel Order interface implementations that predate the CME Winter ‘20 release, including SupplementalOrderService and XOMSupplementalOrderLifeCycle. See In-Flight Order Cancellation (or the instructions for your pre-CME Winter ‘20 release). This API does not use Order Management Integration Layer features.

This API supports the guest user enhancements that Salesforce introduced with the Winter ‘21 release. To encrypt and decrypt data for guest users, use the UserSecurity class with this API. See Guest User Technical Details.

For additional information, ​see UserSecurity Class and CPQ and Digital Commerce Changes for Guest Users.

Remote Method 

1cancelCart

REST Handler 

1APICancelCartsCPQV2

Apex Remote Service 

1CpqAppHandler

Apex Remote Input Map 

1{"methodName":"cancelCart", "cartId":"80146000000iwCx"}

Package 

Communication (vlocity_cmt)

API Parameters and Response Format 

For API parameter names and descriptions, see Cart-Based API Swagger Reference.

Resource Information 

Response FormatJSON
Resource URL/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/cancel

Example Request 

1POST /services/apexrest/v2/cpq/carts/{cart_ID}/cancel
2{}

Example Request Body 

1{
2  "totalSize": 1,
3  "messages": [
4    {
5      "code": "305",
6      "severity": "INFO",
7      "message": "Your order has been cancelled."
8    }
9  ],
10  "records": [
11    {
12      "displaySequence": -1,
13      "vlocity_cmt__OrderStatus__c": "Cancelled",
14      "vlocity_cmt__IsChangesAllowed__c": false
15    }
16  ]
17}