> For the complete documentation index, see [llms.txt](https://docs.sms4sats.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.sms4sats.com/api-reference/cancel-order.md).

# Cancel Order

<mark style="color:blue;">`GET`</mark> `https://api2.sms4sats.com/cancelorder`

Cancels a receive order and releases the associated hold invoice. Your funds are automatically returned to your wallet.

{% hint style="info" %}
You can cancel an order after **2 minutes** if no activation code has arrived. All orders without a received code are **automatically canceled after 21 minutes**.
{% endhint %}

#### Query Parameters

| Name      | Type   | Required | Description                                                                    |
| --------- | ------ | -------- | ------------------------------------------------------------------------------ |
| `orderId` | String | Yes      | Order ID returned by [`/createorder`](/api-reference/create-receive-order.md). |

{% tabs %}
{% tab title="200: OK" %}
{% code overflow="wrap" %}

```javascript
{
    status: 'OK'
}
```

{% endcode %}
{% endtab %}

{% tab title="500: Internal Server Error" %}

```javascript
{
    status: 'error',
    reason: 'unable to save data'
}
```

{% endtab %}
{% endtabs %}

### Response Fields

| Field    | Type   | Description                     |
| -------- | ------ | ------------------------------- |
| `status` | String | `OK` on successful cancellation |

{% hint style="warning" %}
Only orders that have **not** yet received an activation code can be canceled. Once a code is delivered, the invoice is settled and cannot be reversed.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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.sms4sats.com/api-reference/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.
