> For the complete documentation index, see [llms.txt](https://en-api.decisiontele.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://en-api.decisiontele.com/esim-api/usage/get-package-usage.md).

# Get Package Usage

Request the latest usage details for one package assigned to an eSIM.

### Request

```http
POST /api/v1/packages/usage
Authorization: Bearer <TOKEN>
Content-Type: application/json
Accept: application/json
```

```json
{
  "packageEsimId": "e693b396-3507-4f32-8604-4352418ddc15"
}
```

| Body field      | Description                                                                                                       |
| --------------- | ----------------------------------------------------------------------------------------------------------------- |
| `packageEsimId` | ID of the package-to-eSIM assignment. Obtain it from `packageEsims[].id` in the eSIM list with assigned packages. |

### Response

Simplified usage response:

```json
{
  "success": true,
  "errmsg": "",
  "package": {
    "package_status": "In Use",
    "status": "active",
    "rate_groups": [
      {
        "rate_group_allowance": 3,
        "rate_group_allow_qtyp": "GB",
        "rate_group_usage": 1.206621,
        "rate_group_starttime": "2026-10-14 15:40:55",
        "rate_group_expire": "2026-10-21 15:40:55",
        "rate_group_days_used": 5
      }
    ]
  }
}
```

| Response field                                | Description                                                   |
| --------------------------------------------- | ------------------------------------------------------------- |
| `success`                                     | Whether the usage request succeeded.                          |
| `errmsg`                                      | Error message when returned.                                  |
| `package.package_status`                      | Package usage status; `In Use` in this example.               |
| `package.status`                              | Technical assignment status; `active` in this example.        |
| `package.rate_groups[].rate_group_allowance`  | Total data allowance for the rate group.                      |
| `package.rate_groups[].rate_group_allow_qtyp` | Data unit; `GB` in this example.                              |
| `package.rate_groups[].rate_group_usage`      | Used data in the rate group’s unit.                           |
| `package.rate_groups[].rate_group_starttime`  | Package activation date and time reported for the rate group. |
| `package.rate_groups[].rate_group_expire`     | Package expiration date and time reported for the rate group. |
| `package.rate_groups[].rate_group_days_used`  | Number of usage days reported for the rate group.             |

### Remaining traffic

```
remaining = rate_group_allowance - rate_group_usage
3 - 1.206621 = 1.793379 GB
```

Calculate per relevant rate group and preserve its unit. Do not combine different units without conversion.

**Reporting delay:** usage is near real-time and may have a short mobile-network reporting delay.
