> 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 an Order

Cancel an eligible bearer-token order and safely release its held payment.

{% tabs %}
{% tab title="Receive SMS" %} <mark style="color:green;">`POST`</mark> `/v2/receive-sms/orders/{orderId}/cancel`
{% endtab %}

{% tab title="Rent Number" %} <mark style="color:green;">`POST`</mark> `/v2/rent-numbers/orders/{orderId}/cancel`
{% endtab %}
{% endtabs %}

```http
Authorization: Bearer <accessToken>
```

The response is the latest full order snapshot.

## Receive-SMS eligibility

* An unpaid order may be cancelled immediately.
* A paid order becomes eligible **three minutes after payment** only after it reaches `waiting_for_sms`.
* Cancellation is rejected during allocation or after any SMS data has been received.
* Use `cancellation.eligible` and `cancellation.availableAt` from the order response.

For an eligible paid order, successful cancellation releases the Lightning hold. If the response is ambiguous or the order remains in a transitional state, poll for its final status before taking further action.

## Rental eligibility

* An unpaid rental may be cancelled.
* Any paid rental is not manually cancellable, including while allocation is still in progress.

## Example

```bash
curl -sS -X POST \
  https://api.sms4sats.com/v2/receive-sms/orders/ORDER_ID/cancel \
  -H 'Authorization: Bearer ACCESS_TOKEN'
```

{% hint style="warning" %}
A `409 CANCEL_NOT_AVAILABLE_YET` or `409 ORDER_NOT_CANCELLABLE` is authoritative. Fetch the order again instead of repeatedly submitting cancellation.
{% endhint %}
