---
schema_version: "1"
id: 61fb4016ac29ba00971a83001f4df35a0ea24508eb21300243aca801a33b1a54
title: Cancel Order
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/industries/cme/guides/comms-cancel-order.md
canonical_url: https://developer.salesforce.com/docs/industries/cme/guide/comms-cancel-order.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: e3656ce94e42ec9455d192cc2ed45c88b533ee491370ddcbb71aa9d2a7cf6097
products:
  - Communications, Media, Energy and Utilities APIs (Managed Package)
  - Industries Developer Documentation
---
# 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.

<!-- Jared July 2020: Should this include PUT /cpq/carts/{cartid}/cancel, which is in Swagger as Send Updates on Cancellations?-->

```nolang
POST /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](https://help.salesforce.com/s/articleView?id=ind.comms_in_flight_order_cancellation.htm) (or the instructions for your pre-CME Winter '20 release). This API does not use [Order Management Integration Layer](https://help.salesforce.com/s/articleView?id=ind.comms_order_management_integration_in_industries_cpq.htm) 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

```nolang
 cancelCart
```

## REST Handler

```nolang
APICancelCartsCPQV2
```

## Apex Remote Service

```nolang
CpqAppHandler
```


## Apex Remote Input Map

```nolang
{"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](https://developer.salesforce.com/docs/industries/cme/references/cpq?meta=Summary).


## Resource Information

| Response Format | JSON                                                           |
| --------------- | -------------------------------------------------------------- |
| Resource URL    | `/services/apexrest/{namespace}/v2/cpq/carts/{cart_ID}/cancel` |

## Example Request

```nolang
POST /services/apexrest/v2/cpq/carts/{cart_ID}/cancel
{}
```

## Example Request Body

```nolang
{
  "totalSize": 1,
  "messages": [
    {
      "code": "305",
      "severity": "INFO",
      "message": "Your order has been cancelled."
    }
  ],
  "records": [
    {
      "displaySequence": -1,
      "vlocity_cmt__OrderStatus__c": "Cancelled",
      "vlocity_cmt__IsChangesAllowed__c": false
    }
  ]
}
```
