本文へスキップ
iRoamly Shop

API ドキュメント

iRoamly Shop API のリファレンス: 認証、プラン、購入と配信、更新、使用状況。

概要

基本説明

サーバー間で送受信する情報の安全性を確保するため、次のセキュリティ機構を採用しています:

  1. 1.すべてのインターフェースは HTTPS secure の安全な接続で通信します。
  2. 2.API 認証に使用する、割り当てられた AuthKey(最大 32 文字)。
  3. 3.リクエストハッシュの生成に使用する、割り当てられた AuthSecret(最大 50 文字)。
  4. 4.リクエストの認証には SHA-256 ハッシュを使用します。
概要

インターフェース仕様

ベースパス:https://api.iroamly.shop/
リクエストプロトコル:HTTPS
リクエストメソッド:GET / POST
データ転送形式:application/json

リクエストヘッダーのパラメーター:

AuthKey: 顧客認証キー、型は文字列(String)

Certification: AuthKey+AuthSecret をこの順で連結した値の SHA-256 ハッシュを含む文字列。

/common/getPlanItem には AuthKey および Certification ヘッダーは不要です。

API エンドポイント

Get Regional Plan List(地域別プラン一覧の取得)

リクエスト URL:https://api.iroamly.shop/common/getPlanItem
リクエストメソッド:GET

AuthKey および Certification ヘッダーは不要です。

リクエストパラメーター:

パラメーター説明型
regionISO2 コード、国名(大文字・小文字を区別しない)、または標準化された形式(例: united-states)を指定できます。String

レスポンス形式:

成功時: HTTP 200。プランは data.list で返されます。

常に HTTP 200 を返します。データがない場合、data.list は空の配列、msg は Success になります。

レスポンスフィールドの説明:

フィールド説明型
planプラン名(地域、種類、データ容量、期間を含む)。String
productCode購入や照会に使用する一意のプラン ID。String
dataデータ容量(例: 10GB、Unlimited、500MB)。String
typeプランの種類(例: Total、Daily、Unlimited)。String
plan_typeプランのカテゴリー(例: default)。String
package_typeパッケージの種類(例: Data Only)。String
duration有効期間(日数、例: 10)。String
speedネットワーク速度(例: 4G / 5G)。String
operator対応通信事業者(例: T-Mobile/AT&T)。String
region正式な地域名(例: United States)。String
region_index標準化された地域識別子(小文字とハイフン、例: united-states)。String
creditプランの価格(単位はクレジット。米ドルではありません)。Float
remark補足事項(例: 速度制限のルール)。String
created_atプランの作成日時(ISO 8601 形式)。String
リクエスト例
"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"
     }
    ]
  }
}
API エンドポイント

QR コードの直接購入

リクエスト URL:https://api.iroamly.shop/openapi/purchaseqrcode
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
emailQR コードを受け取るメールアドレス。空の場合、メールは送信されません。String
productList商品のコレクションObject[]

productList のフィールド:

フィールド説明型
planプラン名。plan または productCode のいずれかを指定してください。String
productCodeプラン ID(Get Regional Plan List の productCode)。productCode または plan のいずれかを指定してください。String
quantity数量Int
テストプラン: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"
}
API エンドポイント

引き換えコードの購入

リクエスト URL:https://api.iroamly.shop/openapi/purchaseCode
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
emailメールアドレスString
productList商品のコレクションObject[]

productList のフィールド:

フィールド説明型
planプラン名。plan または productCode のいずれかを指定してください。String
productCodeプラン ID(Get Regional Plan List の productCode)。productCode または plan のいずれかを指定してください。String
quantity数量Int
テストプラン: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
}
API エンドポイント

引き換えコードの照会

リクエスト URL:https://api.iroamly.shop/openapi/codeQuery
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
orderId注文番号String
パラメーター例
{
  "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
    }
  ]
}
API エンドポイント

QR コードに変換

(注: 変換後、QR コードは指定したメールアドレスに送信されます。数が多いほど処理に時間がかかる場合があります。)

リクエスト URL:https://api.iroamly.shop/openapi/redeemQRcode
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
emailメールアドレスString
codeList引き換えコードのコレクションObject[]

productList のフィールド:

フィールド説明型
redeemCode引き換えコードString
パラメーター例
{
  "email": "2m827n32d@gmail.com",
  "codeList": [
    {
      "redeemCode": "m8hed7h2fed",
    },
    {
      "redeemCode": "cn88beg9edj",
    }
  ]
}
レスポンス例
{
  "code": 1,
  "msg": "success",
}
API エンドポイント

QR コードの照会

リクエスト URL:https://api.iroamly.shop/openapi/qrcodeQuery
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
redeemCode引き換えコードString

レスポンスフィールドの説明:

フィールド説明型
redeemCode引き換えコードString
qrcodeQR コード画像の URLString
status引き換えコードのステータス(引き換えコードのステータス定義を参照)Int
qrcode_contentQR コードの内容(LPA アクティベーション文字列、例: LPA:1$…)String
iscouldrenewaleSIM を更新できるかどうか: 1 - 更新可能 0 - 更新不可Int
パラメーター例
{
  "redeemCode": "m8hed7h2fed",
}
レスポンス例
{
  "code": 1,
  "msg": "success",
  "redeemCode": "m8hed7h2fed",
  "qrcode": "https://dsfjigewafe/qrcode.jpg"
}
API エンドポイント

更新プランのステータス取得

リクエスト URL:https://api.iroamly.shop/openapi/getRenewPlanStatus
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
redeemCode引き換えコードString

レスポンスフィールドの説明:

レスポンスのトップレベルの code は、引き換えコードを更新できるかどうかを示します: 0 - 更新可能、-1 - 更新不可。更新オプションは data.renewList に一覧表示されます:

フィールド説明型
renewtype更新の種類: 0 - 現在のプランの有効期限が切れたときに有効化 1 - 即時有効化(残りのデータは消去されます) 2 - 指定した日時に有効化Int
starttime有効化を選択できる期間の開始: 選択できる最も早い有効化日時(更新の種類 2)。String
endtime有効化を選択できる期間の終了: 選択できる最も遅い有効化日時(更新の種類 2)。String
パラメーター例
{
  "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"
}
API エンドポイント

コードの更新

(注: 更新時は、選択したプランの更新グループが元のプランの更新グループと一致している必要があります。)

リクエスト URL:https://api.iroamly.shop/openapi/renewcode
リクエストメソッド:POST

リクエストパラメーター:

パラメーター説明型
redeemCode更新が必要なコードString
plan更新プランString
renewtype更新の種類: 0 - 現在のプランの有効期限が切れたときに有効化 1 - 即時有効化(残りのデータは消去されます) 2 - 指定した日時に有効化Int
renewtime有効になる日時(必須)。形式: YYYY-MM-DDTHH:mm:ssZString
パラメーター例
{
  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"
}
API エンドポイント

プラン統計の取得

リクエスト URL:https://api.iroamly.shop/openapi/getnetworkflow
リクエストメソッド:GET

リクエストパラメーター:

パラメーター説明型
redeemCode照会する引き換えコード。String

レスポンスフィールドの説明:

パラメーター説明型
status0 - 未有効化 1 - 有効 2 - 期限切れ 9 - 無効Int
flow_use請求サイクル内のデータ使用量(MB 単位)String
flow_total請求サイクル内のデータ総量(MB 単位、または unlimited)String
start_dataプランの開始日時String
end_dataプランの終了日時String
installDeviceインストールされた端末String
installCountインストール回数String
installTimeインストール日時String
有効な例
{
  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"
}
定義

レスポンスステータスコードの定義

コード説明
1成功
2リクエストパラメーターの認証に失敗しました
3パラメーターが要件どおりに指定されていません
4商品コードが存在しません
5クレジットが不足しています
6引き換えコードが存在しません
7引き換えコードは引き換え済みか、存在しません
-1リクエストに失敗しました

成功時の code は 1 です。ただし、/common/getPlanItem と /openapi/getRenewPlanStatus は成功時に code 0 を返します。

定義

引き換えコードのステータス定義

ステータス説明
0未引き換え
1引き換え中
2引き換え済み
3引き換え失敗
コードリファレンス

引き換えコードの購入(Python)

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)

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)

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)

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"
}