Documentación de la API
Referencia de la API de iRoamly Shop: autenticación, planes, compra y entrega, renovación y consumo.
Explicación básica
Para garantizar la seguridad de la información transmitida por el servidor, se aplican los siguientes mecanismos de seguridad:
- 1.Todas las interfaces usan conexiones
HTTPS secure. - 2.AuthKey asignada, usada para la autenticación en la API (longitud máxima: 32 caracteres).
- 3.AuthSecret asignada, usada para generar el hash de la solicitud (longitud máxima: 50 caracteres).
- 4.Las solicitudes usan hashes SHA-256 para la autenticación.
Estándares de la interfaz
https://api.iroamly.shop/HTTPSGET / POSTapplication/jsonParámetros del header de la solicitud:
AuthKey: clave de autenticación del cliente, tipo cadena (String)
Certification: cadena con el hash SHA-256 de AuthKey+AuthSecret concatenados en ese orden.
/common/getPlanItem no requiere el header AuthKey ni Certification.
Obtener la lista de planes regionales
https://api.iroamly.shop/common/getPlanItemGETNo se requiere el header AuthKey ni Certification.
Parámetros de la solicitud:
Formato de la respuesta:
Éxito: HTTP 200. Los planes se devuelven en data.list.
Siempre devuelve HTTP 200. Cuando no hay datos, data.list es un array vacío y msg es Success.
Descripción de los campos de la respuesta:
"https://api.iroamly.shop/common/getPlanItem?region=US"{
"code": 0,
"data": {
list:[
{
"plan": "United States-eSIM-10GB-10 Days-Total",
"productCode": "iRoamly-unite-584535",
"data": "10GB",
"type": "Total",
"package_type": "Data Only",
"duration": "10",
"speed": "4G / 5G",
"operator": "T-Mobile/AT&T",
"region": "United States",
"region_index": "united-states",
"credit": 6.43,
"remark": "After accumulating 10GB, the speed will be reduced to 128 Kbps",
"created_at": "2025-05-16T04:02:31Z"
}
]
}
}Compra directa de código QR
https://api.iroamly.shop/openapi/purchaseqrcodePOSTParámetros de la solicitud:
Campos de productList:
iRoamly-Test-10GBSiguiente paso: usa Query QR Code (https://api.iroamly.shop/openapi/qrcodeQuery) para obtener el código QR
{
"email": "2m827n32d@gmail.com",
"productList": [
{
"plan": "United States-eSIM-10GB-10 Days-Total",
"quantity": 2
},
{
"plan": "Albania-10GB-15 Days-Total",
"quantity": 1
}
]
}{
"code": 1,
"data": {
"orderId": "Open-Global-DXDWFBKG578913",
"redeem_list": [
{
"productCode": "",
"plan": "United States-eSIM-10GB-10 Days-Total",
"redeemCode": "tjMxpYfvk5dFMQg",
"status": 0,
"expire_at": "2026-03-01"
},
{
"productCode": "",
"plan": "United States-eSIM-10GB-10 Days-Total",
"redeemCode": "gKPzYhseX1wRmSi",
"status": 0,
"expire_at": "2026-03-01"
},
{
"productCode": "",
"plan": "Albania-10GB-15 Days-Total",
"redeemCode": "sLSHNkAv2ojbNBG",
"status": 0,
"expire_at": "2026-03-01"
}
]
},
"msg": "success"
}Comprar código de canje
https://api.iroamly.shop/openapi/purchaseCodePOSTParámetros de la solicitud:
Campos de productList:
iRoamly-Test-10GB{
"email": "2m827n32d@gmail.com",
"productList": [
{
"plan": "United States-eSIM-10GB-10 Days-Total",
"quantity": 2
},
{
"plan": "Albania-10GB-15 Days-Total",
"quantity": 1
}
]
}{
"code": 1,
"msg": "success",
"orderId": "xxx-xxxx-sd9hn8df333" // Order number, can be used to query redeem code
}Consultar código de canje
https://api.iroamly.shop/openapi/codeQueryPOSTParámetros de la solicitud:
{
"orderId": "xxx-xxx-dh239jdu28",
}{
"code": 1,
"msg": "success",
"data": [
{
"productCode": "m8hed7h2fed",
"redeemCode": "3cd2m3f23f3f3",
"expire_at": "2024-06-30", // Expiry date
"plan": "United States-eSIM-10GB-10 Days-Total",
"status": 0
},
{
"productCode": "v2jf28dj2w",
"redeemCode": "d923j29ef2323",
"expire_at": "2024-06-30",
"plan": "Albania-10GB-15 Days-Total",
"status": 2
}
]
}Convertir en código QR
(Nota: los códigos QR se envían al correo indicado tras la conversión. Los lotes más grandes pueden tardar más en procesarse.)
https://api.iroamly.shop/openapi/redeemQRcodePOSTParámetros de la solicitud:
Campos de productList:
{
"email": "2m827n32d@gmail.com",
"codeList": [
{
"redeemCode": "m8hed7h2fed",
},
{
"redeemCode": "cn88beg9edj",
}
]
}{
"code": 1,
"msg": "success",
}Consultar código QR
https://api.iroamly.shop/openapi/qrcodeQueryPOSTParámetros de la solicitud:
Descripción de los campos de la respuesta:
{
"redeemCode": "m8hed7h2fed",
}{
"code": 1,
"msg": "success",
"redeemCode": "m8hed7h2fed",
"qrcode": "https://dsfjigewafe/qrcode.jpg"
}Obtener el estado de los planes de renovación
https://api.iroamly.shop/openapi/getRenewPlanStatusPOSTParámetros de la solicitud:
Descripción de los campos de la respuesta:
El code de nivel superior de la respuesta indica si el código de canje se puede renovar: 0 - renovación posible, -1 - renovación no posible. Las opciones de renovación se enumeran en data.renewList:
{
"redeemCode": "3cd2m3f23f3f3",
}{
"code": 0,
"data": {
"renewList": [
{
"renewtype": 1,
"starttime": "0001-01-01T00:00:00Z",
"endtime": "0001-01-01T00:00:00Z"
},
{
"renewtype": 2,
"starttime": "2025-08-04 06:13:08",
"endtime": "2025-09-20 14:23:51"
}
],
"lasttime": "0001-01-01T00:00:00Z"
},
"msg": "Success"
}Código de renovación
(Nota: al renovar, el grupo de renovación del plan seleccionado debe coincidir con el grupo de renovación del plan original.)
https://api.iroamly.shop/openapi/renewcodePOSTParámetros de la solicitud:
{
redeemCode: "DEF456UVW",
plan: "basic_yearly",
renewtype: 0,
renewtime: "2024-12-31T23:59:59Z"
}{
code: 1,
data: {
orderId: "Open-Global-DXDWFBKG578913",
plan: "United States-eSIM-10GB-10 Days-Total",
redeemCode: "tjMxpYfvk5dFMQg",
status: 0,
expire_at: "2026-03-01"
},
msg: "success"
}Obtener estadísticas del plan
https://api.iroamly.shop/openapi/getnetworkflowGETParámetros de la solicitud:
Descripción de los campos de la respuesta:
{
code: 1,
status: 0,
flow_use: "300",
flow_total: "1024",
start_data: "2025-10-25T15:04:05Z07:00",
end_data: "2025-11-25T15:04:05Z07:00",
installDevice: "iPhone 15",
installCount: "1",
installTime: "2025-10-25T15:04:05Z06:00"
}{
code: -1,
msg: "error message"
}Definiciones de los códigos de estado de la respuesta
El éxito es code 1, excepto en /common/getPlanItem y /openapi/getRenewPlanStatus, que devuelven code 0 si tienen éxito.
Definiciones de estados del código de canje
Comprar código de canje (Python)
import requests
import json
import hashlib
# URL for the request
url = "https://api.iroamly.shop/openapi/purchaseCode"
# Provided AuthKey and AuthSecret, remember to replace them with real values
auth_key = "YOUR_AUTH_KEY_HERE"
auth_secret = "YOUR_AUTH_SECRET_HERE"
# Calculating Certification
combined = auth_key + auth_secret
certification = hashlib.sha256(combined.encode()).hexdigest()
# Header parameters for the request
headers = {
"Content-Type": "application/json",
"AuthKey": auth_key,
"Certification": certification
}
# Example data for the request body
data = {
"email": "2m827n32d@gmail.com",
"productList": [
{
"productCode": "m8hed7h2fed2398dsnh",
"quantity": 2
},
{
"productCode": "cn88beg9edjdfj2sj0a",
"quantity": 1
}
]
}
# Sending POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Printing the response content
print(response.text)
# Example of response
{
"code":1,
"msg":"success",
"orderId":"xxx-xxxx-sd9hn8df333"
}
Consultar código de canje (Python)
import requests
import json
import hashlib
# URL for the request
url = "https://api.iroamly.shop/openapi/codeQuery"
# Provided AuthKey and AuthSecret, remember to replace them with real values
auth_key = "YOUR_AUTH_KEY_HERE"
auth_secret = "YOUR_AUTH_SECRET_HERE"
# Calculating Certification
combined = auth_key + auth_secret
certification = hashlib.sha256(combined.encode()).hexdigest()
# Header parameters for the request
headers = {
"Content-Type": "application/json",
"AuthKey": auth_key,
"Certification": certification
}
# Example data for the request body
data = {
"orderId":"xxx-xxx-dh239jdu28"
}
# Sending POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Printing the response content
print(response.text)
# Example of response
{
"code":1,
"data":
[
{"productCode":"m8hed7h2fed2398dsnh","redeemCode":"nDb4TDCn6vMhbQv","status":0,"expire_at":"2024-07-04"},
{"productCode":"m8hed7h2fed2398dsnh","redeemCode":"oA7AWAmo76BwoGj","status":0,"expire_at":"2024-07-04"},
{"productCode":"cn88beg9edjdfj2sj0a","redeemCode":"XRdDeSxBVNbvCpU","status":0,"expire_at":"2024-07-04"}
],
"msg":"success"
}Convertir en código QR (Python)
import requests
import json
import hashlib
# URL for the request
url = "https://api.iroamly.shop/openapi/redeemQRcode"
# Provided AuthKey and AuthSecret, remember to replace them with real values
auth_key = "YOUR_AUTH_KEY_HERE"
auth_secret = "YOUR_AUTH_SECRET_HERE"
# Calculating Certification
combined = auth_key + auth_secret
certification = hashlib.sha256(combined.encode()).hexdigest()
# Header parameters for the request
headers = {
"Content-Type": "application/json",
"AuthKey": auth_key,
"Certification": certification
}
# Example data for the request body
data = {
"email": "2m827n32d@gmail.com",
"codeList": [
{
"redeemCode": "nDb4TDCn6vMhbQv",
},
{
"redeemCode": "XRdDeSxBVNbvCpU",
}
]
}
# Sending POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Printing the response content
print(response.text)
# Example of response
{"code":1,"msg":"success"}
Consultar código QR (Python)
import requests
import json
import hashlib
# URL for the request
url = "https://api.iroamly.shop/openapi/qrcodeQuery"
# Provided AuthKey and AuthSecret, remember to replace them with real values
auth_key = "YOUR_AUTH_KEY_HERE"
auth_secret = "YOUR_AUTH_SECRET_HERE"
# Calculating Certification
combined = auth_key + auth_secret
certification = hashlib.sha256(combined.encode()).hexdigest()
# Header parameters for the request
headers = {
"Content-Type": "application/json",
"AuthKey": auth_key,
"Certification": certification
}
# Example data for the request body
data = {
"redeemCode":"XRdDeSxBVNbvCpU"
}
# Sending POST request
response = requests.post(url, headers=headers, data=json.dumps(data))
# Printing the response content
print(response.text)
# Example of response
{
"code":1,
"qrcode":"https:/code.tokyoesim.com/20231220/1703048857317.65625d0a779f4598d55d77bda43ecd80.png",
"msg":"success",
"redeemCode":"XRdDeSxBVNbvCpU"
}