# 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"
      
  		}
	]
}
```
