> 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/get-order-status.md).

# Get Order Status

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

Returns the current status of a receive or send order. For receive orders, the activation `code` and phone `number` appear in the response once the SMS has been delivered.

#### Query Parameters

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

{% tabs %}
{% tab title="200: OK — Receive Order (code received)" %}
{% code overflow="wrap" %}

```javascript
{
    status: 'OK', 
    paid: true, 
    code: 48010,
    id: 1125699791,
    number: 12345678901,
    timestamp: 1666613406969,
    country: 'India',
    service: 'openAI',
}
```

{% endcode %}
{% endtab %}

{% tab title="200: OK — Send Order" %}

```javascript
{
    status: 'OK', 
    paid: true, 
    id: 'SMfa2be998e8913565cbbd5f750e32b1b5',
    smsStatus: 'created | sent | delivered | failed',
    timestamp: 1666613406969,
}
```

{% endtab %}

{% tab title="200: OK — No Number Available" %}

```javascript
{
    status: 'OK', 
    paid: true, 
    error: 'No available number, payment request is canceled. Your funds are returned to your wallet automatically.'
}
```

{% 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 success                                                        |
| `paid`      | Boolean       | Whether the Lightning invoice has been paid                            |
| `code`      | Number        | The SMS activation code (receive orders only — appears when delivered) |
| `number`    | Number        | The phone number assigned to this order                                |
| `id`        | Number/String | Internal activation ID (receive) or SMS provider ID (send)             |
| `smsStatus` | String        | Send order status: `created`, `sent`, `delivered`, or `failed`         |
| `country`   | String        | Country name                                                           |
| `service`   | String        | Service name                                                           |
| `timestamp` | Number        | Unix timestamp (milliseconds)                                          |
| `error`     | String        | Error message if a number could not be assigned                        |

### Polling

Poll this endpoint every few seconds after paying the invoice. The `code` field will appear once an SMS has been received. Most codes arrive within 30–120 seconds.

{% hint style="warning" %}
If `paid` is `true` but `code` is absent and more than 2 minutes have passed, consider calling [Cancel Order](/api-reference/cancel-order.md) to free the number and get your funds back.
{% endhint %}
