{"openapi":"3.1.0","info":{"title":"esimapp device API","version":"1.0.0","summary":"Does my phone take an eSIM?","description":"Two APIs under one base URL. The **phone checker** (tags Phones and Brands) gives free, read-only answers to \"Does my phone take an eSIM?\", from the list behind esimapp.io/esim-compatible-phones. No key, cookie or session. The **Reseller API** (tag Reseller API) sells eSIMs from a prepaid balance and needs a key.\n\n**Terms.** Free to use. Please link to esimapp.io where you show the answer.\n\n**Rate limits of the phone checker.** 60 searches and 300 lookups a minute per IP: `GET /devices` counts as a search, every other checker request as a lookup. Past a limit the API answers 429 with `Retry-After` in seconds.\n\n**CORS of the phone checker.** Every answer carries `Access-Control-Allow-Origin: *`, so any site may call it from the browser. Scripts may read `ETag` and `Retry-After` (`Access-Control-Expose-Headers`), a preflight may ask for `If-None-Match` and `Content-Type` (`Access-Control-Allow-Headers`), and browsers keep a preflight's answer for a day (`Access-Control-Max-Age: 86400`).\n\n**Caching of the phone checker.** Successful answers are `Cache-Control: public, max-age=300` with a weak `ETag`; send it back in `If-None-Match` and an unchanged answer comes back as 304 with no body.\n\n**Reseller API.** Create a key in account settings and send it as `Authorization: Bearer esk_...` from your server. Keyed answers send no CORS headers, so a browser page cannot call them and a key must never ship in a page. Successful answers are `Cache-Control: private, no-store`. Limits are per key (120 reads, 30 orders and 30 usage reads a minute) and 500 orders per account in any rolling 24 hours. A key stops working the moment API access is switched off. Orders finish asynchronously: poll `GET /orders/{ref}` or receive a signed webhook (see Webhooks).\n\n**Envelope.** Every answer but this document and the QR image is wrapped: `{ \"ok\": true, \"data\": ... }`, or `{ \"ok\": false, \"error\": { \"code\", \"message\" } }`."},"servers":[{"url":"https://esimapp.io/api/v1"}],"tags":[{"name":"Phones","description":"Search the list, match a model code or name, read one phone or all of them."},{"name":"Brands","description":"The brands in the list."},{"name":"This document","description":"The description you are reading."},{"name":"Reseller API","description":"Sell eSIMs from a prepaid balance. Every operation needs `Authorization: Bearer <key>`; a key is created in account settings and shown once."},{"name":"Webhooks","description":"Signed events esimapp sends to the URL you set: order.ready, order.failed and order.refunded."}],"paths":{"/devices":{"get":{"operationId":"searchDevices","tags":["Phones"],"summary":"Search phones","description":"Phones whose brand, model, alias or model code matches `q`, best match first, each with its answer.\n\nCounts as a search: 60 requests a minute per IP.","parameters":[{"name":"q","in":"query","required":true,"example":"pixel 8","description":"Brand, model, alias or model code; part of a word is enough. Spaces at either end are ignored.","schema":{"type":"string","minLength":2,"maxLength":60}},{"name":"limit","in":"query","required":false,"example":3,"description":"How many phones at most, best match first.","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}},{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"The matching phones; an empty list when none matches.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SearchResult"},"example":{"ok":true,"data":[{"slug":"google-pixel-8","brand":"Google","model":"Pixel 8","esim":"yes"},{"slug":"google-pixel-8-pro","brand":"Google","model":"Pixel 8 Pro","esim":"yes"},{"slug":"google-pixel-8a","brand":"Google","model":"Pixel 8a","esim":"yes"}]}}}},"304":{"$ref":"#/components/responses/NotModified"},"400":{"$ref":"#/components/responses/BadQuery"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"search","requests":60,"windowSeconds":60}}},"/devices/match":{"get":{"operationId":"matchDeviceCode","tags":["Phones"],"summary":"Match a model code or name","description":"The phone a model code or name names exactly, for apps that know it. Model codes are matched first: a code may answer differently from its model (`codeAnswer`), for one sold in mainland China, say. When no code matches, a model name, or the brand and model name, is matched, and the phone answers as its model does (`codeAnswer` null). Whitespace at either end is ignored, and a run of spaces inside a name counts as one. A name that more than one model carries matches none (404); so does part of a code or name.\n\nCounts as a lookup: 300 requests a minute per IP.","parameters":[{"name":"code","in":"query","required":true,"example":"Pixel 8","description":"A model code, or a model name with or without its brand, matched whole and in any case: `SM-S911B`, `A3090`, `Pixel 8`, `iPhone 15`, `Apple iPhone 15`.","schema":{"type":"string","minLength":1,"maxLength":60}},{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"The phone, with the code or model name that matched and the code's own answer.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MatchResult"},"example":{"ok":true,"data":{"slug":"google-pixel-8","brand":"Google","model":"Pixel 8","esim":"yes","exceptions":[],"notes":null,"checkedAt":"2026-10-24","sourceUrl":"https://support.google.com/pixelphone/answer/7158570?hl=en","matchedCode":"Pixel 8","codeAnswer":null,"codeNote":null}}}}},"304":{"$ref":"#/components/responses/NotModified"},"400":{"$ref":"#/components/responses/BadQuery"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"read","requests":300,"windowSeconds":60}}},"/devices/index":{"get":{"operationId":"listDevices","tags":["Phones"],"summary":"Every phone, by brand","description":"Every phone the list knows, grouped by brand in the list's order. The example shows one phone a brand.\n\nCounts as a lookup: 300 requests a minute per IP.","parameters":[{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"Every brand with its phones.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/IndexResult"},"example":{"ok":true,"data":[{"slug":"apple","name":"Apple","models":[{"slug":"apple-iphone-15","brand":"Apple","model":"iPhone 15","esim":"depends","note":"The versions sold in mainland China, Hong Kong and Macao take two nano-SIM cards and have no eSIM."}]},{"slug":"google","name":"Google","models":[{"slug":"google-pixel-8","brand":"Google","model":"Pixel 8","esim":"yes","note":null}]}]}}}},"304":{"$ref":"#/components/responses/NotModified"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"read","requests":300,"windowSeconds":60}}},"/devices/{slug}":{"get":{"operationId":"getDevice","tags":["Phones"],"summary":"One phone","description":"One phone: its answer, where or which versions answer differently, a note, and the official source with the date it was checked.\n\nCounts as a lookup: 300 requests a minute per IP.","parameters":[{"name":"slug","in":"path","required":true,"example":"apple-iphone-15","description":"The phone's slug, from search or the index.","schema":{"type":"string","pattern":"^[a-z0-9-]{1,80}$","maxLength":80}},{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"The phone.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DetailResult"},"example":{"ok":true,"data":{"slug":"apple-iphone-15","brand":"Apple","model":"iPhone 15","esim":"depends","exceptions":[{"where":"Bought in mainland China, Hong Kong or Macao","esim":"no","sourceUrl":"https://support.apple.com/en-us/108898"},{"where":"Bought anywhere else","esim":"yes","sourceUrl":"https://support.apple.com/en-us/118669"}],"notes":"The versions sold in mainland China, Hong Kong and Macao take two nano-SIM cards and have no eSIM.","checkedAt":"2026-10-24","sourceUrl":"https://support.apple.com/en-us/111831"}}}}},"304":{"$ref":"#/components/responses/NotModified"},"400":{"$ref":"#/components/responses/BadQuery"},"404":{"$ref":"#/components/responses/NotFound"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"read","requests":300,"windowSeconds":60}}},"/brands":{"get":{"operationId":"listBrands","tags":["Brands"],"summary":"The brands","description":"The brands that have phones in the list, with how many each has.\n\nCounts as a lookup: 300 requests a minute per IP.","parameters":[{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"The brands.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BrandsResult"},"example":{"ok":true,"data":[{"slug":"apple","name":"Apple","models":37},{"slug":"samsung","name":"Samsung","models":61},{"slug":"google","name":"Google","models":32},{"slug":"oneplus","name":"OnePlus","models":3},{"slug":"xiaomi","name":"Xiaomi","models":4},{"slug":"oppo","name":"OPPO","models":5},{"slug":"huawei","name":"Huawei","models":5}]}}}},"304":{"$ref":"#/components/responses/NotModified"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"read","requests":300,"windowSeconds":60}}},"/openapi.json":{"get":{"operationId":"getOpenApiDocument","tags":["This document"],"summary":"This document","description":"This OpenAPI 3.1 description of the API, unwrapped (no envelope).\n\nCounts as a lookup: 300 requests a minute per IP.","parameters":[{"$ref":"#/components/parameters/IfNoneMatch"}],"responses":{"200":{"description":"The OpenAPI document.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}},"content":{"application/json":{"schema":{"type":"object","required":["openapi","info","paths"],"properties":{"openapi":{"const":"3.1.0"}}}}}},"304":{"$ref":"#/components/responses/NotModified"},"429":{"$ref":"#/components/responses/RateLimited"}},"x-rate-limit":{"name":"read","requests":300,"windowSeconds":60}}},"/balance":{"get":{"operationId":"getBalance","tags":["Reseller API"],"summary":"Your balance","description":"The balance orders are paid from, in cents, and whether staff have frozen it.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"responses":{"200":{"description":"The balance.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BalanceResult"},"example":{"ok":true,"data":{"balanceCents":12500,"frozen":false}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/catalog/destinations":{"get":{"operationId":"listDestinations","tags":["Reseller API"],"summary":"Destinations","description":"Every destination with plans: countries, regions and the global plans, each with how many plans it has and the price of the cheapest.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"responses":{"200":{"description":"The destinations.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationListResult"},"example":{"ok":true,"data":[{"slug":"japan","name":"Japan","kind":"country","planCount":4,"fromCents":39}]}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/catalog/destinations/{slug}":{"get":{"operationId":"getDestination","tags":["Reseller API"],"summary":"One destination and its plans","description":"The destination and its plans. A destination with no plan of its own answers with the plans of a wider region that cover it.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"example":"japan","description":"The destination's slug, from the destinations list.","schema":{"type":"string","pattern":"^[a-z0-9-]{1,64}$","maxLength":80}}],"responses":{"200":{"description":"The destination and its plans.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DestinationPlansResult"},"example":{"ok":true,"data":{"destination":{"slug":"japan","name":"Japan","kind":"country","planCount":4,"fromCents":39},"plans":[{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","kind":"country","countries":["JP"],"dataBytes":5368709120,"dataGb":5,"durationDays":30,"priceCents":845,"perGbCents":169,"networks":[{"name":"SoftBank","type":"5G"}],"activation":"on_first_connection","unlimited":false}]}}}}},"400":{"$ref":"#/components/responses/InvalidLink"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NoDestination"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/catalog/plans/{slug}":{"get":{"operationId":"getPlan","tags":["Reseller API"],"summary":"One plan","description":"One plan, with its price, data, duration, networks and when its validity starts.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"slug","in":"path","required":true,"example":"JP_5_30","description":"The plan's slug, from a destination's plans.","schema":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,80}$","maxLength":80}}],"responses":{"200":{"description":"The plan.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PlanResult"},"example":{"ok":true,"data":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","kind":"country","countries":["JP"],"dataBytes":5368709120,"dataGb":5,"durationDays":30,"priceCents":845,"perGbCents":169,"networks":[{"name":"SoftBank","type":"5G"}],"activation":"on_first_connection","unlimited":false}}}}},"400":{"$ref":"#/components/responses/InvalidLink"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NoPlan"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/orders":{"get":{"operationId":"listOrders","tags":["Reseller API"],"summary":"Your orders","description":"Your API orders, newest first, 20 to a page unless `limit` (1 to 100) says otherwise. `status` filters on the status shown here, and `reference` matches your label exactly. `meta.nextCursor` is an opaque string, or null on the last page.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"status","in":"query","required":false,"description":"Only orders in this status.","schema":{"$ref":"#/components/schemas/ResellerOrderStatus"}},{"name":"reference","in":"query","required":false,"description":"Only orders whose `reference` is exactly this.","schema":{"type":"string","minLength":1,"maxLength":64}},{"name":"limit","in":"query","required":false,"description":"How many orders at most, newest first.","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","required":false,"description":"The `meta.nextCursor` of the previous page. It is opaque: do not build one.","schema":{"type":"string","maxLength":200}}],"responses":{"200":{"description":"A page of orders.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderListResult"},"example":{"ok":true,"data":[{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"ready","readyAt":"2026-03-01T00:01:12.000Z","failedAt":null,"refundedAt":null,"esim":{"iccid":"8985200000000000017","activationCode":"LPA:1$rsp.example.com$K2-4F7C-8Q2W","smdpAddress":"rsp.example.com","matchingId":"K2-4F7C-8Q2W","iosInstallUrl":"https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24rsp.example.com%24K2-4F7C-8Q2W"}},{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"processing","readyAt":null,"failedAt":null,"refundedAt":null,"esim":null}],"meta":{"nextCursor":null}}}}},"400":{"$ref":"#/components/responses/InvalidLink"},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}},"post":{"operationId":"createOrder","tags":["Reseller API"],"summary":"Place an order","description":"Buys one plan at the website price from the balance. No discount, no tiers.\n\n**Idempotency.** `requestId` must be a UUID. Created answers 202 with the order `processing`; the eSIM follows once it is ready. Poll the order or listen for the webhook. Sending the same `requestId` and the same plan again answers 200 with the same order and its current status and never charges twice. That holds even after the plan leaves the catalogue, the daily limit is spent or sales pause, because a repeat is answered before those checks. A different plan, or a `requestId` a website order already used, answers 409 `REQUEST_ID_REUSED`.\n\n**Limits.** 30 orders a minute per key, and 500 orders in any rolling 24 hours per account. Past either, the answer is 429 `RATE_LIMITED` with `Retry-After`. Only created orders count.\n\n**Refusals.** 402 `INSUFFICIENT_BALANCE` carries the balance in `error.details.balanceCents`. 423 `WALLET_FROZEN`. 409 `PLAN_UNAVAILABLE`. 503 `SALES_PAUSED`. 403 `FORBIDDEN` when API access or your consent to the API terms is missing. Nothing is charged for a refusal.\n\nNo email goes to the customer: you deliver the eSIM.\n\nCounts against this key's order limit: 30 requests a minute per key.","security":[{"resellerKey":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderRequest"},"example":{"plan":"JP_5_30","requestId":"6f1c1d2e-3a4b-4c5d-8e6f-000000000001","reference":"bk-1042"}}}},"responses":{"200":{"description":"A repeat of an earlier order: the same order, with its current status. Nothing was charged.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"},"example":{"ok":true,"data":{"order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"ready","readyAt":"2026-03-01T00:01:12.000Z","failedAt":null,"refundedAt":null,"esim":{"iccid":"8985200000000000017","activationCode":"LPA:1$rsp.example.com$K2-4F7C-8Q2W","smdpAddress":"rsp.example.com","matchingId":"K2-4F7C-8Q2W","iosInstallUrl":"https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24rsp.example.com%24K2-4F7C-8Q2W"}}}}}}},"202":{"description":"The order was created and is `processing`.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"},"example":{"ok":true,"data":{"order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"processing","readyAt":null,"failedAt":null,"refundedAt":null,"esim":null}}}}}},"400":{"$ref":"#/components/responses/InvalidBody"},"401":{"$ref":"#/components/responses/Unauthorized"},"402":{"$ref":"#/components/responses/InsufficientBalance"},"403":{"$ref":"#/components/responses/Forbidden"},"409":{"$ref":"#/components/responses/OrderConflict"},"423":{"$ref":"#/components/responses/WalletFrozen"},"429":{"$ref":"#/components/responses/OrderRateLimited"},"503":{"$ref":"#/components/responses/SalesPaused"}},"x-rate-limit":{"name":"order","requests":30,"windowSeconds":60}}},"/orders/{ref}":{"get":{"operationId":"getOrder","tags":["Reseller API"],"summary":"One order","description":"One of your orders. The `esim` block appears only while the order is `ready`. Poll this, or listen for the `order.ready` webhook.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"example":"ES-7K3Q9XF2","description":"The order's `ref`, from the answer to `POST /orders`.","schema":{"type":"string","pattern":"^[A-Za-z0-9-]{1,40}$"}}],"responses":{"200":{"description":"The order.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrderResult"},"example":{"ok":true,"data":{"order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"ready","readyAt":"2026-03-01T00:01:12.000Z","failedAt":null,"refundedAt":null,"esim":{"iccid":"8985200000000000017","activationCode":"LPA:1$rsp.example.com$K2-4F7C-8Q2W","smdpAddress":"rsp.example.com","matchingId":"K2-4F7C-8Q2W","iosInstallUrl":"https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24rsp.example.com%24K2-4F7C-8Q2W"}}}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NoOrder"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/orders/{ref}/qr.png":{"get":{"operationId":"getOrderQr","tags":["Reseller API"],"summary":"The eSIM as a QR code","description":"A PNG QR code of the activation code, for a customer to scan from another screen. Only a `ready` order has one.\n\nCounts against this key's read limit: 120 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"example":"ES-7K3Q9XF2","description":"The order's `ref`, from the answer to `POST /orders`.","schema":{"type":"string","pattern":"^[A-Za-z0-9-]{1,40}$"}}],"responses":{"200":{"description":"The QR code.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"image/png":{"schema":{"type":"string","format":"binary"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NoOrder"},"409":{"$ref":"#/components/responses/NotReady"},"429":{"$ref":"#/components/responses/KeyRateLimited"}},"x-rate-limit":{"name":"read","requests":120,"windowSeconds":60}}},"/orders/{ref}/usage":{"get":{"operationId":"getOrderUsage","tags":["Reseller API"],"summary":"Data used","description":"How much data a `ready` order has used. The provider is asked at most once a minute per order, so a poll inside that minute repeats the last answer. A `PROVIDER_UNAVAILABLE` answer is temporary.\n\nCounts against this key's usage limit: 30 requests a minute per key.","security":[{"resellerKey":[]}],"parameters":[{"name":"ref","in":"path","required":true,"example":"ES-7K3Q9XF2","description":"The order's `ref`, from the answer to `POST /orders`.","schema":{"type":"string","pattern":"^[A-Za-z0-9-]{1,40}$"}}],"responses":{"200":{"description":"The usage.","headers":{"Cache-Control":{"$ref":"#/components/headers/NoStore"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UsageResult"},"example":{"ok":true,"data":{"usedBytes":1048576,"totalBytes":5368709120,"esimStatus":"IN_USE","activatedAt":"2026-03-02T00:00:00.000Z","expiresAt":"2026-04-01T00:00:00.000Z"}}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"$ref":"#/components/responses/Forbidden"},"404":{"$ref":"#/components/responses/NoOrder"},"409":{"$ref":"#/components/responses/NotReady"},"429":{"$ref":"#/components/responses/KeyRateLimited"},"503":{"$ref":"#/components/responses/ProviderUnavailable"}},"x-rate-limit":{"name":"usage","requests":30,"windowSeconds":60}}}},"webhooks":{"order.ready":{"post":{"operationId":"webhookOrderReady","tags":["Webhooks"],"summary":"order.ready","description":"The eSIM was delivered. `order.status` is `ready` and `order.esim` holds the profile.\n\nEsimapp POSTs the body to the webhook URL you set in account settings, as JSON with `User-Agent: esimapp-webhooks/1`. Answer with any 2xx within 10 seconds. Redirects are not followed, and the URL must be a public `https` address. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then dropped after the seventh attempt. A retry sends the same `id`. Events still queued when you change or clear the webhook URL, or when API access is switched off, are dropped, not sent.","parameters":[{"name":"Esimapp-Signature","in":"header","required":true,"example":"t=1772323272,v1=5c1b9e0a4f3d2c8b7a6e5d4c3b2a19080706050403020100ffeeddccbbaa9988","description":"`t=<unix seconds>,v1=<hex>`. `v1` is the hex HMAC-SHA256 of `\"<t>.<raw body>\"` under your webhook secret, computed over the exact bytes received. Compare it in constant time and reject a `t` more than five minutes from your clock.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"0b1f3c1e-6c0d-4c53-9a43-0d2d6a7c5e11","event":"order.ready","createdAt":"2026-03-01T00:01:12.500Z","order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"ready","readyAt":"2026-03-01T00:01:12.000Z","failedAt":null,"refundedAt":null,"esim":{"iccid":"8985200000000000017","activationCode":"LPA:1$rsp.example.com$K2-4F7C-8Q2W","smdpAddress":"rsp.example.com","matchingId":"K2-4F7C-8Q2W","iosInstallUrl":"https://esimsetup.apple.com/esim_qrcode_provisioning?carddata=LPA%3A1%24rsp.example.com%24K2-4F7C-8Q2W"}}}}}},"responses":{"200":{"description":"Any 2xx status counts as delivered."}}}},"order.failed":{"post":{"operationId":"webhookOrderFailed","tags":["Webhooks"],"summary":"order.failed","description":"The order ended without delivery, and the money is back in your balance. `order.status` is `failed`.\n\nEsimapp POSTs the body to the webhook URL you set in account settings, as JSON with `User-Agent: esimapp-webhooks/1`. Answer with any 2xx within 10 seconds. Redirects are not followed, and the URL must be a public `https` address. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then dropped after the seventh attempt. A retry sends the same `id`. Events still queued when you change or clear the webhook URL, or when API access is switched off, are dropped, not sent.","parameters":[{"name":"Esimapp-Signature","in":"header","required":true,"example":"t=1772323272,v1=5c1b9e0a4f3d2c8b7a6e5d4c3b2a19080706050403020100ffeeddccbbaa9988","description":"`t=<unix seconds>,v1=<hex>`. `v1` is the hex HMAC-SHA256 of `\"<t>.<raw body>\"` under your webhook secret, computed over the exact bytes received. Compare it in constant time and reject a `t` more than five minutes from your clock.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"0b1f3c1e-6c0d-4c53-9a43-0d2d6a7c5e11","event":"order.failed","createdAt":"2026-03-01T00:03:40.500Z","order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"failed","readyAt":null,"failedAt":"2026-03-01T00:03:40.000Z","refundedAt":null,"esim":null}}}}},"responses":{"200":{"description":"Any 2xx status counts as delivered."}}}},"order.refunded":{"post":{"operationId":"webhookOrderRefunded","tags":["Webhooks"],"summary":"order.refunded","description":"The order was refunded after delivery. `order.status` is `refunded` and `order.esim` is null.\n\nEsimapp POSTs the body to the webhook URL you set in account settings, as JSON with `User-Agent: esimapp-webhooks/1`. Answer with any 2xx within 10 seconds. Redirects are not followed, and the URL must be a public `https` address. Anything else is retried after 1 minute, 5 minutes, 30 minutes, 2 hours, 6 hours and 24 hours, then dropped after the seventh attempt. A retry sends the same `id`. Events still queued when you change or clear the webhook URL, or when API access is switched off, are dropped, not sent.","parameters":[{"name":"Esimapp-Signature","in":"header","required":true,"example":"t=1772323272,v1=5c1b9e0a4f3d2c8b7a6e5d4c3b2a19080706050403020100ffeeddccbbaa9988","description":"`t=<unix seconds>,v1=<hex>`. `v1` is the hex HMAC-SHA256 of `\"<t>.<raw body>\"` under your webhook secret, computed over the exact bytes received. Compare it in constant time and reject a `t` more than five minutes from your clock.","schema":{"type":"string","pattern":"^t=\\d+,v1=[0-9a-f]{64}$"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WebhookEvent"},"example":{"id":"0b1f3c1e-6c0d-4c53-9a43-0d2d6a7c5e11","event":"order.refunded","createdAt":"2026-03-04T09:30:00.500Z","order":{"ref":"ES-7K3Q9XF2","plan":{"slug":"JP_5_30","name":"Japan 5 GB 30 Days","dataBytes":5368709120,"durationDays":30},"priceCents":845,"reference":"bk-1042","createdAt":"2026-03-01T00:00:00.000Z","status":"refunded","readyAt":"2026-03-01T00:01:12.000Z","failedAt":null,"refundedAt":"2026-03-04T09:30:00.000Z","esim":null}}}}},"responses":{"200":{"description":"Any 2xx status counts as delivered."}}}}},"components":{"schemas":{"EsimAnswer":{"type":"string","enum":["yes","depends","no"],"description":"`yes`: supports eSIM. `depends`: depends on the version; the exceptions (and, for a model code, `codeAnswer`) say which. `no`: no eSIM."},"DeviceException":{"type":"object","additionalProperties":false,"required":["where","esim"],"properties":{"where":{"type":"string","description":"Where it was bought, or which version."},"esim":{"$ref":"#/components/schemas/EsimAnswer"},"sourceUrl":{"type":"string","format":"uri"}},"description":"One row where the answer differs. `sourceUrl` is present when the row has its own official source."},"DeviceSummary":{"type":"object","additionalProperties":false,"required":["slug","brand","model","esim"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9-]{1,80}$","description":"The phone's address in this API: `GET /devices/{slug}`."},"brand":{"type":"string","description":"The brand's name."},"model":{"type":"string","description":"The model's name, without the brand."},"esim":{"$ref":"#/components/schemas/EsimAnswer"}},"description":"A phone and its answer, as search lists it."},"DeviceDetail":{"type":"object","additionalProperties":false,"required":["slug","brand","model","esim","exceptions","notes","checkedAt","sourceUrl"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9-]{1,80}$","description":"The phone's address in this API: `GET /devices/{slug}`."},"brand":{"type":"string","description":"The brand's name."},"model":{"type":"string","description":"The model's name, without the brand."},"esim":{"$ref":"#/components/schemas/EsimAnswer"},"exceptions":{"type":"array","items":{"$ref":"#/components/schemas/DeviceException"},"description":"Where or which versions answer differently. Empty when every version answers alike."},"notes":{"type":["string","null"],"description":"A short note on the answer, or null."},"checkedAt":{"type":"string","format":"date","description":"When the answer was last checked against its source."},"sourceUrl":{"type":"string","format":"uri","description":"The manufacturer's page or official spec the answer comes from."}},"description":"One phone: its answer, the exceptions, a note and the source."},"DeviceMatch":{"type":"object","additionalProperties":false,"required":["slug","brand","model","esim","exceptions","notes","checkedAt","sourceUrl","matchedCode","codeAnswer","codeNote"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9-]{1,80}$","description":"The phone's address in this API: `GET /devices/{slug}`."},"brand":{"type":"string","description":"The brand's name."},"model":{"type":"string","description":"The model's name, without the brand."},"esim":{"$ref":"#/components/schemas/EsimAnswer"},"exceptions":{"type":"array","items":{"$ref":"#/components/schemas/DeviceException"},"description":"Where or which versions answer differently. Empty when every version answers alike."},"notes":{"type":["string","null"],"description":"A short note on the answer, or null."},"checkedAt":{"type":"string","format":"date","description":"When the answer was last checked against its source."},"sourceUrl":{"type":"string","format":"uri","description":"The manufacturer's page or official spec the answer comes from."},"matchedCode":{"type":"string","description":"The model code that matched, as the list writes it; for a match by name, the model name."},"codeAnswer":{"anyOf":[{"$ref":"#/components/schemas/EsimAnswer"},{"type":"null"}],"description":"This model code's own answer, or null when it answers as the model does (always, for a match by name)."},"codeNote":{"type":["string","null"],"description":"Where this model code is sold, or null."}},"description":"The phone a model code or name belongs to, with that code's own answer."},"IndexedDevice":{"type":"object","additionalProperties":false,"required":["slug","brand","model","esim","note"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9-]{1,80}$","description":"The phone's address in this API: `GET /devices/{slug}`."},"brand":{"type":"string","description":"The brand's name."},"model":{"type":"string","description":"The model's name, without the brand."},"esim":{"$ref":"#/components/schemas/EsimAnswer"},"note":{"type":["string","null"]}},"description":"A phone in the full list, with its note."},"BrandSummary":{"type":"object","additionalProperties":false,"required":["slug","name","models"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"models":{"type":"integer","minimum":1,"description":"How many phones of the brand the list knows."}},"description":"A brand that has phones in the list."},"BrandIndex":{"type":"object","additionalProperties":false,"required":["slug","name","models"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"models":{"type":"array","items":{"$ref":"#/components/schemas/IndexedDevice"}}},"description":"A brand and every phone of it the list knows."},"ErrorEnvelope":{"type":"object","additionalProperties":false,"required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","enum":["BAD_QUERY","NOT_FOUND","RATE_LIMITED"]},"message":{"type":"string","description":"A sentence for people; it never repeats what was sent."}}}},"description":"Every error: 400 `BAD_QUERY`, 404 `NOT_FOUND`, 429 `RATE_LIMITED`."},"SearchResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/DeviceSummary"},"maxItems":20}}},"MatchResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/DeviceMatch"}}},"DetailResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/DeviceDetail"}}},"IndexResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/BrandIndex"}}}},"BrandsResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/BrandSummary"}}}},"ResellerError":{"type":"object","additionalProperties":false,"required":["ok","error"],"properties":{"ok":{"const":false},"error":{"type":"object","additionalProperties":false,"required":["code","message"],"properties":{"code":{"type":"string","enum":["UNAUTHORIZED","FORBIDDEN","VALIDATION","NOT_FOUND","NOT_READY","INSUFFICIENT_BALANCE","PLAN_UNAVAILABLE","REQUEST_ID_REUSED","WALLET_FROZEN","SALES_PAUSED","RATE_LIMITED","PROVIDER_UNAVAILABLE"]},"message":{"type":"string","description":"A sentence for people; it never repeats what was sent."},"details":{"type":"object","additionalProperties":false,"required":["balanceCents"],"properties":{"balanceCents":{"type":"integer","minimum":0,"description":"The balance now, in cents."}},"description":"Only on 402 `INSUFFICIENT_BALANCE`."}}}},"description":"Every keyed error. The HTTP status and `error.code` say what went wrong; `error.message` is for people."},"Balance":{"type":"object","additionalProperties":false,"required":["balanceCents","frozen"],"properties":{"balanceCents":{"type":"integer","description":"What orders are paid from, in US cents."},"frozen":{"type":"boolean","description":"True while staff have frozen the balance: orders then answer 423 `WALLET_FROZEN`."}},"description":"The account's balance."},"PackageKind":{"type":"string","enum":["country","regional","global"],"description":"A single country, a region, or the whole world."},"ResellerDestination":{"type":"object","additionalProperties":false,"required":["slug","name","kind","planCount","fromCents"],"properties":{"slug":{"type":"string","pattern":"^[a-z0-9-]{1,64}$","description":"The destination's address: `GET /catalog/destinations/{slug}`."},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/PackageKind"},"planCount":{"type":"integer","minimum":0,"description":"How many plans the destination has."},"fromCents":{"type":["integer","null"],"minimum":0,"description":"The cheapest plan's price in cents, or null when there is none."}},"description":"A place with plans to sell."},"ResellerPlan":{"type":"object","additionalProperties":false,"required":["slug","name","kind","countries","dataBytes","dataGb","durationDays","priceCents","perGbCents","unlimited","networks","activation"],"properties":{"slug":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,80}$","description":"Send this as `plan` to `POST /orders`."},"name":{"type":"string"},"kind":{"$ref":"#/components/schemas/PackageKind"},"countries":{"type":"array","items":{"type":"string"},"description":"ISO country codes the plan works in."},"dataBytes":{"type":"integer","minimum":1,"description":"The data allowance in bytes. On an unlimited plan, the provider's stand-in for no limit: read `unlimited`."},"dataGb":{"type":"number","description":"The data allowance in GB. On an unlimited plan, 999, the provider's stand-in for no limit: read `unlimited`."},"durationDays":{"type":"integer","minimum":1},"priceCents":{"type":"integer","minimum":0,"description":"What an order costs: the website price, in US cents."},"perGbCents":{"type":["integer","null"],"minimum":0,"description":"The price of one GB at this plan, in cents, or null on an unlimited plan."},"unlimited":{"type":"boolean","description":"The plan has no data limit. Its name says when its speed is capped."},"networks":{"type":"array","description":"The networks the plan uses.","items":{"type":"object","additionalProperties":false,"required":["name","type"],"properties":{"name":{"type":"string"},"type":{"type":"string","description":"For example `4G` or `5G`."}}}},"activation":{"type":["string","null"],"enum":["on_install","on_first_connection","on_purchase"],"description":"When the plan's validity starts, or null when unknown. A plan whose validity starts `on_purchase` can't be cancelled once bought."}},"description":"A plan you can order."},"DestinationPlans":{"type":"object","additionalProperties":false,"required":["destination","plans"],"properties":{"destination":{"$ref":"#/components/schemas/ResellerDestination"},"plans":{"type":"array","items":{"$ref":"#/components/schemas/ResellerPlan"},"description":"The destination's plans, or the plans of a wider region that cover it when it has none of its own."}}},"ResellerOrderStatus":{"type":"string","enum":["processing","ready","failed","refunded"],"description":"`processing`: paid, the eSIM is being made. `ready`: delivered. `failed`: it ended without delivery and the money is back in the balance. `refunded`: refunded after delivery."},"ResellerEsim":{"type":"object","additionalProperties":false,"required":["iccid","activationCode","smdpAddress","matchingId","iosInstallUrl"],"properties":{"iccid":{"type":"string"},"activationCode":{"type":"string","description":"The full `LPA:1$...` string a phone installs, or a QR code of it."},"smdpAddress":{"type":"string","description":"The SM-DP+ address, the second part of the activation code."},"matchingId":{"type":["string","null"],"description":"The matching id, the third part of the activation code, or null when it has none."},"iosInstallUrl":{"type":"string","format":"uri","description":"Opens the install screen on an iPhone with iOS 17.4 or later."}},"description":"The profile to install. Treat it as a secret: anyone who holds the activation code can install it once."},"ResellerOrder":{"type":"object","additionalProperties":false,"required":["ref","status","plan","priceCents","reference","createdAt","readyAt","failedAt","refundedAt","esim"],"properties":{"ref":{"type":"string","description":"The order's reference in this API: `GET /orders/{ref}`."},"status":{"$ref":"#/components/schemas/ResellerOrderStatus"},"plan":{"type":"object","additionalProperties":false,"required":["slug","name","dataBytes","durationDays"],"properties":{"slug":{"type":"string"},"name":{"type":"string"},"dataBytes":{"type":"integer"},"durationDays":{"type":"integer"}},"description":"The plan as it was when the order was placed."},"priceCents":{"type":"integer","minimum":0,"description":"What the order cost, in cents."},"reference":{"type":["string","null"],"description":"Your own label, as you sent it, or null."},"createdAt":{"type":"string","format":"date-time","description":"When the order was placed."},"readyAt":{"type":["string","null"],"format":"date-time","description":"When the eSIM was delivered."},"failedAt":{"type":["string","null"],"format":"date-time","description":"When the order ended without delivery."},"refundedAt":{"type":["string","null"],"format":"date-time","description":"When the order was refunded after delivery."},"esim":{"anyOf":[{"$ref":"#/components/schemas/ResellerEsim"},{"type":"null"}],"description":"Present only while the order is `ready`. A refunded order no longer hands the profile out."}},"description":"An order, as the API and the webhooks show it."},"OrderData":{"type":"object","additionalProperties":false,"required":["order"],"properties":{"order":{"$ref":"#/components/schemas/ResellerOrder"}}},"OrderPage":{"type":"object","additionalProperties":false,"required":["nextCursor"],"properties":{"nextCursor":{"type":["string","null"],"description":"Pass it as `cursor` for the next page; null on the last page."}}},"ResellerUsage":{"type":"object","additionalProperties":false,"required":["usedBytes","totalBytes","esimStatus","activatedAt","expiresAt"],"properties":{"usedBytes":{"type":["integer","null"],"minimum":0},"totalBytes":{"type":"integer","minimum":0},"esimStatus":{"type":["string","null"],"description":"The provider's state of the eSIM, such as `IN_USE`."},"activatedAt":{"type":["string","null"],"format":"date-time","description":"When the eSIM was first used."},"expiresAt":{"type":["string","null"],"format":"date-time","description":"When the plan ends."}},"description":"Data used on a ready order. The provider is read at most once a minute per order."},"OrderRequest":{"type":"object","additionalProperties":false,"required":["plan","requestId"],"properties":{"plan":{"type":"string","pattern":"^[A-Za-z0-9_.-]{1,80}$","description":"A plan slug from the catalogue."},"requestId":{"type":"string","format":"uuid","description":"Your idempotency key. Use a new UUID for each order and send the same one again to retry."},"reference":{"type":["string","null"],"minLength":1,"maxLength":64,"description":"Your own label, 1 to 64 printable characters. It comes back on the order and in webhooks."}},"description":"No other field is accepted."},"WebhookEventName":{"type":"string","enum":["order.ready","order.failed","order.refunded"]},"WebhookEvent":{"type":"object","additionalProperties":false,"required":["id","event","createdAt","order"],"properties":{"id":{"type":"string","format":"uuid","description":"The delivery's id. A retry sends the same id, so use it to ignore a repeat."},"event":{"$ref":"#/components/schemas/WebhookEventName"},"createdAt":{"type":"string","format":"date-time","description":"When the event was queued."},"order":{"$ref":"#/components/schemas/ResellerOrder"}},"description":"The body of every webhook."},"BalanceResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/Balance"}}},"DestinationListResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ResellerDestination"}}}},"DestinationPlansResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/DestinationPlans"}}},"PlanResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ResellerPlan"}}},"OrderResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/OrderData"}}},"OrderListResult":{"type":"object","additionalProperties":false,"required":["ok","data","meta"],"properties":{"ok":{"const":true},"data":{"type":"array","items":{"$ref":"#/components/schemas/ResellerOrder"}},"meta":{"$ref":"#/components/schemas/OrderPage"}}},"UsageResult":{"type":"object","additionalProperties":false,"required":["ok","data"],"properties":{"ok":{"const":true},"data":{"$ref":"#/components/schemas/ResellerUsage"}}}},"headers":{"AllowOrigin":{"description":"Every answer may be read from any site.","required":true,"schema":{"const":"*"}},"ExposeHeaders":{"description":"Browser code may read these headers too.","required":true,"schema":{"const":"Retry-After, ETag"}},"CacheControl":{"description":"Cacheable for five minutes, by shared caches too.","required":true,"schema":{"const":"public, max-age=300"}},"ETag":{"description":"A weak validator: send it back in `If-None-Match` for a 304.","required":true,"schema":{"type":"string","pattern":"^W/\".+\"$"}},"RetryAfter":{"description":"Seconds until the window has room again.","required":true,"schema":{"type":"integer","minimum":1}},"NoStore":{"description":"Successful keyed answers are not cached.","required":true,"schema":{"const":"private, no-store"}}},"parameters":{"IfNoneMatch":{"name":"If-None-Match","in":"header","required":false,"schema":{"type":"string"},"description":"The ETag of an earlier answer: when it still matches, the API answers 304 with no body."}},"responses":{"NotModified":{"description":"Not modified: the `If-None-Match` matched. No body.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Cache-Control":{"$ref":"#/components/headers/CacheControl"},"ETag":{"$ref":"#/components/headers/ETag"}}},"BadQuery":{"description":"A query or path parameter is missing or out of bounds.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"ok":false,"error":{"code":"BAD_QUERY","message":"Check the request: q takes 2 to 60 characters, limit 1 to 20, code 1 to 60, and a slug lower-case letters, digits and hyphens."}}}}},"NotFound":{"description":"The list does not know this phone yet.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"ok":false,"error":{"code":"NOT_FOUND","message":"We don't know this phone yet."}}}}},"RateLimited":{"description":"Too many requests from this IP in the last minute.","headers":{"Access-Control-Allow-Origin":{"$ref":"#/components/headers/AllowOrigin"},"Access-Control-Expose-Headers":{"$ref":"#/components/headers/ExposeHeaders"},"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorEnvelope"},"example":{"ok":false,"error":{"code":"RATE_LIMITED","message":"Too many requests. Please wait a moment and try again."}}}}},"Unauthorized":{"description":"The key is missing, malformed, unknown or revoked. More than 30 of these a minute from one address answer 429.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"unauthorized":{"value":{"ok":false,"error":{"code":"UNAUTHORIZED","message":"Send a valid API key as \"Authorization: Bearer <key>\"."}}}}}}},"Forbidden":{"description":"The key is real but its account may not use the API: access is switched off, switched off by esimapp, or the account is closed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"forbidden":{"value":{"ok":false,"error":{"code":"FORBIDDEN","message":"API access is not available for this account."}}}}}}},"KeyRateLimited":{"description":"More requests than this key's limit in the last minute, or too many failed key checks from this address. Wait `Retry-After` seconds.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"limited":{"value":{"ok":false,"error":{"code":"RATE_LIMITED","message":"Too many requests. Please wait a moment and try again."}}}}}}},"OrderRateLimited":{"description":"More orders than this key's limit in the last minute, or than the account's limit for a rolling day. Wait `Retry-After` seconds.","headers":{"Retry-After":{"$ref":"#/components/headers/RetryAfter"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"perKey":{"value":{"ok":false,"error":{"code":"RATE_LIMITED","message":"Too many requests. Please wait a moment and try again."}}},"daily":{"value":{"ok":false,"error":{"code":"RATE_LIMITED","message":"This account has reached its daily order limit. Please try again later."}}}}}}},"InvalidLink":{"description":"A path or query parameter is not valid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"invalid":{"value":{"ok":false,"error":{"code":"VALIDATION","message":"That link is not valid."}}}}}}},"InvalidBody":{"description":"The body is not valid: a missing or misspelt field, a requestId that is not a UUID, or a field this API does not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"invalid":{"value":{"ok":false,"error":{"code":"VALIDATION","message":"The request is not valid."}}}}}}},"NoDestination":{"description":"No destination has this slug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"missing":{"value":{"ok":false,"error":{"code":"NOT_FOUND","message":"We could not find that destination."}}}}}}},"NoPlan":{"description":"No plan has this slug.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"missing":{"value":{"ok":false,"error":{"code":"NOT_FOUND","message":"We could not find that plan."}}}}}}},"NoOrder":{"description":"No order of this account has this ref. An order of another account, or one placed on the website, answers the same.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"missing":{"value":{"ok":false,"error":{"code":"NOT_FOUND","message":"We could not find that order."}}}}}}},"NotReady":{"description":"The order is not `ready`: it is still processing, or it ended without an eSIM.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"notReady":{"value":{"ok":false,"error":{"code":"NOT_READY","message":"This order is not ready yet."}}}}}}},"ProviderUnavailable":{"description":"The provider could not answer just now. Try again shortly.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"unavailable":{"value":{"ok":false,"error":{"code":"PROVIDER_UNAVAILABLE","message":"Usage cannot be read right now. Please try again shortly."}}}}}}},"InsufficientBalance":{"description":"The balance does not cover the plan. Nothing was charged and no order was made.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"short":{"value":{"ok":false,"error":{"code":"INSUFFICIENT_BALANCE","message":"Your balance does not cover this plan.","details":{"balanceCents":300}}}}}}}},"OrderConflict":{"description":"The plan cannot be sold, or the requestId belongs to another purchase.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"planUnavailable":{"value":{"ok":false,"error":{"code":"PLAN_UNAVAILABLE","message":"This plan is not available right now."}}},"requestIdReused":{"value":{"ok":false,"error":{"code":"REQUEST_ID_REUSED","message":"This requestId was already used for a different purchase."}}}}}}},"WalletFrozen":{"description":"Staff have frozen the balance.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"frozen":{"value":{"ok":false,"error":{"code":"WALLET_FROZEN","message":"Your balance cannot be used right now. Please contact support."}}}}}}},"SalesPaused":{"description":"Sales are paused for a short while.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResellerError"},"examples":{"paused":{"value":{"ok":false,"error":{"code":"SALES_PAUSED","message":"Sales are paused for a short while. Please try again later."}}}}}}}},"securitySchemes":{"resellerKey":{"type":"http","scheme":"bearer"}}}}