> ## Documentation Index
> Fetch the complete documentation index at: https://docs.oneclickdz.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Check Status by ID

> Check internet top-up status using internal ID

## Overview

Track internet top-up status and retrieve card details when fulfilled.

## Path Parameters

<ParamField path="id" type="string" required>
  Internal top-up ID from `/internet/send` response
</ParamField>

## Response Fields

<ResponseField name="status" type="string">
  * **HANDLING:** Processing (3-45s) - **FULFILLED:** Complete with card code ✅
  * **REFUNDED:** Failed and refunded ❌ - **QUEUED:** Scheduled (12-48h) ⏰
</ResponseField>

<ResponseField name="card_code" type="string">
  Activated card code (available when FULFILLED)
</ResponseField>

<ResponseField name="num_trans" type="string">
  Algérie Télécom transaction number
</ResponseField>

<ResponseField name="date_traitement" type="string">
  Processing date
</ResponseField>

## Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl https://api.oneclickdz.com/v3/internet/check-id/6901616fe9e88196b4eb64b2 \
    -H "X-Access-Token: YOUR_API_KEY"
  ```

  ```javascript Node.js theme={null}
  const id = "6901616fe9e88196b4eb64b2";
  const response = await fetch(
    `https://api.oneclickdz.com/v3/internet/check-id/${id}`,
    { headers: { "X-Access-Token": "YOUR_API_KEY" } }
  );
  const { data } = await response.json();
  ```

  ```python Python theme={null}
  response = requests.get(
      f'https://api.oneclickdz.com/v3/internet/check-id/{topup_id}',
      headers={'X-Access-Token': 'YOUR_API_KEY'}
  )
  data = response.json()['data']
  ```

  ```php PHP theme={null}
  <?php
  $topupId = '6901616fe9e88196b4eb64b2';
  $ch = curl_init("https://api.oneclickdz.com/v3/internet/check-id/{$topupId}");
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
  curl_setopt($ch, CURLOPT_HTTPHEADER, ['X-Access-Token: YOUR_API_KEY']);
  $response = curl_exec($ch);
  $data = json_decode($response, true)['data'];
  ?>
  ```
</CodeGroup>

### Fulfilled Response

```json theme={null}
{
  "success": true,
  "data": {
    "_id": "6901616fe9e88196b4eb64b2",
    "ref": "internet-order-001",
    "status": "FULFILLED",
    "type": "ADSL",
    "number": "036362608",
    "topup_amount": 1000,
    "card_code": "123456789012",
    "num_trans": "AT-2025-12345",
    "date_traitement": "2025-10-29T01:05:30.000Z",
    "created_at": "2025-10-29T01:00:00.000Z"
  }
}
```

## Polling Example

```javascript theme={null}
async function pollInternetStatus(topupId) {
  const maxAttempts = 60;

  for (let i = 0; i < maxAttempts; i++) {
    const response = await fetch(
      `https://api.oneclickdz.com/v3/internet/check-id/${topupId}`,
      { headers: { "X-Access-Token": process.env.API_KEY } }
    );

    const { data } = await response.json();

    if (["FULFILLED", "REFUNDED", "QUEUED"].includes(data.status)) {
      return data;
    }

    await new Promise((resolve) => setTimeout(resolve, 5000));
  }

  throw new Error("Timeout");
}
```

## Handling QUEUED Status

<Warning>
  QUEUED means the top-up is scheduled for later (12-48 hours). Do not treat as
  failure.
</Warning>

```javascript theme={null}
if (status === "QUEUED") {
  // Save for later verification
  await db.orders.update({
    id: orderId,
    status: "SCHEDULED",
    message: "Card will be delivered within 48 hours",
  });

  // Check again after 24h
  scheduleRecheck(orderId, 24 * 60 * 60 * 1000);
}
```

## Related

<CardGroup cols={2}>
  <Card title="Check by Reference" href="/en/api-reference/internet/check-by-ref">
    Track with custom ref
  </Card>

  <Card title="Send Top-Up" href="/en/api-reference/internet/send-topup">
    Create new order
  </Card>
</CardGroup>
