{
  "openapi": "3.0.3",
  "info": {
    "title": "OniCode Reseller API",
    "version": "1.0.0",
    "description": "The API your own server calls to buy numbers, read their codes and manage your dollar balance.\n\n- **Base path:** `/reseller/v1`.\n- **Authentication:** every request sends `Authorization: Bearer <key>`, the Reseller API key from the website's\n  reseller section (`ocr_…`, shown once when it is created; creating a new key revokes the old one at once).\n  A missing, unknown, revoked or suspended key gets `401 unauthenticated` (as does a key whose account is blocked\n  or deleted). A key with an IP allowlist, used from an address outside it, gets `403 reseller_ip_not_allowed`.\n  HTTPS only. Never send your key over plain http: if you ever did, create a new key at once. When you create a\n  new key, switch your servers to it at once: requests still sending the old key get `401`, and 20 failed authentications a minute from one address pause that address\n  for up to a minute.\n- **Rate limits:** past 50 requests a second per key and client address (an IPv6 client counts by its /64), or\n  after 20 failed authentications a minute from one address, requests get `429 rate_limited` with a\n  `Retry-After` header and `retryAfterSeconds`. Past the per-key limit a 10-second block follows for that key\n  and address: every request during it gets the same 429 with the seconds left, and none lengthens it. The\n  Reseller's own rate (50 a second across all its addresses) answers 429 without a block: retry after\n  `Retry-After`. Buys (`createOrder`) and cancels (`cancelOrder`) have their own per-second limits (10 each),\n  with no block.\n- **Limits and blocks:** at most a set number of numbers wait for a code at once, and a service in a country (or\n  the whole account) is blocked for a while after too few codes; `removeLimits` lifts the blocks a few times a UTC\n  day. `getLimits` gives the rules, the current numbers and the blocks now.\n- **Levels:** the top-ups credited in the previous UTC week set this week's level, and its discount is already in\n  every price (`getLevel`).\n- **Webhooks:** set one https URL in the website's reseller section. Each event is a POST with a JSON body\n  `{type, timestamp, data}` and the Standard Webhooks headers `webhook-id` (the same on every retry: deduplicate\n  on it), `webhook-timestamp` (Unix seconds) and `webhook-signature` (`v1,` + Base64 HMAC-SHA256 of\n  `id.timestamp.body`, keyed with the Base64-decoded part of the secret after `whsec_`). Verify with any\n  Standard Webhooks library and refuse a timestamp more than 5 minutes off. Answer 2xx within 10 seconds;\n  anything else, redirects included (never followed), is retried by default after 5 s, 30 s, 2 min, 10 min,\n  30 min, 1 h, 2 h, 4 h, 8 h and 8 h, then given up. Deliveries can arrive out of order and more than once, and\n  a completed order may still get a later `order.sms_received`. The event bodies are under Webhooks below.\n- **Money** is the `Money` schema in US dollars: `amountMicros` is 1e-6 of a dollar (1.50 USD = 1500000) and\n  `currency` is `USD`. Never a float.\n- **Prices** are the Reseller's own, in USD (`listPrices`), charged to the Reseller wallet. A number that gets no\n  code (cancelled, expired or failed) is refunded in full.\n- **Idempotency:** buying (`createOrder`) and cancelling (`cancelOrder`) require an `Idempotency-Key` header, a\n  unique value per action (a UUID). Retrying with the same key returns the same result and never charges twice;\n  the same key with a different request is `idempotency_key_reused`.\n- **Errors** are `application/problem+json` (RFC 9457) with a stable `code`. Branch on `code`, never on `title`\n  or `detail`.\n- **Lists** use cursor pagination: `?cursor=&limit=` returns `{ items, nextCursor }`; send `nextCursor` back as\n  `cursor` until it is absent.\n- JSON fields are camelCase. IDs are opaque strings. Timestamps are RFC 3339 UTC.\n"
  },
  "servers": [
    {
      "url": "https://reseller-api.oni-code.com",
      "description": "Production"
    },
    {
      "url": "http://localhost:8080",
      "description": "Local development"
    }
  ],
  "security": [
    {
      "resellerKey": []
    }
  ],
  "x-webhooks": {
    "orderSmsReceived": {
      "post": {
        "operationId": "orderSmsReceivedEvent",
        "summary": "order.sms_received",
        "description": "A message arrived for an order (the first included).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "order.sms_received"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the message was received."
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "orderId",
                      "serviceId",
                      "countryId",
                      "status",
                      "message"
                    ],
                    "properties": {
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "customerRef": {
                        "type": "string",
                        "description": "Your reference for the order; absent when none."
                      },
                      "serviceId": {
                        "type": "string"
                      },
                      "countryId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "description": "The order's status now."
                      },
                      "message": {
                        "type": "object",
                        "required": [
                          "text",
                          "receivedAt"
                        ],
                        "properties": {
                          "code": {
                            "type": "string",
                            "description": "The verification code; absent when none."
                          },
                          "text": {
                            "type": "string"
                          },
                          "receivedAt": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "example": {
                "type": "order.sms_received",
                "timestamp": "2026-11-16T10:31:00Z",
                "data": {
                  "orderId": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a01",
                  "customerRef": "user-4711",
                  "serviceId": "whatsapp",
                  "countryId": "ID",
                  "status": "completed",
                  "message": {
                    "code": "123456",
                    "text": "Your WhatsApp code: 123456",
                    "receivedAt": "2026-11-16T10:31:00Z"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx ends the delivery."
          }
        }
      }
    },
    "orderClosed": {
      "post": {
        "operationId": "orderClosedEvent",
        "summary": "order.closed",
        "description": "An order reached a final status. `refunded` is 0 for `completed` and the whole price otherwise.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "order.closed"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When the order closed."
                  },
                  "data": {
                    "type": "object",
                    "required": [
                      "orderId",
                      "serviceId",
                      "countryId",
                      "status",
                      "refunded",
                      "closedAt"
                    ],
                    "properties": {
                      "orderId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "customerRef": {
                        "type": "string",
                        "description": "Your reference for the order; absent when none."
                      },
                      "serviceId": {
                        "type": "string"
                      },
                      "countryId": {
                        "type": "string"
                      },
                      "status": {
                        "type": "string",
                        "enum": [
                          "completed",
                          "cancelled",
                          "expired",
                          "failed"
                        ]
                      },
                      "refunded": {
                        "type": "object",
                        "description": "0 for completed; the whole price otherwise.",
                        "required": [
                          "amountMicros",
                          "currency"
                        ],
                        "properties": {
                          "amountMicros": {
                            "type": "integer",
                            "format": "int64",
                            "description": "1e-6 of a US dollar."
                          },
                          "currency": {
                            "type": "string",
                            "example": "USD"
                          }
                        }
                      },
                      "closedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              },
              "example": {
                "type": "order.closed",
                "timestamp": "2026-11-16T10:40:00Z",
                "data": {
                  "orderId": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a02",
                  "serviceId": "whatsapp",
                  "countryId": "ID",
                  "status": "expired",
                  "refunded": {
                    "amountMicros": 250000,
                    "currency": "USD"
                  },
                  "closedAt": "2026-11-16T10:40:00Z"
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx ends the delivery."
          }
        }
      }
    },
    "webhookTest": {
      "post": {
        "operationId": "webhookTestEvent",
        "summary": "webhook.test",
        "description": "Sent only by the Send test button in the website's reseller section; once, never retried. `data` is empty.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "type",
                  "timestamp",
                  "data"
                ],
                "properties": {
                  "type": {
                    "type": "string",
                    "enum": [
                      "webhook.test"
                    ]
                  },
                  "timestamp": {
                    "type": "string",
                    "format": "date-time",
                    "description": "When it was sent."
                  },
                  "data": {
                    "type": "object"
                  }
                }
              },
              "example": {
                "type": "webhook.test",
                "timestamp": "2026-11-16T10:00:00Z",
                "data": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Any 2xx ends the delivery."
          }
        }
      }
    }
  },
  "tags": [
    {
      "name": "wallet",
      "description": "The Reseller wallet's balance and its ledger, in US dollars."
    },
    {
      "name": "orders",
      "description": "Prices, buying a number, its code, cancelling."
    },
    {
      "name": "level",
      "description": "The weekly level and the discount it gives."
    },
    {
      "name": "limits",
      "description": "Limits, blocks and lifting the blocks."
    }
  ],
  "paths": {
    "/reseller/v1/wallet": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "getWallet",
        "summary": "The Reseller wallet's balance",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The wallet.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Wallet"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/wallet/entries": {
      "get": {
        "tags": [
          "wallet"
        ],
        "operationId": "listWalletEntries",
        "summary": "The Reseller wallet's ledger entries, newest first",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of ledger entries.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerEntryPage"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/services/{serviceId}/prices": {
      "get": {
        "tags": [
          "orders"
        ],
        "operationId": "listPrices",
        "summary": "A service's prices per country, at the Reseller's own price",
        "description": "The website's price tiers for the service in each country, each at the Reseller's own price in USD. Read from\nthe offer cache, so about a minute old. Buy a tier by sending its `price` to `createOrder`.\n",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/ServiceId"
          }
        ],
        "responses": {
          "200": {
            "description": "The prices.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PriceList"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "not_found",
          "provider_unavailable",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/orders": {
      "post": {
        "tags": [
          "orders"
        ],
        "operationId": "createOrder",
        "summary": "Buy a number",
        "description": "Charges exactly `price` (a tier's `price` from `listPrices`) to the Reseller wallet and assigns a number.\nNever charged more: when the cheapest price now is above `price`, nothing is charged and the answer is\n`price_changed` with `currentPrice`. With no number at that price, nothing is charged (`no_numbers_available`).\nRetrying with the same `Idempotency-Key` and the same request returns the same order (or the same failure) and\nnever charges twice; the same key with another `serviceId`, `countryId`, `price` or `customerRef` is\n`idempotency_key_reused`. At most `limit` numbers wait for a code at once (`reseller_concurrency_limit`,\nnothing charged). While the service in that country is blocked (`reseller_pair_blocked`) or every purchase is\n(`reseller_account_blocked`), nothing is charged; both carry `blockedUntil` (see `getLimits`). A number that\ngets no code before `expiresAt` is refunded in full.\n",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrderRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The order, normally in `waiting_sms` with a phone number.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "not_found",
          "reseller_insufficient_balance",
          "no_numbers_available",
          "price_changed",
          "reseller_concurrency_limit",
          "reseller_pair_blocked",
          "reseller_account_blocked",
          "idempotency_key_reused",
          "provider_unavailable",
          "rate_limited"
        ]
      },
      "get": {
        "tags": [
          "orders"
        ],
        "operationId": "listOrders",
        "summary": "The Reseller's orders, newest first",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "name": "status",
            "in": "query",
            "description": "Only orders in one of these statuses.",
            "schema": {
              "type": "array",
              "items": {
                "$ref": "#/components/schemas/OrderStatus"
              }
            },
            "style": "form",
            "explode": true
          },
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/Limit"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of orders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrderPage"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/orders/active": {
      "get": {
        "tags": [
          "orders"
        ],
        "operationId": "listActiveOrders",
        "summary": "Numbers waiting for a code, and ones completed in the last rental",
        "description": "Poll it while numbers wait for their codes, rather than each order apart. Use `serverTime` for countdowns.",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/Cursor"
          },
          {
            "$ref": "#/components/parameters/ActiveLimit"
          }
        ],
        "responses": {
          "200": {
            "description": "Active orders.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ActiveOrders"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/orders/{orderId}": {
      "get": {
        "tags": [
          "orders"
        ],
        "operationId": "getOrder",
        "summary": "One order",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/OrderId"
          }
        ],
        "responses": {
          "200": {
            "description": "The order.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "not_found",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/orders/{orderId}/cancel": {
      "post": {
        "tags": [
          "orders"
        ],
        "operationId": "cancelOrder",
        "summary": "Cancel a waiting number and refund its price",
        "description": "Allowed from `cancelAvailableAt` (before it: `cancel_not_available_yet` with `cancelAvailableAt`) until a code\narrives (then: `order_not_cancellable`). The whole price comes back to the Reseller wallet. Cancelling a\ncancelled order returns it as it is.\n",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/IdempotencyKey"
          },
          {
            "$ref": "#/components/parameters/OrderId"
          }
        ],
        "responses": {
          "200": {
            "description": "The order after cancellation (or as it is, if a code arrived first).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Order"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "validation_failed",
          "unauthenticated",
          "reseller_ip_not_allowed",
          "not_found",
          "order_not_cancellable",
          "cancel_not_available_yet",
          "provider_unavailable",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/level": {
      "get": {
        "tags": [
          "level"
        ],
        "operationId": "getLevel",
        "summary": "The Reseller's level this week, the levels table and this week's top-ups",
        "description": "The top-ups credited in the previous UTC week (Monday 00:00 to Monday 00:00 UTC) set this week's level, which\nholds until next Monday, unless the OniCode team pinned one (`pinned`). Every price the API returns is already\nthe Reseller's own, the level's discount included.\n",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The level.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Level"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/limits": {
      "get": {
        "tags": [
          "limits"
        ],
        "operationId": "getLimits",
        "summary": "The Reseller's limits and the blocks now",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The limits.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Limits"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited"
        ]
      }
    },
    "/reseller/v1/limits/remove": {
      "post": {
        "tags": [
          "limits"
        ],
        "operationId": "removeLimits",
        "summary": "Lift every block now (\"Remove limits\")",
        "description": "Lifts every block in force (each blocked service and country, and an account block) and counts one use;\n`removalsPerDay` uses a UTC day. With no block to lift, nothing is counted and the limits come back as they\nare. With no use left today: `reseller_limit_removals_exhausted` with `retryAfterSeconds` to the next 00:00\nUTC (absent when `removalsPerDay` is 0: removing is never possible), and nothing is lifted. The request rate and the numbers waiting at once can't be lifted. After a removal,\na service in a country counts its numbers from the removal on.\n",
        "security": [
          {
            "resellerKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The limits after the removal.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Limits"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "default": {
            "$ref": "#/components/responses/Problem"
          }
        },
        "x-error-codes": [
          "unauthenticated",
          "reseller_ip_not_allowed",
          "rate_limited",
          "reseller_limit_removals_exhausted"
        ]
      }
    }
  },
  "components": {
    "securitySchemes": {
      "resellerKey": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "ocr_ key",
        "description": "The reseller's API key, from the website's reseller section."
      }
    },
    "parameters": {
      "IdempotencyKey": {
        "name": "Idempotency-Key",
        "in": "header",
        "required": true,
        "description": "A unique value per action (UUID recommended). Reuse it only to retry the same request.",
        "schema": {
          "type": "string",
          "minLength": 8,
          "maxLength": 128,
          "example": "4f2c1a9e-6b1d-4c7a-9b0e-2f5d8c3a1e77"
        }
      },
      "ServiceId": {
        "name": "serviceId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$",
          "example": "whatsapp"
        }
      },
      "OrderId": {
        "name": "orderId",
        "in": "path",
        "required": true,
        "schema": {
          "type": "string",
          "format": "uuid"
        }
      },
      "Cursor": {
        "name": "cursor",
        "in": "query",
        "description": "Opaque cursor from a previous page's `nextCursor`.",
        "schema": {
          "type": "string",
          "maxLength": 200
        }
      },
      "Limit": {
        "name": "limit",
        "in": "query",
        "description": "Items per page. More than 50 is `validation_failed`.",
        "schema": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 50,
          "default": 20
        }
      },
      "ActiveLimit": {
        "name": "limit",
        "in": "query",
        "description": "Items per page. More than 100 is `validation_failed`.",
        "schema": {
          "type": "integer",
          "format": "int32",
          "minimum": 1,
          "maximum": 100,
          "default": 100
        }
      }
    },
    "responses": {
      "Problem": {
        "description": "Error (RFC 9457). Branch on `code`.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "RateLimited": {
        "description": "A 429: `rate_limited`, or `reseller_limit_removals_exhausted` on `removeLimits`. When a wait applies, the\n`Retry-After` header and `retryAfterSeconds` give the seconds to wait. Both are absent when no wait helps:\n`reseller_limit_removals_exhausted` with `removalsPerDay` 0 (removing is never possible).\n",
        "headers": {
          "Retry-After": {
            "description": "Seconds to wait before the next request.",
            "schema": {
              "type": "integer",
              "format": "int32",
              "minimum": 0
            }
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "schemas": {
      "Problem": {
        "type": "object",
        "description": "RFC 9457 problem details. `code` values used by this API:\n`validation_failed`, `unauthenticated`, `not_found`, `rate_limited`, `internal_error`, `reseller_ip_not_allowed`,\n`idempotency_key_reused`, `reseller_insufficient_balance`, `no_numbers_available`, `price_changed`,\n`reseller_concurrency_limit`, `reseller_pair_blocked`, `reseller_account_blocked`,\n`reseller_limit_removals_exhausted`, `order_not_cancellable`, `cancel_not_available_yet`, `provider_unavailable`.\nSome codes carry extra fields (listed below): `rate_limited` carries `retryAfterSeconds`, `price_changed`\n`currentPrice`, `reseller_concurrency_limit` `limit`, `reseller_insufficient_balance` `balance`,\n`cancel_not_available_yet` `cancelAvailableAt`, `reseller_pair_blocked` and `reseller_account_blocked`\n`blockedUntil` and `retryAfterSeconds`, and `reseller_limit_removals_exhausted` `retryAfterSeconds` (when a wait applies).\n",
        "required": [
          "type",
          "title",
          "status",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "example": "https://docs.oni-code.com/errors/rate_limited"
          },
          "title": {
            "type": "string",
            "description": "Short English summary for developers. Don't show it to users.",
            "example": "Too many requests"
          },
          "status": {
            "type": "integer",
            "example": 429
          },
          "code": {
            "type": "string",
            "example": "rate_limited"
          },
          "detail": {
            "type": "string",
            "description": "English details for developers."
          },
          "requestId": {
            "type": "string",
            "example": "01J9Z3K4Q2W8E5R7T6Y1U0I9O8"
          },
          "retryAfterSeconds": {
            "type": "integer",
            "description": "`rate_limited`, `reseller_pair_blocked`, `reseller_account_blocked`, `reseller_limit_removals_exhausted`:\nseconds to wait, as the `Retry-After` header says. Absent on\n`reseller_limit_removals_exhausted` when `removalsPerDay` is 0.\n"
          },
          "blockedUntil": {
            "type": "string",
            "format": "date-time",
            "description": "`reseller_pair_blocked`, `reseller_account_blocked`: when the block ends."
          },
          "currentPrice": {
            "description": "`price_changed`: the cheapest price now. Buy at it (or a higher tier) to go ahead.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "limit": {
            "type": "integer",
            "description": "`reseller_concurrency_limit`: the most numbers that may wait for a code at once."
          },
          "balance": {
            "description": "`reseller_insufficient_balance`: the Reseller wallet's balance.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "cancelAvailableAt": {
            "type": "string",
            "format": "date-time",
            "description": "`cancel_not_available_yet`: when cancelling is allowed."
          },
          "errors": {
            "type": "array",
            "description": "`validation_failed`: one entry per invalid field.",
            "items": {
              "type": "object",
              "required": [
                "field",
                "message"
              ],
              "properties": {
                "field": {
                  "type": "string",
                  "example": "limit"
                },
                "message": {
                  "type": "string",
                  "example": "must be at most 50"
                }
              }
            }
          }
        },
        "example": {
          "type": "https://docs.oni-code.com/errors/rate_limited",
          "title": "Too many requests",
          "status": 429,
          "code": "rate_limited",
          "retryAfterSeconds": 1
        }
      },
      "Money": {
        "type": "object",
        "description": "A fiat amount in micros (1e-6 of the unit). 0.99 USD = 990000.",
        "required": [
          "amountMicros",
          "currency"
        ],
        "properties": {
          "amountMicros": {
            "type": "integer",
            "format": "int64",
            "example": 990000
          },
          "currency": {
            "type": "string",
            "pattern": "^[A-Z]{3}$",
            "example": "USD"
          }
        },
        "example": {
          "amountMicros": 990000,
          "currency": "USD"
        }
      },
      "Wallet": {
        "type": "object",
        "required": [
          "balance"
        ],
        "properties": {
          "balance": {
            "description": "The Reseller wallet's balance in USD. Never negative.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          }
        },
        "example": {
          "balance": {
            "amountMicros": 125500000,
            "currency": "USD"
          }
        }
      },
      "LedgerEntryKind": {
        "type": "string",
        "description": "`topup_credit`: a Reseller top-up was credited. `admin_credit`, `admin_debit`: an entry made by the OniCode\nteam. `forfeit`: the balance was given up when the account was deleted. `order_charge`: a number was bought.\n`order_refund`: an order's price came back (cancelled, expired or failed).\nClients must tolerate new values.\n",
        "enum": [
          "topup_credit",
          "admin_credit",
          "admin_debit",
          "forfeit",
          "order_charge",
          "order_refund"
        ]
      },
      "LedgerEntry": {
        "type": "object",
        "required": [
          "id",
          "kind",
          "amount",
          "balanceAfter",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "kind": {
            "$ref": "#/components/schemas/LedgerEntryKind"
          },
          "amount": {
            "description": "Signed: positive for a credit, negative for a debit.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "balanceAfter": {
            "description": "The balance after this entry.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "topupId": {
            "type": "string",
            "format": "uuid",
            "description": "The Reseller top-up a `topup_credit` entry credited."
          },
          "orderId": {
            "type": "string",
            "format": "uuid",
            "description": "The order an `order_charge` or `order_refund` belongs to."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "id": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a70",
          "kind": "topup_credit",
          "amount": {
            "amountMicros": 100000000,
            "currency": "USD"
          },
          "balanceAfter": {
            "amountMicros": 125500000,
            "currency": "USD"
          },
          "topupId": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a71",
          "createdAt": "2026-11-16T10:00:00Z"
        }
      },
      "LedgerEntryPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LedgerEntry"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Absent on the last page."
          }
        },
        "example": {
          "items": [
            {
              "id": "019a8b30-1a2b-7c3d-8e4f-5a6b7c8d9e01",
              "kind": "order_charge",
              "amount": {
                "amountMicros": -5898000,
                "currency": "USD"
              },
              "balanceAfter": {
                "amountMicros": 119602000,
                "currency": "USD"
              },
              "orderId": "019a8b30-1a2b-7c3d-8e4f-5a6b7c8d9e00",
              "createdAt": "2026-11-16T10:05:00Z"
            },
            {
              "id": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a70",
              "kind": "topup_credit",
              "amount": {
                "amountMicros": 100000000,
                "currency": "USD"
              },
              "balanceAfter": {
                "amountMicros": 125500000,
                "currency": "USD"
              },
              "topupId": "019a8b2c-4d5e-7f60-8a1b-2c3d4e5f6a71",
              "createdAt": "2026-11-16T10:00:00Z"
            },
            {
              "id": "019a8a10-0b1c-7d2e-9f30-4a5b6c7d8e90",
              "kind": "admin_debit",
              "amount": {
                "amountMicros": -4500000,
                "currency": "USD"
              },
              "balanceAfter": {
                "amountMicros": 25500000,
                "currency": "USD"
              },
              "createdAt": "2026-11-15T08:30:00Z"
            }
          ],
          "nextCursor": "MDE5YThhMTAtMGIxYy03ZDJlLTlmMzAtNGE1YjZjN2Q4ZTkw"
        }
      },
      "PriceTier": {
        "type": "object",
        "required": [
          "price",
          "stock"
        ],
        "properties": {
          "price": {
            "description": "The Reseller's price for a number of this tier, in USD. Send it as `createOrder`'s `price`.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "stock": {
            "type": "integer",
            "format": "int64",
            "description": "Numbers at this price or cheaper."
          }
        },
        "example": {
          "price": {
            "amountMicros": 5898000,
            "currency": "USD"
          },
          "stock": 920
        }
      },
      "CountryPrices": {
        "type": "object",
        "required": [
          "countryId",
          "price",
          "stock",
          "tiers"
        ],
        "properties": {
          "countryId": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "example": "ID"
          },
          "price": {
            "description": "The cheapest tier's price.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "stock": {
            "type": "integer",
            "format": "int64",
            "description": "Numbers at any price."
          },
          "tiers": {
            "type": "array",
            "description": "Cheapest first. A higher tier reaches more expensive numbers when the cheap ones are gone.",
            "items": {
              "$ref": "#/components/schemas/PriceTier"
            }
          }
        },
        "example": {
          "countryId": "ID",
          "price": {
            "amountMicros": 5898000,
            "currency": "USD"
          },
          "stock": 1350,
          "tiers": [
            {
              "price": {
                "amountMicros": 5898000,
                "currency": "USD"
              },
              "stock": 920
            },
            {
              "price": {
                "amountMicros": 7425000,
                "currency": "USD"
              },
              "stock": 1350
            }
          ]
        }
      },
      "PriceList": {
        "type": "object",
        "description": "The website's price tiers for one service, per country, each at the Reseller's own price in USD. From the\noffer cache, so about a minute old. Buy a tier by sending its `price` to `createOrder`.\n",
        "required": [
          "serviceId",
          "rentalMinutes",
          "items"
        ],
        "properties": {
          "serviceId": {
            "type": "string",
            "example": "whatsapp"
          },
          "rentalMinutes": {
            "type": "integer",
            "description": "How long a number waits for its code; without one it is refunded then. Rounded up to whole 5 minutes, for\ndisplay: each order's `expiresAt` is authoritative.\n",
            "example": 20
          },
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CountryPrices"
            }
          }
        },
        "example": {
          "serviceId": "whatsapp",
          "rentalMinutes": 20,
          "items": [
            {
              "countryId": "ID",
              "price": {
                "amountMicros": 5898000,
                "currency": "USD"
              },
              "stock": 1350,
              "tiers": [
                {
                  "price": {
                    "amountMicros": 5898000,
                    "currency": "USD"
                  },
                  "stock": 920
                },
                {
                  "price": {
                    "amountMicros": 7425000,
                    "currency": "USD"
                  },
                  "stock": 1350
                }
              ]
            }
          ]
        }
      },
      "CreateOrderRequest": {
        "type": "object",
        "required": [
          "serviceId",
          "countryId",
          "price"
        ],
        "properties": {
          "serviceId": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9_-]{0,63}$"
          },
          "countryId": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "price": {
            "description": "A tier's `price` from `listPrices`. USD only: another currency, or an amount of 0 or less, is\n`validation_failed`. Charged exactly that, never more.\n",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "customerRef": {
            "type": "string",
            "pattern": "^[!-~]{1,64}$",
            "description": "Your own ID for the end customer, opaque, returned as sent: 1 to 64 printable ASCII characters, no spaces."
          }
        },
        "example": {
          "serviceId": "whatsapp",
          "countryId": "ID",
          "price": {
            "amountMicros": 5898000,
            "currency": "USD"
          },
          "customerRef": "tg-58210443"
        }
      },
      "OrderStatus": {
        "type": "string",
        "description": "`pending`: being bought. `waiting_sms`: the number is assigned and waits for its code. `completed`: a code\narrived. `cancelled`, `expired` (no code before `expiresAt`) and `failed` (no number was bought) are refunded\nin full. Clients must tolerate unknown values.\n",
        "enum": [
          "pending",
          "waiting_sms",
          "completed",
          "cancelled",
          "expired",
          "failed"
        ]
      },
      "OrderMessage": {
        "type": "object",
        "required": [
          "text",
          "receivedAt"
        ],
        "properties": {
          "code": {
            "type": "string",
            "example": "739106"
          },
          "text": {
            "type": "string",
            "example": "Your WhatsApp code: 739-106"
          },
          "receivedAt": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "code": "739106",
          "text": "Your WhatsApp code: 739-106",
          "receivedAt": "2026-11-16T10:06:12Z"
        }
      },
      "Order": {
        "type": "object",
        "required": [
          "id",
          "status",
          "serviceId",
          "countryId",
          "price",
          "refunded",
          "messages",
          "createdAt"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "status": {
            "$ref": "#/components/schemas/OrderStatus"
          },
          "serviceId": {
            "type": "string",
            "example": "whatsapp"
          },
          "countryId": {
            "type": "string",
            "example": "ID"
          },
          "phoneNumber": {
            "type": "string",
            "description": "E.164, present from `waiting_sms` on.",
            "example": "+6281234567890"
          },
          "price": {
            "description": "What the order was charged, in USD.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "refunded": {
            "description": "What came back to the Reseller wallet: 0, or the whole price (cancelled, expired or failed).",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "code": {
            "type": "string",
            "description": "The latest code received."
          },
          "messages": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrderMessage"
            }
          },
          "customerRef": {
            "type": "string",
            "description": "The order's `customerRef`, as sent."
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the rental ends: a waiting number without a code is refunded then."
          },
          "cancelAvailableAt": {
            "type": "string",
            "format": "date-time",
            "description": "From then on the order can be cancelled (`cancelOrder`), until a code arrives."
          },
          "closedAt": {
            "type": "string",
            "format": "date-time",
            "description": "When the order reached a final status."
          }
        },
        "example": {
          "id": "019a8b30-1a2b-7c3d-8e4f-5a6b7c8d9e00",
          "status": "waiting_sms",
          "serviceId": "whatsapp",
          "countryId": "ID",
          "phoneNumber": "+6281234567890",
          "price": {
            "amountMicros": 5898000,
            "currency": "USD"
          },
          "refunded": {
            "amountMicros": 0,
            "currency": "USD"
          },
          "messages": [],
          "customerRef": "tg-58210443",
          "createdAt": "2026-11-16T10:05:00Z",
          "expiresAt": "2026-11-16T10:24:00Z",
          "cancelAvailableAt": "2026-11-16T10:10:00Z"
        }
      },
      "OrderPage": {
        "type": "object",
        "required": [
          "items"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "nextCursor": {
            "type": "string",
            "description": "Absent on the last page."
          }
        },
        "example": {
          "items": [
            {
              "id": "019a8b30-1a2b-7c3d-8e4f-5a6b7c8d9e00",
              "status": "completed",
              "serviceId": "whatsapp",
              "countryId": "ID",
              "phoneNumber": "+6281234567890",
              "price": {
                "amountMicros": 5898000,
                "currency": "USD"
              },
              "refunded": {
                "amountMicros": 0,
                "currency": "USD"
              },
              "code": "739106",
              "messages": [
                {
                  "code": "739106",
                  "text": "Your WhatsApp code: 739-106",
                  "receivedAt": "2026-11-16T10:06:12Z"
                }
              ],
              "customerRef": "tg-58210443",
              "createdAt": "2026-11-16T10:05:00Z",
              "expiresAt": "2026-11-16T10:24:00Z",
              "cancelAvailableAt": "2026-11-16T10:10:00Z",
              "closedAt": "2026-11-16T10:06:12Z"
            }
          ],
          "nextCursor": "MDE5YThiMzAtMWEyYi03YzNkLThlNGYtNWE2YjdjOGQ5ZTAw"
        }
      },
      "ActiveOrders": {
        "type": "object",
        "description": "Numbers waiting for a code, and ones completed in the last rental.",
        "required": [
          "items",
          "serverTime"
        ],
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Order"
            }
          },
          "serverTime": {
            "type": "string",
            "format": "date-time",
            "description": "The server's time now, for countdowns to `expiresAt` and `cancelAvailableAt`."
          },
          "nextCursor": {
            "type": "string",
            "description": "Absent on the last page."
          }
        },
        "example": {
          "items": [
            {
              "id": "019a8b30-1a2b-7c3d-8e4f-5a6b7c8d9e00",
              "status": "waiting_sms",
              "serviceId": "whatsapp",
              "countryId": "ID",
              "phoneNumber": "+6281234567890",
              "price": {
                "amountMicros": 5898000,
                "currency": "USD"
              },
              "refunded": {
                "amountMicros": 0,
                "currency": "USD"
              },
              "messages": [],
              "createdAt": "2026-11-16T10:05:00Z",
              "expiresAt": "2026-11-16T10:24:00Z",
              "cancelAvailableAt": "2026-11-16T10:10:00Z"
            }
          ],
          "serverTime": "2026-11-16T10:07:30Z"
        }
      },
      "LevelStep": {
        "type": "object",
        "description": "One level of the levels table.",
        "required": [
          "level",
          "threshold",
          "discountPercent"
        ],
        "properties": {
          "level": {
            "type": "integer",
            "description": "The level, from 1.",
            "example": 1
          },
          "threshold": {
            "description": "The top-ups credited in a UTC week that reach this level the next week, in USD. Reached at exactly this amount.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "discountPercent": {
            "type": "integer",
            "description": "Up to this much off our margin at this level.",
            "example": 10
          }
        },
        "example": {
          "level": 1,
          "threshold": {
            "amountMicros": 500000000,
            "currency": "USD"
          },
          "discountPercent": 10
        }
      },
      "Level": {
        "type": "object",
        "description": "The Reseller's level this UTC week. The top-ups credited in the previous week set it, and it holds from\n`weekStart` to `weekEnd`. Its discount comes off our margin only, never off the provider's cost, which is why\nit is \"up to\"; every price the API returns already includes it.\n",
        "required": [
          "level",
          "discountPercent",
          "pinned",
          "weekStart",
          "weekEnd",
          "thisWeekTopups",
          "nextWeekLevel",
          "levels"
        ],
        "properties": {
          "level": {
            "type": "integer",
            "description": "The level this week. 0: none (no discount).",
            "example": 1
          },
          "discountPercent": {
            "type": "integer",
            "description": "Up to this much off our margin; your prices already include it. 0 at level 0.",
            "example": 10
          },
          "pinned": {
            "type": "boolean",
            "description": "The level was set by the OniCode team. It holds every week, whatever the top-ups, until the team unpins it.",
            "example": false
          },
          "weekStart": {
            "type": "string",
            "format": "date-time",
            "description": "This week's start: Monday 00:00 UTC.",
            "example": "2026-11-16T00:00:00Z"
          },
          "weekEnd": {
            "type": "string",
            "format": "date-time",
            "description": "This week's end: the next Monday 00:00 UTC.",
            "example": "2026-11-23T00:00:00Z"
          },
          "thisWeekTopups": {
            "description": "The top-ups credited since `weekStart`, in USD. They set next week's level.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Money"
              }
            ]
          },
          "nextWeekLevel": {
            "type": "integer",
            "description": "The level `thisWeekTopups` give next week so far. 0: none. While `pinned`, the pinned level holds instead.",
            "example": 2
          },
          "levels": {
            "type": "array",
            "description": "The levels table, lowest first. Empty: no levels yet, so no discount.",
            "items": {
              "$ref": "#/components/schemas/LevelStep"
            }
          }
        },
        "example": {
          "level": 1,
          "discountPercent": 10,
          "pinned": false,
          "weekStart": "2026-11-16T00:00:00Z",
          "weekEnd": "2026-11-23T00:00:00Z",
          "thisWeekTopups": {
            "amountMicros": 1200000000,
            "currency": "USD"
          },
          "nextWeekLevel": 2,
          "levels": [
            {
              "level": 1,
              "threshold": {
                "amountMicros": 500000000,
                "currency": "USD"
              },
              "discountPercent": 10
            },
            {
              "level": 2,
              "threshold": {
                "amountMicros": 1000000000,
                "currency": "USD"
              },
              "discountPercent": 15
            },
            {
              "level": 3,
              "threshold": {
                "amountMicros": 2500000000,
                "currency": "USD"
              },
              "discountPercent": 25
            },
            {
              "level": 4,
              "threshold": {
                "amountMicros": 5000000000,
                "currency": "USD"
              },
              "discountPercent": 40
            },
            {
              "level": 5,
              "threshold": {
                "amountMicros": 10000000000,
                "currency": "USD"
              },
              "discountPercent": 60
            }
          ]
        }
      },
      "PairBlock": {
        "type": "object",
        "description": "A service in a country the Reseller can't buy until `until`.",
        "required": [
          "serviceId",
          "countryId",
          "until"
        ],
        "properties": {
          "serviceId": {
            "type": "string",
            "example": "whatsapp"
          },
          "countryId": {
            "type": "string",
            "example": "ID"
          },
          "until": {
            "type": "string",
            "format": "date-time",
            "description": "When the block ends."
          }
        },
        "example": {
          "serviceId": "whatsapp",
          "countryId": "ID",
          "until": "2026-11-16T10:35:00Z"
        }
      },
      "Limits": {
        "type": "object",
        "description": "The Reseller's limits and the blocks in force now. Every number in these rules is a setting of ours, with\ntoday's value in brackets, and may change; the fields here always carry the current ones.\n- **Request rate:** at most `requestsPerSecond` requests a second (50). Past it, every request gets\n  `429 rate_limited`. A key used from one client address is then blocked for a set length (10 seconds) that no\n  request lengthens; the rate across all the Reseller's addresses answers 429 without a block. Buys and\n  cancels have their own limits a second (10 each), with no block.\n- **Numbers waiting at once:** at most `maxWaitingNumbers` numbers (100) are being bought or wait for a code\n  at once; a buy past it is `reseller_concurrency_limit`.\n- **Service-and-country block:** each time one of your numbers is cancelled or expires without a code (not when\n  the OniCode team cancels it), its service in its country is checked. The check counts the numbers there that\n  ended (completed, cancelled or expired; not ones the OniCode team cancelled) and were bought within a set\n  window (the last 24 hours), or since that pair's last block ended or was lifted when that is later. With at\n  least a set number of them (100) and under a set share of them with a code (6%), the pair is blocked for a\n  set time (30 minutes): buying it is `reseller_pair_blocked`, and it is listed in `pairBlocks`. Numbers still\n  waiting don't count.\n- **Account block:** when a pair block starts and a set number of pairs (5) are blocked at once, every\n  purchase is blocked for a set time (30 minutes): buying is `reseller_account_blocked`, and\n  `accountBlockedUntil` is present.\n- **Remove limits** (`removeLimits`) lifts every block in force, `removalsPerDay` times a UTC day (5). The\n  request rate and the numbers waiting at once can't be lifted.\n",
        "required": [
          "requestsPerSecond",
          "maxWaitingNumbers",
          "waitingNumbers",
          "pairBlocks",
          "removalsPerDay",
          "removalsUsedToday",
          "removalsResetAt"
        ],
        "properties": {
          "requestsPerSecond": {
            "type": "integer",
            "description": "Requests a second the key may make from one client address, and the Reseller in all; past it, `rate_limited` (a block follows per key and address).",
            "example": 50
          },
          "maxWaitingNumbers": {
            "type": "integer",
            "description": "The most numbers that may be bought or wait for a code at once.",
            "example": 100
          },
          "waitingNumbers": {
            "type": "integer",
            "description": "The numbers being bought or waiting for a code now.",
            "example": 12
          },
          "accountBlockedUntil": {
            "type": "string",
            "format": "date-time",
            "description": "Present while every purchase is blocked: when the block ends."
          },
          "pairBlocks": {
            "type": "array",
            "description": "The services in countries blocked now.",
            "items": {
              "$ref": "#/components/schemas/PairBlock"
            }
          },
          "removalsPerDay": {
            "type": "integer",
            "description": "How many times a UTC day `removeLimits` can lift the blocks. 0: never.",
            "example": 5
          },
          "removalsUsedToday": {
            "type": "integer",
            "description": "Removals used this UTC day.",
            "example": 1
          },
          "removalsResetAt": {
            "type": "string",
            "format": "date-time",
            "description": "The next 00:00 UTC, when `removalsUsedToday` starts again from 0.",
            "example": "2026-11-17T00:00:00Z"
          }
        },
        "example": {
          "requestsPerSecond": 50,
          "maxWaitingNumbers": 100,
          "waitingNumbers": 12,
          "pairBlocks": [
            {
              "serviceId": "whatsapp",
              "countryId": "ID",
              "until": "2026-11-16T10:35:00Z"
            }
          ],
          "removalsPerDay": 5,
          "removalsUsedToday": 1,
          "removalsResetAt": "2026-11-17T00:00:00Z"
        }
      }
    }
  }
}
