Skip to main content

GET Get Packages

This endpoint returns a paginated and filtered list of packages associated with the authenticated user.

Configure the API Endpoint

https://esim.betatel.com/api/v1/esim/packages
  • Method: GET

Set Up the Headers

ParamValueDescription
Content-Typeapplication/jsonSpecifies the payload format.
x-api-key{{x-api-key}}Your unique API key for secure access.
x-user-id{{x-user-id}}Your user identifier for added security and tracking.

Query Parameters

Tip: Utilize query parameters like 'status' for more focused search results within the packages, offering better filtering options.

ParamTypeRequiredDefaultDescription
countintegeroptional-Number of items to return
offsetintegeroptional-Number of items to skip
inventoryintegeroptional-Filter by inventory ID
package_templateintegeroptional-Filter by package template ID
simstringoptional-Filter by SIM ICCID
statusstringoptional-Filter by package status (NOT_ACTIVE, ACTIVE, SUSPENDED, TERMINATED)

Example Response

Status Code: 200 OK
Content-Type: application/json

Example Response
{
"total": 100,
"offset": 0,
"count": 20,
"packages": [
{
"id": "pkg_123456",
"sim": "89148000004012345678",
"package_template": 21145354,
"status": "ACTIVE",
"created_date": 1761330317000,
"activated_date": 1761330517000,
"expiry_date": 1763922517000
}
]
}

The response includes the total number of packages matching filters, current pagination offset, number of items returned, and an array of package objects.

Code Snippets

Info: These code snippets provide a quick way to interact with the API. Understand how the headers and parameters are constructed.

Example - cURL
curl --location 'https://esim.betatel.com/api/v1/esim/packages?offset=0&count=20' \
--header 'Accept: application/json' \
--header 'x-api-key: {{x-api-key}}' \
--header 'x-user-id: {{x-user-id}}'

Error Handling

Important: Pagination parameter errors, such as setting an invalid count or offset, will return a '400' status code.

  • 400 - Bad Request - Invalid pagination parameters