Orders
Create eSIM Order
To create an eSIM order, you need to send a POST
request to the /api/esim/order
endpoint.
You are required to provide the following parameters in the request body:
items
: An array of eSIM items you want to order. Each item should contain the following details:packageId
: The ID of the eSIM package you want to order. This is a required field of typestring
.quantity
: The quantity of the eSIM package you want to order. This is a required field of typenumber
.
Example
Here is an example of how you can create an eSIM order using Roamify eSIM API.
curl --request POST \
--url 'https://api-dev.getroamify.com/api/esim/order' \
--header 'Authorization: Bearer Access Token' \
--header 'Content-Type: application/json' \
--data '{
"items": [
{
"packageId": "Package ID",
"quantity": 1
}
]
}'
Sample Response
{
"status": "success",
"data": {
"id": "67bbabb7-e893-410a-b0a8-4fa62d347b6c",
"orderType": "api",
"status": "COMPLETED",
"total": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539,
"items": [
{
"esimId": "b06036c5-eadc-4f88-aa31-8c207fec91ec",
"packageId": "esim-cambodia-7days-1gb-all",
"package": "1 GB - 7 Days",
"type": "esim",
"price": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539
}
]
}
}
Create Top-up Order
To create a top-up order, you need to send a POST
request to the /api/esim/order/topup
endpoint.
You are required to provide the following parameters in the request body:
iccid
: The ICCID of the eSIM you want to top-up. This is a required field of typestring
.packageId
: The ID of the eSIM package you want to top-up. This is a required field of typestring
.
Example
Here is an example of how you can create a top-up order using Roamify eSIM API.
curl --request POST \
--url 'https://api-dev.getroamify.com/api/esim/order/topup' \
--header 'Authorization: Bearer Access Token' \
--header 'Content-Type: application/json' \
--data '{
"iccid": "ICCID",
"packageId": "Package ID"
}'
Sample Response
{
"status": "success",
"data": {
"id": "0501aef3-7cf1-4b4c-a293-c03a6bd7a8ab",
"orderType": "api",
"status": "COMPLETED",
"total": 5,
"currency": "USD",
"createdAt": 1731838277,
"updatedAt": 1731838280,
"items": [
{
"esimId": "22dcdb84-968b-415c-bb70-79e2f3ffc296",
"packageId": "esim-cambodia-7days-1gb-all",
"package": "1 GB - 7 Days",
"type": "esim",
"price": 5,
"currency": "USD",
"createdAt": 1731838277,
"updatedAt": 1731838280
}
]
}
}
Get eSIM Order
To get a specific eSIM order, you need to send a GET
request to the /api/esim/order
endpoint.
You are required to provide the following parameters in the parameters:
orderId
: The ID of the eSIM order you want to retrieve. This is a required field of typestring
.
Example
Here is an example of how you can get a specific eSIM order using Roamify eSIM API.
curl --request GET \
--url 'https://api-dev.getroamify.com/api/esim/order?orderId=Order ID' \
--header 'Authorization: Bearer Access Token' \
--header 'Content-Type: application/json'
Sample Response
{
"status": "success",
"data": {
"id": "67bbabb7-e893-410a-b0a8-4fa62d347b6c",
"orderType": "api",
"status": "COMPLETED",
"total": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539,
"items": [
{
"esimId": "b06036c5-eadc-4f88-aa31-8c207fec91ec",
"packageId": "esim-cambodia-7days-1gb-all",
"package": "1 GB - 7 Days",
"type": "esim",
"price": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539
}
]
}
}
Get eSIM Orders
To get a list of eSIM orders, you need to send a GET
request to the /api/esim/orders
endpoint.
There are no required parameters for this endpoint, but you can provide the following optional parameters:
-
status
: The status of the eSIM orders. This is an optional field of typestring
. It can be any of the following values:PENDING
: Pending ordersCOMPLETED
: Completed ordersARCHIVED
: Archived ordersCANCELLED
: Cancelled ordersREFUNDED
: Refunded ordersREQUIRE_ACTION
: Orders that require action
-
limit
: The number of eSIM orders to return. This is an optional field of typenumber
. The default value is50
.
Example
Here is an example of how you can get a list of eSIM orders using Roamify eSIM API.
curl --request GET \
--url 'https://api-dev.getroamify.com/api/esim/orders?status=PENDING&limit=10' \
--header 'Authorization: Bearer Access Token' \
--header 'Content-Type: application/json'
Sample Response
{
"status": "success",
"data": {
"orders": [
{
"id": "67bbabb7-e893-410a-b0a8-4fa62d347b6c",
"orderType": "api",
"status": "COMPLETED",
"total": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539,
"items": [
{
"esimId": "b06036c5-eadc-4f88-aa31-8c207fec91ec",
"packageId": "esim-cambodia-7days-1gb-all",
"package": "1 GB - 7 Days",
"type": "esim",
"price": 5,
"currency": "USD",
"createdAt": 1731837535,
"updatedAt": 1731837539
}
]
}
]
}
}