# Cancel Items

<mark style="color:orange;">`POST`</mark> /v3/transactions/<mark style="color:orange;">{transactionId}</mark>/cancel

## Request

The details below help you form your HTTP requests to this endpoint.

### Headers

You may need to provide specific headers.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>x-consumer-custom-id</td><td>string</td><td>true</td><td>Consumer data with the format "channel:vendorId"</td></tr></tbody></table>

### Path Parameters

The endpoint path expects parameters.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>transactionId</td><td>string</td><td>true</td><td>The transaction ID provided at lease generation.</td></tr></tbody></table>

### Body

You must provide a JSON payload.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>items</td><td>array</td><td>false</td><td>The list of items to be cancelled.</td></tr><tr><td>items[].sku</td><td>string</td><td>true</td><td>Item's sku</td></tr><tr><td>items[].quantity</td><td>number</td><td>false</td><td>Quantity, defaults to the number ordered if not present.</td></tr></tbody></table>

## Response

The details below help you understand the responses you could get from this endpoint.

### Samples

Below are samples of responses, with tabs corresponding to returned status code.

{% tabs %}
{% tab title="200" %}

```javascript
{
    "data": {
        "canceled": [
            {
                "sku": "123ASD",
                "quantity": 1
            }
        ],
        "failed": [
            {
                "sku": "123ASD",
                "quantity": 1
            }
        ]
    }
}
```

{% endtab %}

{% tab title="400" %}

```javascript
{
    "error": {
        "statusCode": 400,
        "code": "UserAlreadyExists",
        "message": "User already exists with email ex@example.com",
        "data": {}
    }
}
```

{% endtab %}
{% endtabs %}

### Schema

The response's schema is outlined below.

<table><thead><tr><th>Name</th><th>Type</th><th data-type="checkbox">Required</th><th>Description</th></tr></thead><tbody><tr><td>data</td><td>object</td><td>false</td><td>N/A</td></tr><tr><td>data.canceled</td><td>array</td><td>true</td><td>N/A</td></tr><tr><td>data.canceled[].sku</td><td>string</td><td>true</td><td>The Item's SKU canceled</td></tr><tr><td>data.canceled[].quantity</td><td>number</td><td>true</td><td>The quantity of items canceled</td></tr><tr><td>data.failed</td><td>array</td><td>true</td><td>N/A</td></tr><tr><td>data.failed[].sku</td><td>string</td><td>true</td><td>The Item's SKU failed to cancel</td></tr><tr><td>data.failed[].quantity</td><td>number</td><td>true</td><td>The quantity of items failed</td></tr></tbody></table>
