# Cancel an Order

## cancel an order

<mark style="color:green;">`POST`</mark> `https://wms.eshopbox.com/api/cancel-order`

This endpoint will cancel an order.

#### Headers

| Name           | Type   | Description                     |
| -------------- | ------ | ------------------------------- |
| Authentication | string | Bearer token to access the API. |

#### Request Body

| Name                | Type   | Description                                                             |
| ------------------- | ------ | ----------------------------------------------------------------------- |
| items               | array  | List of items to be cancelled (R)                                       |
| cancellationTime    | string | <p>Time at which the order is cancelled.<br>eg: 2020-03-02 12:00:05</p> |
| reason              | string | reason for cancellation of order (R)                                    |
| customerOrderNumber | string | Unique identifier against each sales channel (R)                        |
| externalChannelID   | string | Sales channel name of the client (R)                                    |

{% tabs %}
{% tab title="200 cancel request placed successfully" %}

```php
{
    "status": "SUCCESS",
    "result": {
        "customerOrderNumber": "41007212",
        "reason": "Cancelled By Customer",
        "cancellationTime": "2018-07-08 22:00:05",
        "items": [
            {
                "lineItemSequenceNumber": 2331,
                "itemID": "5050406281126",
                "quantity": 1,
                "productName": "Chinley Walk",
                "remark": "cancelled by customer"
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

```php
curl -X POST http://wms.eshopbox.com/api/cancel-order \
-H "Authorization: Bearer XXXX" \
    -H "Content-Type: application/json" \
    -d $'{
    "externalChannelID":"TATA CLIQ VELOCY KAPAS KRAFT",
		"customerOrderNumber":"41007212",
		"actor": "abc@gmail.com"
		"reason":"Cancelled By Customer",
		"cancellationTime": "2018-07-08 22:00:05",
		"items": 
		[
  		{
  				"lineItemSequenceNumber": 2331,
  				"itemID": "5050406281126",
  				"quantity": 1,
  				"productName": "Chinley Walk",
  				"remark" :"cancelled by customer"
      
  		}
	]
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://eshop.gitbook.io/eshopbox-developers/order/orders/cancel-an-order.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
