{
  "openapi": "3.1.0",
  "info": {
    "title": "Mobilexy Reseller API",
    "version": "1.0.0",
    "description": "Reseller API for buying and managing eSIMs (fixed plans, pay-as-you-go and Global PAYG) and virtual numbers.\n\n## Authentication\nEvery authenticated call identifies you with your **API key**, found in your dashboard under API settings.\n\n* Pass it as the `api_key` parameter, in the query string or in the request body (form or JSON).\n* PAYG (`/payg/*`), Global PAYG (`/payg-global/*`) and virtual-number endpoints also accept it as a bearer token:\n  `Authorization: Bearer <api_key>`.\n* Catalogue endpoints (`/coverage/*`, `/country-plans/*`, `/region-plans/*`, `/global-plans`, `/plan/{id}`) work without a key\n  and then show retail prices; send your key to see your own rate.\n\nIf you issued several keys, the key you call with selects the wallet that pays (a secondary key spends its own sub-balance)\nand, for PAYG products, your price tier.\n\n## Response envelope\nMost responses look like:\n\n```json\n{\"remark\": \"order_completed\", \"status\": \"success\", \"message\": {\"success\": [\"...\"]}, \"data\": {...}}\n```\n\nErrors use `\"status\": \"error\"`, a machine-readable `remark` and `\"message\": {\"error\": [\"...\"]}`.\n**Errors are returned with HTTP 200**, so always check `status` and `remark`. Exceptions: an unknown plan id on\n`GET /plan/{id}` returns HTTP 404 with `{\"message\": \"...\"}`; `POST /profile/usage-check` returns the raw usage result\nwithout the envelope on success. While the platform is in maintenance every call returns the error remark `maintenance_mode`.\n\nCommon error remarks: `invalid_api_key`, `validation_error`, `insufficient_balance`, `not_available`, `order_failed`.\n\n## Money\nBalances and prices are in **XYC**: 1 XYC = 1 USD. Data volumes are binary (1 GiB = 1024 MiB = 1073741824 bytes).\n\n## Idempotency\nSend your own unique id on every purchase so a retry after a timeout cannot buy twice:\n`client_request_id` on `/plan/purchase`, `/payg/order`, `/payg/topup`, `/payg-global/order` (required) and\n`/payg-global/topup`; `transactionId` on `/profile/topup`; `client_transaction_id` on `/virtual-numbers/order`.\n\n## Rate limits\nGlobal PAYG: 120 requests per minute per API key (`too_many_requests`).\n"
  },
  "servers": [
    {
      "url": "https://mobilexy.com/api",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Catalog",
      "description": "Countries, regions and fixed data plans."
    },
    {
      "name": "Orders",
      "description": "Buy fixed-plan eSIMs and track orders."
    },
    {
      "name": "Profiles",
      "description": "Top up installed fixed-plan eSIMs and read their usage."
    },
    {
      "name": "PAYG",
      "description": "Pay-as-you-go eSIMs: credit on the eSIM, countries or regions switched on, data billed per MiB."
    },
    {
      "name": "Global PAYG",
      "description": "One eSIM for 200+ countries, credit-based, billed per MiB at the attached network's rate."
    },
    {
      "name": "Virtual numbers",
      "description": "SMS-capable virtual phone numbers."
    },
    {
      "name": "Account",
      "description": "Wallet balance."
    }
  ],
  "paths": {
    "/coverage/countries": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listCountries",
        "summary": "List countries",
        "description": "Featured countries that have at least one plan available to you, with the cheapest price at your rate. `api_key` is optional; without it retail prices are shown.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CountriesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "example": {
                  "remark": "countries",
                  "status": "success",
                  "message": {
                    "success": [
                      "Countries List"
                    ]
                  },
                  "data": {
                    "countries": [
                      {
                        "name": "Japan",
                        "slug": "japan",
                        "image": "JP.png",
                        "converted_price": 3.39
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/coverage/regions": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listRegions",
        "summary": "List regions",
        "description": "Regions (multi-country plan groups) with at least one plan available to you.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RegionsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/country-plans/{slug}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listCountryPlans",
        "summary": "Country plans",
        "description": "Plans for one country, cheapest first, priced at your rate.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Country slug from `/coverage/countries`.",
            "schema": {
              "type": "string",
              "examples": [
                "japan"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_country`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/CountryPlansResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/region-plans/{slug}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listRegionPlans",
        "summary": "Region plans",
        "description": "Plans for one region, each with its covered countries.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "description": "Region slug from `/coverage/regions`.",
            "schema": {
              "type": "string",
              "examples": [
                "asia-as-7"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_region`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/RegionPlansResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/global-plans": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "listGlobalPlans",
        "summary": "Global plans",
        "description": "Global plans with a country count. Use `GET /plan/{id}` for a plan's full country list. Cached up to 5 minutes per account.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalPlansResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plan/{id}": {
      "get": {
        "tags": [
          "Catalog"
        ],
        "operationId": "getPlan",
        "summary": "Plan details",
        "description": "One plan with the full list of countries it covers. Contains no price.",
        "security": [
          {},
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Plan ID.",
            "schema": {
              "type": "integer",
              "examples": [
                1117
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `maintenance_mode`. `validation_error` here means the plan could not be refreshed from the network.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PlanDetailsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          },
          "404": {
            "description": "No such plan, or not available to you.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/NotFound"
                }
              }
            }
          }
        }
      }
    },
    "/balance": {
      "post": {
        "tags": [
          "Account"
        ],
        "operationId": "getBalance",
        "summary": "Check balance",
        "description": "Spendable balance behind the calling key, in XYC (1 XYC = 1 USD).",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `invalid_api_key`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/BalanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/plan/purchase": {
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "purchasePlan",
        "summary": "Purchase a plan",
        "description": "Buys one eSIM for a fixed plan and charges the wallet behind the key. The call waits up to ~15 s for the profile. If it is ready the remark is `order_completed`; otherwise `order_pending` with `esim: null` — then poll `GET /plan/order/{order_number}`. If the network could not issue the eSIM the remark is `order_failed` (status `error`, `data` holds the order) and the amount is returned to your balance.\n\nSend `client_request_id` so a retry after a timeout returns the original order instead of buying again.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "plan_id": 1117,
                "client_request_id": "order-10294"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PurchaseRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "plan_id": 1117,
                "client_request_id": "order-10294"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `invalid_api_key`, `plan_not_found`, `insufficient_balance`, `order_failed`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OrderResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "examples": {
                  "completed": {
                    "summary": "eSIM ready",
                    "value": {
                      "remark": "order_completed",
                      "status": "success",
                      "message": {
                        "success": [
                          "Order completed successfully"
                        ]
                      },
                      "data": {
                        "order": {
                          "order_number": "ABCD1234EFGH",
                          "total_amount": "5.40000000",
                          "packageCode": "PKGEXAMPLE1",
                          "status": 1
                        },
                        "esim": {
                          "serial_number": null,
                          "iccid": "8900000000000000000",
                          "phone_number": "",
                          "qr_code": "LPA:1$smdp.example.com$EXAMPLECODE",
                          "qr_code_image": null,
                          "expiry_date": null,
                          "info": {
                            "pin": null,
                            "puk": null,
                            "apn": null,
                            "esimTranNo": "00000000000000"
                          }
                        }
                      }
                    }
                  },
                  "pending": {
                    "summary": "Still provisioning",
                    "value": {
                      "remark": "order_pending",
                      "status": "success",
                      "message": {
                        "success": [
                          "Order placed successfully. eSIM provisioning is in progress."
                        ]
                      },
                      "data": {
                        "order": {
                          "order_number": "ABCD1234EFGH",
                          "total_amount": "5.40000000",
                          "packageCode": "PKGEXAMPLE1",
                          "status": 0
                        },
                        "esim": null
                      }
                    }
                  },
                  "insufficient": {
                    "summary": "Not enough balance",
                    "value": {
                      "remark": "insufficient_balance",
                      "status": "error",
                      "message": {
                        "error": [
                          "Insufficient balance"
                        ]
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/plan/order/{order_number}": {
      "get": {
        "tags": [
          "Orders"
        ],
        "operationId": "getOrderStatus",
        "summary": "Order status",
        "description": "Returns the order and, when ready, its eSIM. Poll every 15-30 s until `order_completed`. `order_failed` means the order was cancelled and refunded.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "description": "Order number from the purchase response.",
            "schema": {
              "type": "string",
              "examples": [
                "ABCD1234EFGH"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `invalid_api_key`, `order_not_found`, `order_failed`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OrderResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Orders"
        ],
        "operationId": "getOrderStatusPost",
        "summary": "Order status (POST)",
        "description": "Same as the GET variant with `api_key` in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "parameters": [
          {
            "name": "order_number",
            "in": "path",
            "required": true,
            "description": "Order number from the purchase response.",
            "schema": {
              "type": "string",
              "examples": [
                "ABCD1234EFGH"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `invalid_api_key`, `order_not_found`, `order_failed`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/OrderResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/profile/topup": {
      "post": {
        "tags": [
          "Profiles"
        ],
        "operationId": "topupProfile",
        "summary": "Top up an installed eSIM",
        "description": "Adds a reloadable package to an existing eSIM. The package price at your rate is reserved from your wallet first and returned if the top-up fails. Retrying with the same `transactionId` does not charge twice.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ProfileTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "esimTranNo": "00000000000000",
                "packageCode": "PKGEXAMPLE1",
                "transactionId": "topup-5512"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProfileTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "esimTranNo": "00000000000000",
                "packageCode": "PKGEXAMPLE1",
                "transactionId": "topup-5512"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `validation_error`, `invalid_api_key`, `provider_inactive`, `topup_failed`, `insufficient_balance`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/ProfileTopupResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/profile/usage-check": {
      "post": {
        "tags": [
          "Profiles"
        ],
        "operationId": "checkUsage",
        "summary": "Usage check",
        "description": "Latest data usage (bytes) for up to 10 eSIMs. On success the body is the raw usage result, NOT the usual envelope. Errors use the envelope.",
        "security": [
          {
            "ApiKeyQuery": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/UsageCheckRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UsageCheckRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Raw usage result on success; error envelope (`validation_error`, `invalid_api_key`, `provider_inactive`, `usage_check_failed`, `maintenance_mode`) otherwise.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/UsageCheckResult"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/pricing": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygPricingGet",
        "summary": "PAYG pricing",
        "description": "What one PAYG eSIM costs you and what coverage comes switched on with it. Your rate is not the website rate.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygPricingResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygPricingPost",
        "summary": "PAYG pricing (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygPricingResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/countries": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygCountriesGet",
        "summary": "PAYG countries",
        "description": "Every country you can switch on, priced at your rate. Rates change; do not cache for long.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygCountriesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygCountriesPost",
        "summary": "PAYG countries (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygCountriesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/regions": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygRegionsGet",
        "summary": "PAYG regions",
        "description": "Regions: many countries behind one activation and one reserve. A region cannot be switched on while one of its countries is already active on the same eSIM.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygRegionsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygRegionsPost",
        "summary": "PAYG regions (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygRegionsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/balance": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygBalanceGet",
        "summary": "PAYG balance",
        "description": "Spendable balance behind the calling key.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygBalanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygBalancePost",
        "summary": "PAYG balance (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygBalanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/esims": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygEsimsGet",
        "summary": "List PAYG eSIMs",
        "description": "Your confirmed PAYG eSIMs, newest first, without install data.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygEsimsPost",
        "summary": "List PAYG eSIMs (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygEsimsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygEsimsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/esim": {
      "get": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygEsimGet",
        "summary": "PAYG eSIM details",
        "description": "One eSIM with install data, remaining credit, usage and per-country state. Poll this while a customer travels; usage is reported late.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "iccid",
            "in": "query",
            "required": true,
            "description": "The eSIM ICCID.",
            "schema": {
              "type": "string",
              "examples": [
                "8900000000000000000"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `esim_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "example": {
                  "remark": "payg_esim",
                  "status": "success",
                  "message": {
                    "success": [
                      "eSIM"
                    ]
                  },
                  "data": {
                    "esim": {
                      "iccid": "8900000000000000000",
                      "status": "active",
                      "charged": 4.44,
                      "funded": 4.44,
                      "spent": 0.2288,
                      "data_credit": 3.4474,
                      "usage_bytes": 209715200,
                      "usage_as_of": "2026-08-14T09:41:00+00:00",
                      "countries": [
                        {
                          "country": "AT",
                          "region": null,
                          "region_name": null,
                          "scope": "country",
                          "status": "active",
                          "usage_bytes": 209715200,
                          "charged": 0.2288
                        }
                      ],
                      "lpa": "LPA:1$smdp.example.com$EXAMPLECODE",
                      "activation_code": "EXAMPLECODE",
                      "smdp_address": "smdp.example.com"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygEsimPost",
        "summary": "PAYG eSIM details (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `esim_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/order": {
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygOrder",
        "summary": "Order a PAYG eSIM",
        "description": "Charges your balance, issues the profile, puts the prepaid credit on it and switches on the requested coverage (`region` > `countries` > `activate`). A profile cannot be returned once issued: send `client_request_id`.\n\nIf some coverage could not be switched on, the eSIM is still issued: `data.activation_errors` lists what failed and `message` becomes a plain array of strings.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "client_request_id": "order-10294",
                "region": "PAYG-A"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "client_request_id": "order-10294",
                "region": "PAYG-A"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `validation_error`, `duplicate_request`, `order_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/topup": {
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygTopup",
        "summary": "Top up a PAYG eSIM",
        "description": "Moves credit from the calling key's wallet onto the eSIM. Spendable in any country switched on for it; unused credit returns when the last country closes. `charged` does not change; `data_credit` and `funded` grow.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "amount": 10.0,
                "client_request_id": "topup-5512"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "amount": 10.0,
                "client_request_id": "topup-5512"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `validation_error`, `esim_not_found`, `topup_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/activate": {
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygActivate",
        "summary": "Switch a country or region on",
        "description": "Switches on a country (`country`) or a region (`region`) for the eSIM; the reserve is moved onto it. Works while the device is offline.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygActivationRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "country": "TH"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygActivationRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "country": "TH"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `validation_error`, `esim_not_found`, `activate_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygActivateResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg/deactivate": {
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygDeactivate",
        "summary": "Switch a country or region off",
        "description": "Stops data in a country or region. Unused credit is released once the network's final usage records arrive. The remark is `payg_country_deactivated` for regions too.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygActivationRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "country": "TH"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygActivationRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "country": "TH"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `maintenance_mode`, `validation_error`, `not_active`, `deactivate_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/PaygDeactivateResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/rates": {
      "get": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygRatesGet",
        "summary": "Global PAYG rates",
        "description": "Countries and networks with your price per GiB/MiB. Usage is billed at the rate of the network the device is attached to.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "ISO2 filter.",
            "schema": {
              "type": "string",
              "examples": [
                "DE"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `temporarily_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalRatesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygRatesPost",
        "summary": "Global PAYG rates (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/GlobalRatesRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlobalRatesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `temporarily_unavailable`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalRatesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/pricing": {
      "get": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygPricingGet",
        "summary": "Global PAYG pricing",
        "description": "eSIM price, your markup and top-up limits.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalPricingResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygPricingPost",
        "summary": "Global PAYG pricing (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalPricingResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/balance": {
      "get": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygBalanceGet",
        "summary": "Global PAYG balance",
        "description": "Spendable balance behind the calling key.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalBalanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygBalancePost",
        "summary": "Global PAYG balance (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalBalanceResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/esims": {
      "get": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygEsimsGet",
        "summary": "List Global PAYG eSIMs",
        "description": "Your eSIMs (failed orders excluded), newest first, without install data.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size, 1-100.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 50
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygEsimsPost",
        "summary": "List Global PAYG eSIMs (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/GlobalEsimsRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlobalEsimsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/esim": {
      "get": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygEsimGet",
        "summary": "Global PAYG eSIM details",
        "description": "One eSIM with balance, usage and install data. Refreshed from the network at most every 2 minutes.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "iccid",
            "in": "query",
            "required": true,
            "description": "The eSIM ICCID.",
            "schema": {
              "type": "string",
              "examples": [
                "8900000000000000000"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `esim_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygEsimPost",
        "summary": "Global PAYG eSIM details (POST)",
        "description": "Same as the GET variant; parameters sent in the body.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `esim_not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/order": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygOrder",
        "summary": "Order a Global PAYG eSIM",
        "description": "Issues one eSIM that works in every listed country, optionally with initial credit. Remarks: `gpayg_order_completed`; `gpayg_order_pending` (being confirmed — do not order again; it completes or is refunded automatically); `gpayg_order_replay`. When the initial credit could not be added, or the order is pending, `message` is a plain array of strings.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/GlobalOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "client_request_id": "order-1042",
                "amount": 10,
                "label": "Order 1042"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlobalOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "client_request_id": "order-1042",
                "amount": 10,
                "label": "Order 1042"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `validation_error`, `duplicate_request`, `invalid_amount`, `insufficient_balance`, `temporarily_unavailable`, `order_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                },
                "example": {
                  "remark": "gpayg_order_completed",
                  "status": "success",
                  "message": {
                    "success": [
                      "eSIM"
                    ]
                  },
                  "data": {
                    "esim": {
                      "iccid": "8900000000000000000",
                      "status": "active",
                      "data_paused": false,
                      "currency": "XYC",
                      "balance": 9.99,
                      "spent": 0,
                      "funded": 10,
                      "refunded": 0,
                      "esim_price": 1.8,
                      "label": "Order 1042",
                      "installed": false,
                      "activated_at": null,
                      "balance_as_of": "2026-10-22T15:22:30+00:00",
                      "created_at": "2026-10-22T15:12:42+00:00",
                      "lpa": "LPA:1$smdp.example.com$EXAMPLECODE",
                      "smdp_address": "smdp.example.com",
                      "activation_code": "EXAMPLECODE",
                      "ios_install_url": "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24smdp.example.com%24EXAMPLECODE"
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/topup": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygTopup",
        "summary": "Top up a Global PAYG eSIM",
        "description": "Adds credit from the calling key's wallet. Not possible while a refund is in progress. `gpayg_topup_pending`: being confirmed, do not repeat; if it fails the amount returns automatically.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/GlobalTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "amount": 10
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlobalTopupRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000",
                "amount": 10
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `validation_error`, `esim_not_found`, `invalid_amount`, `not_active`, `refund_pending`, `insufficient_balance`, `temporarily_unavailable`, `topup_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/refund": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygRefund",
        "summary": "Return unused credit",
        "description": "Pauses data and returns the eSIM's unused credit to the calling key's balance after about 15 minutes. The eSIM stays installed; a later top-up switches data back on.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `esim_not_found`, `not_active`, `refund_pending`, `no_balance`, `refund_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalRefundResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/pause": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygPause",
        "summary": "Pause data",
        "description": "Stops data on the eSIM; credit stays on it.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `esim_not_found`, `not_active`, `pause_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/payg-global/resume": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "gpaygResume",
        "summary": "Resume data",
        "description": "Restores data on a paused eSIM.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygIccidRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "iccid": "8900000000000000000"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `not_available`, `too_many_requests`, `maintenance_mode`, `esim_not_found`, `not_active`, `refund_pending`, `no_balance`, `resume_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/GlobalEsimResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/countries": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnCountries",
        "summary": "Virtual number countries",
        "description": "Enabled countries for virtual numbers.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "with_price",
            "in": "query",
            "required": false,
            "description": "Set to 1 to return only countries with a cached starting price.",
            "schema": {
              "type": "integer",
              "enum": [
                0,
                1
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberCountriesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/available": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnAvailable",
        "summary": "Available numbers",
        "description": "Search available numbers from our offer cache. Only numbers that need no registration and can receive SMS are listed. The `offerToken` is needed to order.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "country",
            "in": "query",
            "required": false,
            "description": "ISO2 code, e.g. US.",
            "schema": {
              "type": "string",
              "maxLength": 2
            }
          },
          {
            "name": "type",
            "in": "query",
            "required": false,
            "description": "Number type, e.g. local, mobile, tollfree, national.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          },
          {
            "name": "features",
            "in": "query",
            "required": false,
            "description": "Comma-separated required features, e.g. `sms_in,voice_in`.",
            "schema": {
              "type": "string",
              "maxLength": 255
            }
          },
          {
            "name": "numberPrefix",
            "in": "query",
            "required": false,
            "description": "Substring the number must contain.",
            "schema": {
              "type": "string",
              "maxLength": 40
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `validation_error`. A disabled `country` returns an error with a provider-specific remark and the message \"This country is disabled for virtual numbers\".",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberAvailableResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/order": {
      "post": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnOrder",
        "summary": "Purchase a virtual number",
        "description": "Buys the number behind `offerToken` and charges the calling key's wallet. The price is taken from our offer cache at your rate; any `setupPrice`/`monthlyPrice` you send is ignored. Send `client_transaction_id` to make retries safe.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/VirtualNumberOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "offerToken": "OFFER_TOKEN_EXAMPLE",
                "number": "15550100000",
                "country": "US",
                "client_transaction_id": "vn-order-0001"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VirtualNumberOrderRequest"
              },
              "example": {
                "api_key": "YOUR_API_KEY",
                "offerToken": "OFFER_TOKEN_EXAMPLE",
                "number": "15550100000",
                "country": "US",
                "client_transaction_id": "vn-order-0001"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `validation_error`, `offer_expired`, `inventory_taken`, `insufficient_balance`, `virtual_number_order_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberOrderResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/list": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnList",
        "summary": "List purchased numbers",
        "description": "Your virtual numbers, newest first.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "required": false,
            "description": "Filter, e.g. active, pending_activation, pending_termination, blocked_no_funds.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberListResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/{id}": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnDetails",
        "summary": "Number details",
        "description": "One number with its latest 25 SMS and 25 charges.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local virtual number ID, or the provider-side number ID.",
            "schema": {
              "type": "string",
              "examples": [
                "15"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberDetailsResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/{id}/cancel": {
      "post": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnCancel",
        "summary": "Cancel a number",
        "description": "Cancels the number. It normally stays active until its expiry date (status `pending_termination`).",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local virtual number ID, or the provider-side number ID.",
            "schema": {
              "type": "string",
              "examples": [
                "15"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `not_found`, `cancel_failed`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberUpdatedResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/{id}/sms": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnSms",
        "summary": "SMS messages",
        "description": "Inbound SMS received by the number, newest first.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local virtual number ID, or the provider-side number ID.",
            "schema": {
              "type": "string",
              "examples": [
                "15"
              ]
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/SmsMessagesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/{id}/charges": {
      "get": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnCharges",
        "summary": "SMS charges",
        "description": "Per-SMS charge records for the number, newest first.",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local virtual number ID, or the provider-side number ID.",
            "schema": {
              "type": "string",
              "examples": [
                "15"
              ]
            }
          },
          {
            "name": "per_page",
            "in": "query",
            "required": false,
            "description": "Page size.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "description": "Page number.",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `not_found`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberChargesResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    },
    "/virtual-numbers/{id}/reactivate": {
      "post": {
        "tags": [
          "Virtual numbers"
        ],
        "operationId": "vnReactivate",
        "summary": "Reactivate a blocked number",
        "description": "Unblocks a number in status `blocked_no_funds` after you refill your balance. Cancelled or terminated numbers cannot be restored (`reactivation_not_supported`).",
        "security": [
          {
            "ApiKeyQuery": []
          },
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "description": "Local virtual number ID, or the provider-side number ID.",
            "schema": {
              "type": "string",
              "examples": [
                "15"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            },
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ApiKeyOnly"
              },
              "example": {
                "api_key": "YOUR_API_KEY"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Success or error envelope (both HTTP 200 — check `status`). Error remarks: `invalid_api_key`, `maintenance_mode`, `not_found`, `reactivation_not_supported`.",
            "content": {
              "application/json": {
                "schema": {
                  "oneOf": [
                    {
                      "$ref": "#/components/schemas/VirtualNumberUpdatedResponse"
                    },
                    {
                      "$ref": "#/components/schemas/Error"
                    }
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "webhooks": {
    "paygBalanceChanged": {
      "post": {
        "tags": [
          "PAYG"
        ],
        "operationId": "paygBalanceWebhook",
        "summary": "PAYG eSIM balance changed",
        "description": "Sent to the eSIM's `callback_url` (from `POST /payg/order`) or your account default URL (public https only). Fires when data is charged, a top-up completes, a country or region is switched on or off, or a closed country settles and unused credit returns. The body has no event name. Deliveries are queued and sent by a background job; a retry carries the same `sequence`.\n\nRespond with HTTP 200 exactly. Anything else is a failure and is retried after 1, 4, 9, 16, 25 minutes (6 attempts in total).",
        "parameters": [
          {
            "name": "X-Mobilexy-Secret",
            "in": "header",
            "required": true,
            "description": "Your webhook shared secret, verbatim.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Mobilexy-Timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds at send time.",
            "schema": {
              "type": "string",
              "examples": [
                "1792000000"
              ]
            }
          },
          {
            "name": "X-Mobilexy-Signature",
            "in": "header",
            "required": true,
            "description": "Lowercase hex HMAC-SHA256 of the RAW request body, keyed with your webhook secret. Verify before parsing the JSON. The timestamp is not part of the signed data.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PaygWebhookPayload"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Accepted. Any other status is retried."
          }
        }
      }
    },
    "globalPaygEvent": {
      "post": {
        "tags": [
          "Global PAYG"
        ],
        "operationId": "globalPaygWebhook",
        "summary": "Global PAYG eSIM event",
        "description": "Sent to the eSIM's `callback_url` (from `POST /payg-global/order`) or your account's Global PAYG default URL (public https only). Signed with your Global PAYG webhook secret if one was issued, otherwise with your PAYG webhook secret. Redirects are not followed.\n\nRespond with any 2xx. Failures are retried after 1, 4, 9, 16, 25 minutes (6 attempts in total).",
        "parameters": [
          {
            "name": "X-Mobilexy-Secret",
            "in": "header",
            "required": true,
            "description": "Your webhook shared secret, verbatim.",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-Mobilexy-Timestamp",
            "in": "header",
            "required": true,
            "description": "Unix seconds at send time.",
            "schema": {
              "type": "string",
              "examples": [
                "1792000000"
              ]
            }
          },
          {
            "name": "X-Mobilexy-Signature",
            "in": "header",
            "required": true,
            "description": "Lowercase hex HMAC-SHA256 of the RAW request body, keyed with your webhook secret. Verify before parsing the JSON. The timestamp is not part of the signed data.",
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/GlobalPaygWebhookPayload"
              }
            }
          }
        },
        "responses": {
          "2XX": {
            "description": "Accepted. Any other status is retried."
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "ApiKeyQuery": {
        "type": "apiKey",
        "in": "query",
        "name": "api_key",
        "description": "Your API key. May equally be sent as an `api_key` field in a form or JSON request body."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Your API key as a bearer token. Only PAYG, Global PAYG and virtual-number endpoints accept it."
      }
    },
    "schemas": {
      "MessageList": {
        "type": "array",
        "items": {
          "type": "string"
        }
      },
      "SuccessMessage": {
        "description": "Human-readable messages. Normally an object keyed by the status (`{\"success\": [...]}`). A few responses replace it with a plain array of strings (see the operation description), so accept both forms.",
        "oneOf": [
          {
            "type": "object",
            "required": [
              "success"
            ],
            "properties": {
              "success": {
                "$ref": "#/components/schemas/MessageList"
              }
            },
            "additionalProperties": false
          },
          {
            "$ref": "#/components/schemas/MessageList"
          }
        ]
      },
      "Error": {
        "type": "object",
        "description": "Error envelope. Errors are returned with HTTP status 200: always check `status`. `remark` is a stable machine-readable code.",
        "required": [
          "remark",
          "status",
          "message"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "description": "Machine-readable error code, e.g. `invalid_api_key`, `validation_error`, `insufficient_balance`.",
            "examples": [
              "validation_error"
            ]
          },
          "status": {
            "type": "string",
            "const": "error"
          },
          "message": {
            "type": "object",
            "required": [
              "error"
            ],
            "properties": {
              "error": {
                "$ref": "#/components/schemas/MessageList"
              }
            }
          },
          "data": {
            "description": "Present only on some errors (for example `order_failed` on eSIM orders carries the cancelled order).",
            "type": "object",
            "additionalProperties": true
          }
        },
        "examples": [
          {
            "remark": "invalid_api_key",
            "status": "error",
            "message": {
              "error": [
                "Invalid API key"
              ]
            }
          }
        ]
      },
      "NotFound": {
        "type": "object",
        "description": "Framework 404 body (HTTP 404), returned when a record looked up by id does not exist.",
        "properties": {
          "message": {
            "type": "string"
          }
        },
        "examples": [
          {
            "message": "No query results for model [App\\Models\\Plan] 999999"
          }
        ]
      },
      "CountrySummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "Japan"
            ]
          },
          "slug": {
            "type": "string",
            "description": "Use with `GET /country-plans/{slug}`.",
            "examples": [
              "japan"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Flag image file name (not a full URL).",
            "examples": [
              "JP.png"
            ]
          },
          "converted_price": {
            "type": [
              "number",
              "null"
            ],
            "description": "Cheapest plan price for this country at your rate (XYC). Retail rate when called without `api_key`.",
            "examples": [
              3.39
            ]
          }
        }
      },
      "RegionSummary": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "Asia"
            ]
          },
          "slug": {
            "type": "string",
            "description": "Use with `GET /region-plans/{slug}`.",
            "examples": [
              "asia-as-7"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Region image file name (not a full URL).",
            "examples": [
              "asia.jpg"
            ]
          },
          "plan_count": {
            "type": "integer",
            "description": "Number of plans available to you in this region.",
            "examples": [
              11
            ]
          }
        }
      },
      "PlanCountry": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "examples": [
              "Japan"
            ]
          },
          "slug": {
            "type": "string",
            "examples": [
              "japan"
            ]
          },
          "image": {
            "type": [
              "string",
              "null"
            ],
            "description": "Flag image file name.",
            "examples": [
              "JP.png"
            ]
          }
        }
      },
      "Plan": {
        "type": "object",
        "description": "A fixed data plan as returned by the catalogue list endpoints.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Plan ID. Pass it as `plan_id` to `POST /plan/purchase`.",
            "examples": [
              1117
            ]
          },
          "slug": {
            "type": "string",
            "examples": [
              "JP_1_7"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Japan 1GB 7Days"
            ]
          },
          "period": {
            "type": "integer",
            "description": "Validity in days.",
            "examples": [
              7
            ]
          },
          "package_type": {
            "type": "string",
            "examples": [
              "DATA"
            ]
          },
          "data_volume": {
            "type": "integer",
            "format": "int64",
            "description": "Data allowance in bytes. `-1` means unlimited / daily plan (see `per_day_volume`).",
            "examples": [
              1073741824
            ]
          },
          "is_day_pass": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "1 when the allowance is per day."
          },
          "per_day_volume": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Daily high-speed allowance in bytes for day-pass plans."
          },
          "voice_quantity": {
            "type": "string",
            "description": "Voice minutes, as a decimal string.",
            "examples": [
              "0.00"
            ]
          },
          "sms_quantity": {
            "type": "integer",
            "description": "SMS included. -1 for unlimited.",
            "examples": [
              0
            ]
          },
          "fup_policy_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fair-usage policy, e.g. throttled speed after the daily limit.",
            "examples": [
              ""
            ]
          },
          "operator_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Comma-separated list of mobile networks the plan uses.",
            "examples": [
              "Example Mobile, Sample Telecom"
            ]
          },
          "operator_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "network_speed": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "3G/4G/5G"
            ]
          },
          "area_coverage": {
            "type": "string",
            "enum": [
              "local",
              "continental",
              "global"
            ]
          },
          "status": {
            "type": "integer",
            "description": "1 = active. Only active plans are returned."
          },
          "is_canonical": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Internal catalogue flag."
          },
          "is_reseller_canonical": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Internal catalogue flag."
          },
          "networks": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON-encoded string (decode it) listing, per location, the networks and their technology: `[{\"locationCode\",\"locationName\",\"operatorList\":[{\"operatorName\",\"networkType\"}]}]`.",
            "examples": [
              "[{\"locationCode\":\"JP\",\"locationName\":\"Japan\",\"operatorList\":[{\"operatorName\":\"Example Mobile\",\"networkType\":\"5G\"}]}]"
            ]
          },
          "currency": {
            "type": [
              "object",
              "null"
            ],
            "description": "Currency relation; currently always null. Prices are in XYC.",
            "additionalProperties": true
          },
          "packageCode": {
            "type": "string",
            "description": "Package code of the plan. Use it as `packageCode` for `POST /profile/topup`.",
            "examples": [
              "PKGEXAMPLE1"
            ]
          },
          "converted_price": {
            "type": "number",
            "description": "Your price for this plan in XYC (reseller rate when `api_key` is sent, retail otherwise).",
            "examples": [
              5.4
            ]
          }
        },
        "additionalProperties": true
      },
      "RegionPlan": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Plan"
          },
          {
            "type": "object",
            "properties": {
              "countries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PlanCountry"
                },
                "description": "Countries covered by the plan."
              }
            }
          }
        ]
      },
      "GlobalPlan": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Plan"
          },
          {
            "type": "object",
            "properties": {
              "countries_count": {
                "type": "integer",
                "description": "Number of countries covered. The full country list is on `GET /plan/{id}`.",
                "examples": [
                  128
                ]
              }
            }
          }
        ]
      },
      "PlanDetails": {
        "type": "object",
        "description": "Single plan with its covered countries. Contains no price field; use the list endpoints for prices.",
        "properties": {
          "id": {
            "type": "integer",
            "description": "Plan ID. Pass it as `plan_id` to `POST /plan/purchase`.",
            "examples": [
              1117
            ]
          },
          "slug": {
            "type": "string",
            "examples": [
              "JP_1_7"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Japan 1GB 7Days"
            ]
          },
          "period": {
            "type": "integer",
            "description": "Validity in days.",
            "examples": [
              7
            ]
          },
          "package_type": {
            "type": "string",
            "examples": [
              "DATA"
            ]
          },
          "data_volume": {
            "type": "integer",
            "format": "int64",
            "description": "Data allowance in bytes. `-1` means unlimited / daily plan (see `per_day_volume`).",
            "examples": [
              1073741824
            ]
          },
          "is_day_pass": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "1 when the allowance is per day."
          },
          "per_day_volume": {
            "type": [
              "integer",
              "null"
            ],
            "format": "int64",
            "description": "Daily high-speed allowance in bytes for day-pass plans."
          },
          "voice_quantity": {
            "type": "string",
            "description": "Voice minutes, as a decimal string.",
            "examples": [
              "0.00"
            ]
          },
          "sms_quantity": {
            "type": "integer",
            "description": "SMS included. -1 for unlimited.",
            "examples": [
              0
            ]
          },
          "fup_policy_text": {
            "type": [
              "string",
              "null"
            ],
            "description": "Fair-usage policy, e.g. throttled speed after the daily limit.",
            "examples": [
              ""
            ]
          },
          "operator_name": {
            "type": [
              "string",
              "null"
            ],
            "description": "Comma-separated list of mobile networks the plan uses.",
            "examples": [
              "Example Mobile, Sample Telecom"
            ]
          },
          "operator_slug": {
            "type": [
              "string",
              "null"
            ]
          },
          "network_speed": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "3G/4G/5G"
            ]
          },
          "area_coverage": {
            "type": "string",
            "enum": [
              "local",
              "continental",
              "global"
            ]
          },
          "is_canonical": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Internal catalogue flag."
          },
          "is_reseller_canonical": {
            "type": "integer",
            "enum": [
              0,
              1
            ],
            "description": "Internal catalogue flag."
          },
          "networks": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON-encoded string (decode it) listing, per location, the networks and their technology: `[{\"locationCode\",\"locationName\",\"operatorList\":[{\"operatorName\",\"networkType\"}]}]`.",
            "examples": [
              "[{\"locationCode\":\"JP\",\"locationName\":\"Japan\",\"operatorList\":[{\"operatorName\":\"Example Mobile\",\"networkType\":\"5G\"}]}]"
            ]
          },
          "packageCode": {
            "type": "string",
            "description": "Package code of the plan. Use it as `packageCode` for `POST /profile/topup`.",
            "examples": [
              "PKGEXAMPLE1"
            ]
          },
          "countries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PlanCountry"
            },
            "description": "Every country the plan works in (empty for some single-country plans)."
          }
        },
        "additionalProperties": true
      },
      "CountriesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "countries"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "countries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/CountrySummary"
                }
              }
            }
          }
        }
      },
      "RegionsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "regions"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "regions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RegionSummary"
                }
              }
            }
          }
        }
      },
      "CountryPlansResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "country_plan"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "plans": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/Plan"
                },
                "description": "Sorted by price, cheapest first."
              },
              "flag": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "Flag image URL."
              },
              "flagCode": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "ISO 3166-1 alpha-2 code.",
                "examples": [
                  "JP"
                ]
              }
            }
          }
        }
      },
      "RegionPlansResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "region_plan"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "plans": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/RegionPlan"
                },
                "description": "Sorted by price, cheapest first."
              },
              "flag": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "Region image URL."
              }
            }
          }
        }
      },
      "GlobalPlansResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "global_plan"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "plans": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GlobalPlan"
                },
                "description": "Sorted by price, cheapest first. Cached for up to 5 minutes."
              },
              "flag": {
                "type": "string",
                "format": "uri",
                "description": "Globe image URL."
              }
            }
          }
        }
      },
      "PlanDetailsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "plan_details"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "plan": {
                "$ref": "#/components/schemas/PlanDetails"
              }
            }
          }
        }
      },
      "BalanceData": {
        "type": "object",
        "properties": {
          "balance": {
            "type": "number",
            "description": "Spendable balance in XYC (1 XYC = 1 USD). For a secondary API key this is that key's own sub-balance; for the primary key, the account balance.",
            "examples": [
              100.0
            ]
          }
        }
      },
      "BalanceResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "balance"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/BalanceData"
          }
        }
      },
      "Order": {
        "type": "object",
        "properties": {
          "order_number": {
            "type": "string",
            "description": "Your handle for `GET /plan/order/{order_number}`.",
            "examples": [
              "ABCD1234EFGH"
            ]
          },
          "total_amount": {
            "type": "string",
            "description": "Amount charged, XYC, as a decimal string.",
            "examples": [
              "5.40000000"
            ]
          },
          "packageCode": {
            "type": [
              "string",
              "null"
            ],
            "description": "Package code of the purchased plan.",
            "examples": [
              "PKGEXAMPLE1"
            ]
          },
          "status": {
            "type": "integer",
            "enum": [
              0,
              1,
              2
            ],
            "description": "Order status: 0 = initiated, 1 = completed, 2 = pending. Use `remark` (`order_completed` / `order_pending` / `order_failed`) to decide what to do."
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "Only on `GET /plan/order/{order_number}`."
          }
        }
      },
      "EsimInfo": {
        "type": [
          "object",
          "null"
        ],
        "description": "Extra profile data. Keys depend on the network; `esimTranNo` is the eSIM transaction number used by `/profile/topup` and `/profile/usage-check`. After a top-up a `topup` object is added.",
        "properties": {
          "pin": {
            "type": [
              "string",
              "null"
            ]
          },
          "puk": {
            "type": [
              "string",
              "null"
            ]
          },
          "apn": {
            "type": [
              "string",
              "null"
            ]
          },
          "esimTranNo": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "00000000000000"
            ]
          },
          "topup": {
            "type": "object",
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Esim": {
        "type": "object",
        "description": "An issued fixed-plan eSIM profile.",
        "properties": {
          "serial_number": {
            "type": [
              "string",
              "integer",
              "null"
            ],
            "description": "Profile serial / IMSI where available."
          },
          "iccid": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "8900000000000000000"
            ]
          },
          "phone_number": {
            "type": "string",
            "description": "Empty string when the plan has no number.",
            "examples": [
              ""
            ]
          },
          "qr_code": {
            "type": [
              "string",
              "null"
            ],
            "description": "LPA activation string. Render it as a QR code.",
            "examples": [
              "LPA:1$smdp.example.com$EXAMPLECODE"
            ]
          },
          "qr_code_image": {
            "type": [
              "string",
              "null"
            ],
            "format": "uri",
            "description": "QR image URL, when available."
          },
          "expiry_date": {
            "type": [
              "string",
              "null"
            ],
            "description": "Expiry date (date or date-time string).",
            "examples": [
              "2026-12-31"
            ]
          },
          "info": {
            "$ref": "#/components/schemas/EsimInfo"
          }
        }
      },
      "OrderResult": {
        "type": "object",
        "properties": {
          "order": {
            "$ref": "#/components/schemas/Order"
          },
          "esim": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/Esim"
              },
              {
                "type": "null"
              }
            ],
            "description": "Null while the profile is being issued."
          }
        }
      },
      "OrderResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "order_completed",
              "order_pending"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/OrderResult"
          }
        },
        "description": "`order_completed`: eSIM ready. `order_pending`: profile is still being issued; poll `GET /plan/order/{order_number}` every 15-30 seconds."
      },
      "PurchaseRequest": {
        "type": "object",
        "required": [
          "api_key",
          "plan_id"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your API key. Also selects the wallet that pays."
          },
          "plan_id": {
            "type": "integer",
            "description": "Plan `id` from the catalogue.",
            "examples": [
              1117
            ]
          },
          "client_request_id": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_\\-]+$",
            "description": "Idempotency key (1-64 chars, A-Z a-z 0-9 _ -). Repeating a purchase with the same value returns the original order (completed, pending or failed) instead of creating and charging a new one. Strongly recommended.",
            "examples": [
              "order-10294"
            ]
          }
        }
      },
      "ApiKeyOnly": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your API key."
          }
        }
      },
      "ProfileTopupRequest": {
        "type": "object",
        "required": [
          "api_key",
          "packageCode"
        ],
        "description": "Send `esimTranNo` or `iccid` (at least one). snake_case aliases are accepted: `package_code`, `transaction_id`, `esim_tran_no`, `ICCID`.",
        "properties": {
          "api_key": {
            "type": "string"
          },
          "packageCode": {
            "type": "string",
            "description": "Package code of a reloadable plan, with or without the `TOPUP_` prefix. The price is that plan's price at your rate.",
            "examples": [
              "PKGEXAMPLE1"
            ]
          },
          "esimTranNo": {
            "type": "string",
            "description": "eSIM transaction number (from `esim.info.esimTranNo`). Preferred over `iccid`.",
            "examples": [
              "00000000000000"
            ]
          },
          "iccid": {
            "type": "string",
            "description": "ICCID of the eSIM, used when `esimTranNo` is not sent.",
            "examples": [
              "8900000000000000000"
            ]
          },
          "transactionId": {
            "type": "string",
            "maxLength": 40,
            "description": "Your idempotency key for this top-up (first 40 chars are used). Retrying with the same value does not charge twice. Generated for you when omitted (then retries are not de-duplicated).",
            "examples": [
              "topup-5512"
            ]
          }
        }
      },
      "ProfileTopupObj": {
        "type": "object",
        "properties": {
          "transactionId": {
            "type": "string",
            "examples": [
              "topup-5512"
            ]
          },
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "expiredTime": {
            "type": "string",
            "description": "New package expiry timestamp.",
            "examples": [
              "2026-12-31T07:37:12+0000"
            ]
          },
          "totalVolume": {
            "type": "integer",
            "format": "int64",
            "description": "New total data allowance in bytes."
          },
          "totalDuration": {
            "type": "integer",
            "description": "New validity in days."
          },
          "orderUsage": {
            "type": "integer",
            "format": "int64",
            "description": "Data used so far in bytes."
          },
          "topUpEsimTranNo": {
            "type": "string"
          }
        },
        "additionalProperties": true
      },
      "ProfileTopupResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "topup_completed"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "success": {
                "type": "boolean",
                "const": true
              },
              "errorCode": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "errorMsg": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "obj": {
                "$ref": "#/components/schemas/ProfileTopupObj"
              }
            }
          }
        }
      },
      "UsageCheckRequest": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "description": "Send at least one of `esimTranNos`, `esimTranNo`, `orderNo`, `iccid`.",
        "properties": {
          "api_key": {
            "type": "string"
          },
          "esimTranNos": {
            "type": "array",
            "maxItems": 10,
            "items": {
              "type": "string"
            },
            "description": "Up to 10 eSIM transaction numbers."
          },
          "esimTranNo": {
            "type": "string",
            "description": "One eSIM transaction number."
          },
          "orderNo": {
            "type": "string",
            "description": "Network-side order number."
          },
          "iccid": {
            "type": "string",
            "description": "ICCID of an eSIM bought through this API.",
            "examples": [
              "8900000000000000000"
            ]
          }
        }
      },
      "UsageEntry": {
        "type": "object",
        "properties": {
          "esimTranNo": {
            "type": "string"
          },
          "dataUsage": {
            "type": "integer",
            "format": "int64",
            "description": "Data used, bytes."
          },
          "totalData": {
            "type": "integer",
            "format": "int64",
            "description": "Plan allowance, bytes."
          },
          "lastUpdateTime": {
            "type": "string",
            "description": "When the network last updated the figure."
          }
        },
        "additionalProperties": true
      },
      "UsageCheckResult": {
        "type": "object",
        "description": "Raw usage result. NOT wrapped in the usual envelope. Usage is refreshed by the network every 2-3 hours.",
        "properties": {
          "success": {
            "type": "boolean"
          },
          "errorCode": {
            "type": [
              "string",
              "null"
            ]
          },
          "errorMsg": {
            "type": [
              "string",
              "null"
            ]
          },
          "obj": {
            "type": "object",
            "properties": {
              "usageList": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/UsageEntry"
                }
              }
            },
            "additionalProperties": true
          }
        },
        "additionalProperties": true
      },
      "Pagination": {
        "type": "object",
        "description": "Standard paginator. Items are in `data`; pass `page` to move between pages.",
        "properties": {
          "current_page": {
            "type": "integer"
          },
          "first_page_url": {
            "type": "string"
          },
          "from": {
            "type": [
              "integer",
              "null"
            ]
          },
          "last_page": {
            "type": "integer"
          },
          "last_page_url": {
            "type": "string"
          },
          "links": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "url": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "label": {
                  "type": "string"
                },
                "active": {
                  "type": "boolean"
                }
              }
            }
          },
          "next_page_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "path": {
            "type": "string"
          },
          "per_page": {
            "type": "integer"
          },
          "prev_page_url": {
            "type": [
              "string",
              "null"
            ]
          },
          "to": {
            "type": [
              "integer",
              "null"
            ]
          },
          "total": {
            "type": "integer"
          }
        }
      },
      "KeyBalance": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "XYC"
          },
          "balance": {
            "type": "number",
            "description": "Spendable balance behind the calling key (a secondary key's own sub-balance).",
            "examples": [
              214.6
            ]
          },
          "key": {
            "type": [
              "string",
              "null"
            ],
            "description": "Label of the key used; null for the primary key.",
            "examples": [
              "storefront-eu"
            ]
          }
        }
      },
      "PaygCountry": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "description": "ISO 3166-1 alpha-2 code.",
            "examples": [
              "AT"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Austria"
            ]
          },
          "price_per_gib": {
            "type": "number",
            "description": "Your price for 1 GiB, XYC.",
            "examples": [
              1.1719
            ]
          },
          "price_per_mib": {
            "type": "number",
            "description": "Your price per MiB, XYC. This is what billing uses.",
            "examples": [
              0.00114444
            ]
          },
          "reserve": {
            "type": "number",
            "description": "Data credit moved onto the eSIM when this country is switched on outside the included set.",
            "examples": [
              1.17
            ]
          },
          "networks": {
            "type": "integer",
            "description": "Number of networks serving the country; the price is the same on each.",
            "examples": [
              3
            ]
          }
        }
      },
      "PaygRegion": {
        "type": "object",
        "properties": {
          "region": {
            "type": "string",
            "description": "Code for `/payg/activate` and `/payg/order`.",
            "examples": [
              "PAYG-A"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Europe & Popular"
            ]
          },
          "kind": {
            "type": "string",
            "description": "Currently always `base`.",
            "examples": [
              "base"
            ]
          },
          "countries": {
            "type": "integer",
            "description": "Number of countries covered.",
            "examples": [
              60
            ]
          },
          "price_per_gib": {
            "type": "number",
            "examples": [
              1.9804
            ]
          },
          "price_per_mib": {
            "type": "number",
            "examples": [
              0.00193398
            ]
          },
          "reserve": {
            "type": "number",
            "description": "Data credit set aside on the eSIM when the region is switched on.",
            "examples": [
              3.0
            ]
          },
          "country_list": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "ISO codes covered.",
            "examples": [
              [
                "AT",
                "BE",
                "BG"
              ]
            ]
          },
          "countries_unpriced": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Countries in the region where we have no network of our own. They work and are billed at the region rate, but coverage depends on the operator."
          },
          "list_approximate": {
            "type": "boolean",
            "description": "true when the country list is our best knowledge, not a published list."
          }
        }
      },
      "PaygPricing": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "XYC"
          },
          "esim_price": {
            "type": "number",
            "description": "Charged to your balance for one eSIM, including the prepaid data credit inside it.",
            "examples": [
              4.44
            ]
          },
          "markup_percent": {
            "type": "number",
            "description": "Your markup over cost. 0 = cost price.",
            "examples": [
              0
            ]
          },
          "included_countries": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "ISO codes switched on at purchase at no extra charge. Changes over time; read it, do not hard-code it."
          },
          "included_region": {
            "type": [
              "string",
              "null"
            ],
            "description": "Region switched on at purchase when the bundle is sold as a region; null otherwise.",
            "examples": [
              "PAYG-A"
            ]
          },
          "hard_cap": {
            "type": "boolean",
            "description": "true: credit on an eSIM is a ceiling, your wallet is never drawn to keep it alive. false: an eSIM in use is topped up from your wallet automatically."
          },
          "note": {
            "type": "string"
          }
        }
      },
      "PaygEsimConnectivity": {
        "type": "object",
        "description": "One country or region switched on for the eSIM. A region entry has `country` null and `region` set.",
        "properties": {
          "country": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "AT"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              null
            ]
          },
          "region_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "scope": {
            "type": "string",
            "enum": [
              "country",
              "region"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "stopping",
              "stopped_no_funds",
              "settling",
              "closed",
              "failed"
            ]
          },
          "usage_bytes": {
            "type": "integer",
            "format": "int64"
          },
          "charged": {
            "type": "number",
            "description": "Billed for this country/region so far, XYC."
          }
        }
      },
      "PaygEsimSummary": {
        "type": "object",
        "description": "PAYG eSIM without install data (list form).",
        "properties": {
          "iccid": {
            "type": "string",
            "description": "Use it in every other PAYG call.",
            "examples": [
              "8900000000000000000"
            ]
          },
          "status": {
            "type": "string",
            "description": "`active` for a confirmed eSIM; otherwise the order state (`pending`, `failed`).",
            "examples": [
              "active"
            ]
          },
          "charged": {
            "type": "number",
            "description": "Purchase price. Never changes, top-ups included.",
            "examples": [
              4.44
            ]
          },
          "funded": {
            "type": "number",
            "description": "Everything taken from your balance for this eSIM, top-ups included, less returns. funded = charged + spent + data_credit.",
            "examples": [
              4.44
            ]
          },
          "spent": {
            "type": "number",
            "description": "What data has consumed so far.",
            "examples": [
              0.2288
            ]
          },
          "data_credit": {
            "type": "number",
            "description": "Prepaid credit currently on the eSIM.",
            "examples": [
              3.4474
            ]
          },
          "usage_bytes": {
            "type": "integer",
            "format": "int64",
            "examples": [
              209715200
            ]
          },
          "usage_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the usage figure is true as of. Null until the first records arrive. Usage is reported late (up to 17 h)."
          },
          "countries": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PaygEsimConnectivity"
            }
          }
        }
      },
      "PaygEsim": {
        "allOf": [
          {
            "$ref": "#/components/schemas/PaygEsimSummary"
          },
          {
            "type": "object",
            "properties": {
              "lpa": {
                "type": [
                  "string",
                  "null"
                ],
                "description": "Full activation string; render as QR.",
                "examples": [
                  "LPA:1$smdp.example.com$EXAMPLECODE"
                ]
              },
              "activation_code": {
                "type": [
                  "string",
                  "null"
                ],
                "examples": [
                  "EXAMPLECODE"
                ]
              },
              "smdp_address": {
                "type": [
                  "string",
                  "null"
                ],
                "examples": [
                  "smdp.example.com"
                ]
              }
            }
          }
        ],
        "description": "PAYG eSIM with install data."
      },
      "PaygPricingResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_pricing"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/PaygPricing"
          }
        }
      },
      "PaygCountriesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_countries"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "const": "XYC"
              },
              "markup": {
                "type": "number"
              },
              "count": {
                "type": "integer"
              },
              "countries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaygCountry"
                }
              }
            }
          }
        }
      },
      "PaygRegionsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_regions"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "const": "XYC"
              },
              "markup": {
                "type": "number"
              },
              "count": {
                "type": "integer"
              },
              "regions": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaygRegion"
                }
              },
              "note": {
                "type": "string"
              }
            }
          }
        }
      },
      "PaygBalanceResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_balance"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/KeyBalance"
          }
        }
      },
      "PaygEsimResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_order_completed",
              "payg_order_replay",
              "payg_topup_completed",
              "payg_topup_replay",
              "payg_esim"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "esim": {
                "$ref": "#/components/schemas/PaygEsim"
              },
              "activation_errors": {
                "type": "object",
                "additionalProperties": {
                  "type": "string"
                },
                "description": "Only on `POST /payg/order` when some connectivity did not come up: map of country/region code to error. The eSIM is still issued and paid; `message` is then a plain array."
              }
            }
          }
        }
      },
      "PaygEsimPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PaygEsimSummary"
                }
              }
            }
          }
        ]
      },
      "PaygEsimsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_esims"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "esims": {
                "$ref": "#/components/schemas/PaygEsimPage"
              }
            }
          }
        }
      },
      "PaygActivateResult": {
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "TH"
            ]
          },
          "region": {
            "type": [
              "string",
              "null"
            ]
          },
          "region_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string",
            "description": "`active` once data is live.",
            "examples": [
              "active"
            ]
          },
          "reserved": {
            "type": "number",
            "description": "Data credit moved onto the eSIM for this country/region.",
            "examples": [
              1.94
            ]
          },
          "price_per_gib": {
            "type": "number",
            "description": "Rate locked in for this activation.",
            "examples": [
              1.9414
            ]
          }
        }
      },
      "PaygActivateResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_country_activated",
              "payg_region_activated"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/PaygActivateResult"
          }
        }
      },
      "PaygDeactivateResult": {
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null when a region was switched off.",
            "examples": [
              "TH"
            ]
          },
          "status": {
            "type": "string",
            "description": "Usually `settling`: stopped, waiting for final usage records before unused credit is released.",
            "examples": [
              "settling"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "PaygDeactivateResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "payg_country_deactivated"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/PaygDeactivateResult"
          }
        }
      },
      "PaygIccidRequest": {
        "type": "object",
        "required": [
          "api_key",
          "iccid"
        ],
        "properties": {
          "api_key": {
            "type": "string"
          },
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          }
        }
      },
      "PaygEsimsRequest": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string"
          },
          "per_page": {
            "type": "integer",
            "minimum": 1,
            "description": "Page size (site default when omitted)."
          },
          "page": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "PaygOrderRequest": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Your API key; also selects the wallet and the price. May be sent as a bearer token instead."
          },
          "client_request_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_\\-]{1,64}$",
            "description": "Strongly recommended idempotency key. Repeating it (within 24 h) returns the same eSIM instead of buying another. Without it, any repeat order within 30 seconds returns your most recent eSIM.",
            "examples": [
              "order-10294"
            ]
          },
          "region": {
            "type": "string",
            "description": "Switch a whole region on at purchase, e.g. `PAYG-A`. Takes priority over `countries` and `activate`.",
            "examples": [
              "PAYG-A"
            ]
          },
          "countries": {
            "description": "Countries to switch on at purchase (max 8): comma-separated string or array of ISO codes. Ignored when `region` is given.",
            "oneOf": [
              {
                "type": "string",
                "examples": [
                  "TR,GE,AM"
                ]
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                },
                "maxItems": 8
              }
            ]
          },
          "activate": {
            "type": "string",
            "enum": [
              "included",
              "none"
            ],
            "default": "included",
            "description": "`included` switches on the included coverage; `none` hands over a dormant eSIM with credit on board."
          },
          "callback_url": {
            "type": "string",
            "format": "uri",
            "description": "Public https URL for this eSIM's balance webhooks. Falls back to your account default."
          }
        }
      },
      "PaygTopupRequest": {
        "type": "object",
        "required": [
          "api_key",
          "iccid",
          "amount"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "Also selects the wallet the money comes from."
          },
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "amount": {
            "type": "number",
            "minimum": 0.01,
            "description": "XYC to move onto the eSIM.",
            "examples": [
              10.0
            ]
          },
          "client_request_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_\\-]{1,64}$",
            "description": "Replay guard (24 h): repeating it does not move money twice.",
            "examples": [
              "topup-5512"
            ]
          }
        }
      },
      "PaygActivationRequest": {
        "type": "object",
        "required": [
          "api_key",
          "iccid"
        ],
        "description": "Send `country` or `region` (one is required).",
        "properties": {
          "api_key": {
            "type": "string"
          },
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "country": {
            "type": "string",
            "minLength": 2,
            "maxLength": 2,
            "description": "ISO 3166-1 alpha-2 code.",
            "examples": [
              "TH"
            ]
          },
          "region": {
            "type": "string",
            "maxLength": 32,
            "description": "Region code from `/payg/regions`.",
            "examples": [
              "PAYG-A"
            ]
          }
        }
      },
      "GlobalRateNetwork": {
        "type": "object",
        "properties": {
          "network": {
            "type": "string",
            "description": "Network (operator) name.",
            "examples": [
              "Example Mobile"
            ]
          },
          "price_per_gib": {
            "type": "number",
            "examples": [
              2.3
            ]
          },
          "price_per_mib": {
            "type": "number",
            "examples": [
              0.00224609
            ]
          }
        }
      },
      "GlobalRateCountry": {
        "type": "object",
        "properties": {
          "country": {
            "type": "string",
            "examples": [
              "DE"
            ]
          },
          "name": {
            "type": "string",
            "examples": [
              "Germany"
            ]
          },
          "continent": {
            "type": "string",
            "examples": [
              "Europe"
            ]
          },
          "min_price_per_gib": {
            "type": "number"
          },
          "max_price_per_gib": {
            "type": "number"
          },
          "networks": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/GlobalRateNetwork"
            },
            "description": "Cheapest first. The device picks the network; usage is billed at that network's rate."
          }
        }
      },
      "GlobalPricing": {
        "type": "object",
        "properties": {
          "currency": {
            "type": "string",
            "const": "XYC"
          },
          "esim_price": {
            "type": "number",
            "description": "One-off price per eSIM.",
            "examples": [
              1.8
            ]
          },
          "markup_percent": {
            "type": "number"
          },
          "min_topup": {
            "type": "number",
            "examples": [
              1
            ]
          },
          "max_topup": {
            "type": "number",
            "examples": [
              1000
            ]
          },
          "note": {
            "type": "string"
          }
        }
      },
      "GlobalEsimSummary": {
        "type": "object",
        "description": "Global PAYG eSIM without install data.",
        "properties": {
          "iccid": {
            "type": [
              "string",
              "null"
            ],
            "description": "Null until the eSIM is issued.",
            "examples": [
              "8900000000000000000"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "active",
              "refunding",
              "failed",
              "terminated"
            ]
          },
          "data_paused": {
            "type": "boolean"
          },
          "currency": {
            "type": "string",
            "const": "XYC"
          },
          "balance": {
            "type": "number",
            "description": "Credit on the eSIM, rounded down to the cent; may show up to 5 cents less than the exact credit.",
            "examples": [
              9.99
            ]
          },
          "spent": {
            "type": "number",
            "examples": [
              0
            ]
          },
          "funded": {
            "type": "number",
            "description": "Credit ever put on the eSIM.",
            "examples": [
              10
            ]
          },
          "refunded": {
            "type": "number",
            "description": "Credit returned to your balance.",
            "examples": [
              0
            ]
          },
          "esim_price": {
            "type": "number",
            "examples": [
              1.8
            ]
          },
          "label": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Order 1042"
            ]
          },
          "installed": {
            "type": "boolean",
            "description": "true once the profile is installed on a device."
          },
          "activated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "balance_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the balance was last synced from the network."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        }
      },
      "GlobalEsim": {
        "allOf": [
          {
            "$ref": "#/components/schemas/GlobalEsimSummary"
          },
          {
            "type": "object",
            "properties": {
              "lpa": {
                "type": [
                  "string",
                  "null"
                ],
                "examples": [
                  "LPA:1$smdp.example.com$EXAMPLECODE"
                ]
              },
              "smdp_address": {
                "type": [
                  "string",
                  "null"
                ],
                "examples": [
                  "smdp.example.com"
                ]
              },
              "activation_code": {
                "type": [
                  "string",
                  "null"
                ],
                "examples": [
                  "EXAMPLECODE"
                ]
              },
              "ios_install_url": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "uri",
                "description": "One-tap install link for iOS.",
                "examples": [
                  "https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24smdp.example.com%24EXAMPLECODE"
                ]
              }
            }
          }
        ],
        "description": "Global PAYG eSIM. Install fields are returned by `order` (and its replay) and `esim`; not by top-up, pause, resume or the list."
      },
      "GlobalRatesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_rates"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "currency": {
                "type": "string",
                "const": "XYC"
              },
              "note": {
                "type": "string"
              },
              "count": {
                "type": "integer"
              },
              "countries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GlobalRateCountry"
                }
              }
            }
          }
        }
      },
      "GlobalPricingResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_pricing"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/GlobalPricing"
          }
        }
      },
      "GlobalBalanceResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_balance"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/KeyBalance"
          }
        }
      },
      "GlobalEsimResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_order_completed",
              "gpayg_order_pending",
              "gpayg_order_replay",
              "gpayg_topup_completed",
              "gpayg_topup_pending",
              "gpayg_topup_replay",
              "gpayg_paused",
              "gpayg_resumed",
              "gpayg_esim"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "esim": {
                "$ref": "#/components/schemas/GlobalEsim"
              }
            }
          }
        }
      },
      "GlobalEsimPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/GlobalEsimSummary"
                }
              }
            }
          }
        ]
      },
      "GlobalEsimsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_esims"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "esims": {
                "$ref": "#/components/schemas/GlobalEsimPage"
              }
            }
          }
        }
      },
      "GlobalRefundResult": {
        "type": "object",
        "properties": {
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "estimated_return": {
            "type": "number",
            "description": "Estimated XYC to come back to your balance.",
            "examples": [
              7.42
            ]
          },
          "settles_in_minutes": {
            "type": "integer",
            "examples": [
              15
            ]
          },
          "currency": {
            "type": "string",
            "const": "XYC"
          }
        }
      },
      "GlobalRefundResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "gpayg_refund_pending"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "$ref": "#/components/schemas/GlobalRefundResult"
          }
        }
      },
      "GlobalOrderRequest": {
        "type": "object",
        "required": [
          "api_key",
          "client_request_id"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "May be sent as a bearer token instead."
          },
          "client_request_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_\\-]{1,64}$",
            "description": "Required. Unique per eSIM. Repeating it returns the same eSIM; if that order failed, the ID can be reused.",
            "examples": [
              "order-1042"
            ]
          },
          "amount": {
            "type": "number",
            "minimum": 0,
            "maximum": 1000,
            "default": 0,
            "description": "Initial credit: 0, or 1-1000 XYC. Charged on top of the eSIM price."
          },
          "label": {
            "type": "string",
            "maxLength": 191,
            "examples": [
              "Order 1042"
            ]
          },
          "callback_url": {
            "type": "string",
            "maxLength": 255,
            "format": "uri",
            "description": "Public https URL for this eSIM's webhooks."
          }
        }
      },
      "GlobalTopupRequest": {
        "type": "object",
        "required": [
          "api_key",
          "iccid",
          "amount"
        ],
        "properties": {
          "api_key": {
            "type": "string"
          },
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "amount": {
            "type": "number",
            "minimum": 1,
            "maximum": 1000,
            "examples": [
              10
            ]
          },
          "client_request_id": {
            "type": "string",
            "pattern": "^[a-zA-Z0-9_\\-]{1,64}$",
            "description": "Replay guard (24 h)."
          }
        }
      },
      "GlobalRatesRequest": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string"
          },
          "country": {
            "type": "string",
            "description": "ISO2 filter.",
            "examples": [
              "DE"
            ]
          }
        }
      },
      "GlobalEsimsRequest": {
        "type": "object",
        "required": [
          "api_key"
        ],
        "properties": {
          "api_key": {
            "type": "string"
          },
          "per_page": {
            "type": "integer",
            "minimum": 1,
            "maximum": 100,
            "default": 50
          },
          "page": {
            "type": "integer",
            "minimum": 1
          }
        }
      },
      "VirtualNumberCountry": {
        "type": "object",
        "description": "Enabled virtual-number country record.",
        "properties": {
          "id": {
            "type": "integer"
          },
          "country_code": {
            "type": "string",
            "examples": [
              "US"
            ]
          },
          "country_name": {
            "type": "string",
            "examples": [
              "United States"
            ]
          },
          "number_groups": {
            "type": [
              "integer",
              "null"
            ]
          },
          "types": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "local"
              ]
            ]
          },
          "features": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "min_retail_price": {
            "type": [
              "string",
              "null"
            ],
            "description": "Cheapest cached offer at the default retail markup (decimal string, USD). Your own price may differ.",
            "examples": [
              "8.33000000"
            ]
          },
          "min_provider_setup_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "min_provider_monthly_price": {
            "type": [
              "string",
              "null"
            ]
          },
          "cached_numbers_count": {
            "type": [
              "integer",
              "null"
            ]
          },
          "status": {
            "type": "integer"
          },
          "env": {
            "type": "string"
          },
          "synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "numbers_synced_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "VirtualNumberOffer": {
        "type": "object",
        "description": "An available number offer as cached from the network. Prices here are the network's setup/monthly prices before your markup; the amount actually charged is computed at order time.",
        "properties": {
          "offerToken": {
            "type": "string",
            "description": "Pass to `POST /virtual-numbers/order`. Expires; refresh the list if ordering fails with `offer_expired`.",
            "examples": [
              "OFFER_TOKEN_EXAMPLE"
            ]
          },
          "number": {
            "type": "string",
            "examples": [
              "15550100000"
            ]
          },
          "country": {
            "type": "string",
            "examples": [
              "US"
            ]
          },
          "countryName": {
            "type": "string",
            "examples": [
              "United States"
            ]
          },
          "type": {
            "type": "string",
            "examples": [
              "local"
            ]
          },
          "features": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "examples": [
              [
                "sms_in",
                "voice_in"
              ]
            ]
          },
          "setupPrice": {
            "type": [
              "string",
              "number"
            ],
            "examples": [
              "0.00"
            ]
          },
          "monthlyPrice": {
            "type": [
              "string",
              "number"
            ],
            "examples": [
              "3.00"
            ]
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "offerExpiresInSec": {
            "type": "integer",
            "description": "Validity at the time the offer was cached."
          },
          "needsRegistration": {
            "type": "boolean",
            "description": "Always false here: numbers needing KYC are filtered out."
          }
        },
        "additionalProperties": true
      },
      "SmsMessage": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "virtual_number_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "roamlinx_number_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider-side number identifier."
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "from_number": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "+15550100000"
            ]
          },
          "to_number": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "+15550100001"
            ]
          },
          "text": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "Your code is 000000"
            ]
          },
          "env": {
            "type": [
              "string",
              "null"
            ]
          },
          "received_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "provider_time": {
            "type": [
              "string",
              "null"
            ],
            "description": "Receive time as reported by the network."
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "VirtualNumberCharge": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer"
          },
          "virtual_number_id": {
            "type": "integer"
          },
          "roamlinx_number_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider-side number identifier."
          },
          "message_id": {
            "type": [
              "string",
              "null"
            ]
          },
          "charge_type": {
            "type": "string",
            "examples": [
              "sms_in"
            ]
          },
          "amount": {
            "type": [
              "string",
              "number"
            ],
            "description": "Amount charged to your balance (0 when absorbed)."
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "status": {
            "type": "string",
            "enum": [
              "success",
              "blocked_no_funds",
              "absorbed"
            ]
          },
          "charged_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "VirtualNumber": {
        "type": "object",
        "description": "A purchased virtual number (full stored record).",
        "properties": {
          "id": {
            "type": "integer",
            "examples": [
              15
            ]
          },
          "user_id": {
            "type": "integer"
          },
          "api_key_id": {
            "type": [
              "integer",
              "null"
            ],
            "description": "Key whose wallet pays recurring charges."
          },
          "virtual_number_order_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "roamlinx_number_id": {
            "type": "string",
            "description": "Provider-side number identifier. Accepted in place of `id` in the URL.",
            "examples": [
              "num_000000"
            ]
          },
          "number": {
            "type": "string",
            "examples": [
              "15550100000"
            ]
          },
          "country": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "US"
            ]
          },
          "country_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ],
            "examples": [
              "local"
            ]
          },
          "features": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "status": {
            "type": "string",
            "description": "e.g. `active`, `pending_activation`, `pending_termination`, `blocked_no_funds`, `terminated`.",
            "examples": [
              "active"
            ]
          },
          "setup_charged": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "monthly_price": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "retail_monthly_price": {
            "type": [
              "string",
              "number",
              "null"
            ]
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "next_charge_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "env": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          }
        },
        "additionalProperties": true
      },
      "VirtualNumberWithHistory": {
        "allOf": [
          {
            "$ref": "#/components/schemas/VirtualNumber"
          },
          {
            "type": "object",
            "properties": {
              "messages": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SmsMessage"
                },
                "description": "Latest 25 SMS."
              },
              "charges": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VirtualNumberCharge"
                },
                "description": "Latest 25 charges."
              }
            }
          }
        ]
      },
      "VirtualNumberOrder": {
        "type": "object",
        "description": "Virtual number order record (full stored record).",
        "properties": {
          "id": {
            "type": "integer"
          },
          "user_id": {
            "type": "integer"
          },
          "api_key_id": {
            "type": [
              "integer",
              "null"
            ]
          },
          "order_id": {
            "type": "integer"
          },
          "order_number": {
            "type": "string",
            "examples": [
              "ABCD123456"
            ]
          },
          "transaction_id": {
            "type": "string",
            "description": "Your `client_transaction_id`, or `VN-<user>-<order_number>` when none was sent.",
            "examples": [
              "VN-1-ABCD123456"
            ]
          },
          "offer_token": {
            "type": [
              "string",
              "null"
            ]
          },
          "roamlinx_number_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Provider-side number identifier."
          },
          "number": {
            "type": "string",
            "examples": [
              "15550100000"
            ]
          },
          "country": {
            "type": "string",
            "examples": [
              "US"
            ]
          },
          "country_name": {
            "type": [
              "string",
              "null"
            ]
          },
          "type": {
            "type": [
              "string",
              "null"
            ]
          },
          "features": {
            "type": [
              "array",
              "null"
            ],
            "items": {
              "type": "string"
            }
          },
          "setup_price": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Network setup price."
          },
          "monthly_price": {
            "type": [
              "string",
              "number",
              "null"
            ],
            "description": "Network monthly price."
          },
          "retail_price": {
            "type": [
              "string",
              "number"
            ],
            "description": "Amount charged to your balance, USD/XYC.",
            "examples": [
              "8.33000000"
            ]
          },
          "currency": {
            "type": "string",
            "examples": [
              "USD"
            ]
          },
          "status": {
            "type": "string",
            "examples": [
              "active"
            ]
          },
          "env": {
            "type": [
              "string",
              "null"
            ]
          },
          "created_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "updated_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "virtual_number": {
            "oneOf": [
              {
                "$ref": "#/components/schemas/VirtualNumber"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "additionalProperties": true
      },
      "VirtualNumberOrderRequest": {
        "type": "object",
        "required": [
          "api_key",
          "offerToken"
        ],
        "properties": {
          "api_key": {
            "type": "string",
            "description": "May be sent as a bearer token instead. Also selects the wallet that pays."
          },
          "offerToken": {
            "type": "string",
            "examples": [
              "OFFER_TOKEN_EXAMPLE"
            ]
          },
          "client_transaction_id": {
            "type": "string",
            "maxLength": 64,
            "pattern": "^[a-zA-Z0-9_\\-]+$",
            "description": "Idempotency key. Repeating an order with the same value returns the existing order instead of buying again.",
            "examples": [
              "vn-order-0001"
            ]
          },
          "number": {
            "type": "string",
            "maxLength": 60,
            "description": "Number from the offer; helps re-find the offer if its token rotated."
          },
          "country": {
            "type": "string",
            "maxLength": 2,
            "examples": [
              "US"
            ]
          },
          "type": {
            "type": "string",
            "maxLength": 40
          },
          "setupPrice": {
            "type": "number",
            "minimum": 0,
            "description": "Accepted but ignored: prices always come from our offer cache."
          },
          "monthlyPrice": {
            "type": "number",
            "minimum": 0,
            "description": "Accepted but ignored: prices always come from our offer cache."
          }
        }
      },
      "VirtualNumberCountriesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_countries"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "countries": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VirtualNumberCountry"
                }
              }
            }
          }
        }
      },
      "VirtualNumberAvailableResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_numbers_available"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "obj": {
                "type": "object",
                "properties": {
                  "items": {
                    "type": "array",
                    "items": {
                      "$ref": "#/components/schemas/VirtualNumberOffer"
                    },
                    "description": "Cheapest first, up to 1000."
                  }
                }
              }
            }
          }
        }
      },
      "VirtualNumberOrderResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_ordered"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "order": {
                "$ref": "#/components/schemas/VirtualNumberOrder"
              }
            }
          }
        }
      },
      "VirtualNumberPage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VirtualNumber"
                }
              }
            }
          }
        ]
      },
      "SmsMessagePage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/SmsMessage"
                }
              }
            }
          }
        ]
      },
      "VirtualNumberChargePage": {
        "allOf": [
          {
            "$ref": "#/components/schemas/Pagination"
          },
          {
            "type": "object",
            "properties": {
              "data": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/VirtualNumberCharge"
                }
              }
            }
          }
        ]
      },
      "VirtualNumberListResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_list"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "numbers": {
                "$ref": "#/components/schemas/VirtualNumberPage"
              }
            }
          }
        }
      },
      "VirtualNumberDetailsResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_details"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "number": {
                "$ref": "#/components/schemas/VirtualNumberWithHistory"
              }
            }
          }
        }
      },
      "VirtualNumberUpdatedResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_cancelled",
              "virtual_number_reactivated"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "number": {
                "$ref": "#/components/schemas/VirtualNumber"
              }
            }
          }
        }
      },
      "SmsMessagesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_sms"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "messages": {
                "$ref": "#/components/schemas/SmsMessagePage"
              }
            }
          }
        }
      },
      "VirtualNumberChargesResponse": {
        "type": "object",
        "required": [
          "remark",
          "status",
          "message",
          "data"
        ],
        "properties": {
          "remark": {
            "type": "string",
            "enum": [
              "virtual_number_charges"
            ]
          },
          "status": {
            "type": "string",
            "const": "success"
          },
          "message": {
            "$ref": "#/components/schemas/SuccessMessage"
          },
          "data": {
            "type": "object",
            "properties": {
              "charges": {
                "$ref": "#/components/schemas/VirtualNumberChargePage"
              }
            }
          }
        }
      },
      "PaygWebhookPayload": {
        "type": "object",
        "required": [
          "iccid",
          "amount",
          "is_active",
          "sequence",
          "countries"
        ],
        "description": "Balance-change notification for a PAYG eSIM. The body carries no event name: treat every delivery as \"the current state of this eSIM\".",
        "properties": {
          "iccid": {
            "type": "string",
            "examples": [
              "8900000000000000000"
            ]
          },
          "amount": {
            "type": "number",
            "description": "Credit left on the eSIM (same as `data_credit`).",
            "examples": [
              3.79
            ]
          },
          "is_active": {
            "type": "boolean",
            "description": "false once remaining credit no longer covers the stop threshold."
          },
          "usage_as_of": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "sequence": {
            "type": "integer",
            "minimum": 1,
            "description": "Monotonic per eSIM; a retry carries the same value. Drop anything not greater than the last one you processed."
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "country": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "region": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "status": {
                  "type": "string"
                },
                "usage_bytes": {
                  "type": "integer",
                  "format": "int64"
                },
                "charged": {
                  "type": "number"
                }
              }
            }
          }
        },
        "examples": [
          {
            "iccid": "8900000000000000000",
            "amount": 3.79,
            "is_active": true,
            "usage_as_of": "2026-08-21T09:41:00+00:00",
            "sequence": 1,
            "countries": [
              {
                "country": null,
                "region": "PAYG-A",
                "status": "active",
                "usage_bytes": 0,
                "charged": 0
              }
            ]
          }
        ]
      },
      "GlobalPaygWebhookPayload": {
        "allOf": [
          {
            "type": "object",
            "required": [
              "event",
              "product",
              "sequence",
              "occurred_at"
            ],
            "properties": {
              "event": {
                "type": "string",
                "enum": [
                  "esim.created",
                  "esim.activated",
                  "esim.usage",
                  "esim.balance_low",
                  "esim.depleted",
                  "esim.topped_up",
                  "esim.paused",
                  "esim.resumed",
                  "esim.refund_pending",
                  "esim.refunded",
                  "esim.refund_failed",
                  "esim.topup_refunded",
                  "esim.failed",
                  "esim.terminated"
                ]
              },
              "product": {
                "type": "string",
                "const": "global_payg"
              },
              "sequence": {
                "type": "integer",
                "minimum": 1,
                "description": "Monotonic per eSIM; a retry carries the same value. Ignore anything not newer than what you have."
              },
              "occurred_at": {
                "type": "string",
                "format": "date-time"
              }
            }
          },
          {
            "$ref": "#/components/schemas/GlobalEsimSummary"
          }
        ],
        "description": "Global PAYG event: the event fields plus the eSIM object (without install data).",
        "examples": [
          {
            "event": "esim.usage",
            "product": "global_payg",
            "sequence": 7,
            "occurred_at": "2026-10-22T15:22:42+00:00",
            "iccid": "8900000000000000000",
            "status": "active",
            "data_paused": false,
            "currency": "XYC",
            "balance": 8.42,
            "spent": 1.58,
            "funded": 10,
            "refunded": 0,
            "esim_price": 1.8,
            "label": "Order 1042",
            "installed": true,
            "activated_at": "2026-10-22T15:14:02+00:00",
            "balance_as_of": "2026-10-22T15:22:30+00:00",
            "created_at": "2026-10-22T15:12:42+00:00"
          }
        ]
      }
    }
  }
}