وثائق API
مرجع iRoamly Shop API: المصادقة، والباقات، والشراء والتسليم، والتجديد والاستخدام.
شرح أساسي
لضمان أمان المعلومات المنقولة عبر الخادم، تُعتمد آليات الأمان التالية:
- 1.تتصل جميع الواجهات عبر روابط
HTTPS secureآمنة. - 2.مفتاح AuthKey المخصّص لك، ويُستخدم لمصادقة API (الحد الأقصى للطول: 32 حرفًا).
- 3.مفتاح AuthSecret المخصّص لك، ويُستخدم لإنشاء تجزئة الطلب (الحد الأقصى للطول: 50 حرفًا).
- 4.تستخدم الطلبات تجزئات SHA-256 للمصادقة.
معايير الواجهة
https://api.iroamly.shop/HTTPSGET / POSTapplication/jsonمعلمات ترويسة الطلب:
AuthKey: مفتاح مصادقة العميل، من النوع سلسلة نصية (String)
Certification: سلسلة (String) تحتوي على تجزئة SHA-256 لـ AuthKey+AuthSecret مدمجَين بهذا الترتيب.
لا تتطلب /common/getPlanItem ترويسة AuthKey أو Certification.
الحصول على قائمة الباقات الإقليمية
https://api.iroamly.shop/common/getPlanItemGETلا يلزم وجود ترويسة AuthKey أو Certification.
معلمات الطلب:
تنسيق الاستجابة:
النجاح: HTTP 200. تُعاد الباقات في data.list.
يُرجع دائمًا HTTP 200. عند عدم توفر بيانات، تكون data.list مصفوفة فارغة وتكون msg هي Success.
أوصاف حقول الاستجابة:
"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"
}
]
}
}الشراء المباشر لرمز QR
https://api.iroamly.shop/openapi/purchaseqrcodePOSTمعلمات الطلب:
حقول productList:
iRoamly-Test-10GBالخطوة التالية: استخدم Query QR Code (https://api.iroamly.shop/openapi/qrcodeQuery) للحصول على رمز 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"
}شراء رمز استرداد
https://api.iroamly.shop/openapi/purchaseCodePOSTمعلمات الطلب:
حقول 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
}الاستعلام عن رمز الاسترداد
https://api.iroamly.shop/openapi/codeQueryPOSTمعلمات الطلب:
{
"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
}
]
}التحويل إلى رمز QR
(ملاحظة: تُرسَل رموز QR إلى عنوان البريد الإلكتروني المحدد بعد التحويل. قد تستغرق الدفعات الأكبر وقتًا أطول للمعالجة.)
https://api.iroamly.shop/openapi/redeemQRcodePOSTمعلمات الطلب:
حقول productList:
{
"email": "2m827n32d@gmail.com",
"codeList": [
{
"redeemCode": "m8hed7h2fed",
},
{
"redeemCode": "cn88beg9edj",
}
]
}{
"code": 1,
"msg": "success",
}الاستعلام عن رمز QR
https://api.iroamly.shop/openapi/qrcodeQueryPOSTمعلمات الطلب:
أوصاف حقول الاستجابة:
{
"redeemCode": "m8hed7h2fed",
}{
"code": 1,
"msg": "success",
"redeemCode": "m8hed7h2fed",
"qrcode": "https://dsfjigewafe/qrcode.jpg"
}الحصول على حالة باقة التجديد
https://api.iroamly.shop/openapi/getRenewPlanStatusPOSTمعلمات الطلب:
أوصاف حقول الاستجابة:
يوضح code في المستوى الأعلى من الاستجابة ما إذا كان يمكن تجديد رمز الاسترداد: 0 - التجديد ممكن، -1 - التجديد غير ممكن. تُدرج خيارات التجديد في 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"
}رمز التجديد
(ملاحظة: عند التجديد، يجب أن تتطابق مجموعة التجديد للباقة المحددة مع مجموعة التجديد للباقة الأصلية.)
https://api.iroamly.shop/openapi/renewcodePOSTمعلمات الطلب:
{
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"
}الحصول على إحصاءات الباقة
https://api.iroamly.shop/openapi/getnetworkflowGETمعلمات الطلب:
أوصاف حقول الاستجابة:
{
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"
}تعريفات رموز حالة الاستجابة
النجاح هو code 1، باستثناء /common/getPlanItem و/openapi/getRenewPlanStatus اللتين تُرجعان code 0 عند النجاح.
تعريفات حالات رمز الاسترداد
شراء رمز استرداد (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"
}
الاستعلام عن رمز الاسترداد (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"
}التحويل إلى رمز 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"}
الاستعلام عن رمز 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"
}