# Cancel Order

## Cancel Orders

<mark style="color:blue;">**`PUT`**</mark> `/v1/order/cancel`

This API will cancel the order. The order that has already been redeemed cannot be canceled.

**Headers**

| Name          | Value              |
| ------------- | ------------------ |
| Content-Type  | `application/json` |
| Authorization | `Bearer <idToken>` |

**Body**

| Name   | Type   | Description       | Required |
| ------ | ------ | ----------------- | -------- |
| `id`   | string | ID of the order   | Yes      |
| `code` | string | code of the order | Yes      |

**Response**

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

```json
{
    "statusCode": 200,
    "statusMessage": "Order successfully canceled"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "statusCode": 400,
    "statusMessage": "Order ID and Code are required"
}
```

{% endtab %}

{% tab title="400" %}

```json
{
    "statusCode": 400,
    "statusMessage": "Order ID and Code are required"
}
```

{% endtab %}
{% endtabs %}


---

# 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://docs.senmo.io/foundry-platform/orders/cancel-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.
