Add new Subscription
The Orders API allows organizations to self-manage their subscriptions by provisioning new eSIM profiles based on templates containing predefined bundle of services (data, voice, SMS, recording settings, etc). These templates are tailored to each account and must be obtained direcly from the Support Delivery Manager.
Two eSIM delivery methods are currreny available:
- Email Delivery: The QR code is sent via email directly to the specified email recipients.
- QR Code Retrieval: The QR code is generated and must be retrieved via a separate API call.
Submit an Order
To initate the subscription suspension, send a HTTP POST request to the endpoint below:
POST https://api.1global.com/enterprise/orders
Ensure the request includes the following headers:
- Authorization: Bearer token obtained via the Authentication process.
- Content-Type: application/json.
For more details on setting up the headers, refer to Making Your First Request.
Option 1: Email Delivery
For this delivery method the delivery.type
must be "email".
{
"type": "activate_subscription",
"account_id": "acc_00DKABCDE12ECXW8AYBVBTEST",
"template_id": "otpl_A00ABCDRT1F00AVRPTAQ5XTEST",
"subscriber": {
"first_name": "John",
"last_name": "Jordan",
"email": "j.jordan@star-industries.com",
"employee_id": "12345",
"group": "finance"
},
"sim_profile": {
"sim_type": "esim",
"delivery": {
"type": "email",
"to": ["j.jordan@star-industries.com"],
"cc": ["a.peterson@star-industries.com"]
}
}
}
Option 2: QR Code Only (API Retrieval)
For this delivery method, the delivery.type
must be "api".
{
"type": "activate_subscription",
"account_id": "acc_00DKABCDE12ECXW8AYBVBTEST",
"template_id": "otpl_A00ABCDRT1F00AVRPTAQ5XTEST",
"subscriber": {
"first_name": "John",
"last_name": "Jordan",
"email": "j.jordan@star-industries.com",
"employee_id": "12345",
"group": "finance"
},
"sim_profile": {
"sim_type": "esim",
"delivery": {
"type": "api"
}
}
}
API Response
Upon successful submission on both cases, the API returns an Order ID and the status pending, indicating that the order processing has begun.
Example Response - Email Delivery
{
"id": "order_01HZS5KETGM8XXF53WZJWDTEST",
"status": "pending",
"type": "activate_subscription",
"account_id": "acc_00DKABCDE12ECXW8AYBVBTEST",
"template_id": "otpl_A00ABCDRT1F00AVRPTAQ5XTEST",
"subscriber": {
"first_name": "John",
"last_name": "Jordan",
"email": "j.jordan@star-industries.com",
"employee_id": "12345",
"group": "finance"
},
"sim_profile": {
"sim_type": "esim",
"delivery": {
"type": "email",
"to": ["j.jordan@star-industries.com"],
"cc": ["a.peterson@star-industries.com"]
}
},
"_links": {
"self": {
"href": "https://api.staging.1global.com/ordering/orders/orders/order_01HZS5KETGM8XXF53WZJWDTEST"
}
}
}
Monitor Order Status
Due to asynchronous processing, implement periodic polling to check the order status until it reaches a final state: completed or cancelled.
Send a GET request to check the current status of the order:
GET https://api.1global.com/enterprise/orders/{order_Id}
Replace order_Id
with the unique order ID received from the initial response (e.g., order_01HZS5KETGM8XXF53WZJWDTEST).
curl -X GET \
https://api.1global.com/enterprise/orders/order_01HZS5KETGM8XXF53WZJWDTEST\
-H 'Authorization: Bearer $ACCESS_TOKEN' \
-H 'Content-Type: application/json'
Continue polling the order status periodically. When the status changes to completed, provisioning is finished.
Example Response - Email Delivery
{
"id": "order_01HZS5KETGM8XXF53WZJWDTEST",
"status": "completed",
"type": "activate_subscription",
"account_id": "acc_00DKABCDE12ECXW8AYBVBTEST",
"subscription_id": "sub_01DRGT6VG8C79TX5CW1W9696X9",
"subscriber": {
"id": "sbr_01009SHB00WDFA5VT2JTMETEST",
"first_name": "John",
"last_name": "Jordan",
"email": "j.jordan@star-industries.com",
"employee_id": "12345",
"group": "finance"
},
"sim_profile": {
"sim_type": "esim",
"iccid": "0123478100000700000",
"delivery": {
"type": "email",
"to": ["j.jordan@star-industries.com"],
"cc": ["a.peterson@star-industries.com"]
}
},
"phone_numbers": [
{
"msisdn": "123456789",
"is_primary": "true",
"country": "US"
},
{
"msisdn": "001234321",
"is_primary": "false",
"country": "UK"
}
],
"_links": {
"self": {
"href": "https://api.staging.1global.com/ordering/orders/orders/order_01HZS5KETGM8XXF53WZJWDDV4C"
}
}
}
Example Response - QR Code (API Retrieval)
{
"id": "order_01HZS5KETGM8XXF53WZJWDTEST",
"type": "activate_subscription",
"account_id": "acc_00DKABCDE12ECXW8AYBVBTEST",
"status": "completed",
"subscriber": {
"first_name": "Test",
"last_name": "Session",
"email": "byte@size.com",
"employee_id": "",
"group": ""
},
"sim_profile": {
"sim_type": "esim",
"delivery": {
"type": "api"
}
},
"subscription_id": "sub_01AA111122222222233333444444",
"_links": {
"esim_qr_code": {
"href": "https://api.1global.com/enterprise/qr-codes/qr_0000000001111111AAAAAAABBBB"
},
"self": {
"href": "https://api.1global.com/enterprise/orders/order_0000000001111111AAAAAAABBBB"
}
}
}
For the API Delivery method, retrieve the QR code by calling:
GET https://api.1global.com/enterprise/qr-codes/{qr_code_id}
Replace the qr_code_id
with the ID from the response.
Although not likely to happen, the status cancelled exists to accomodate any unforseen event that makes it impossible to fulfill your request. Your Service Delivery Manager will be able to provide you additional info.