OTPIXA developer reference
Numbers REST API documentation
Authentication, funding, request pricing, safe retries and account history. No subscription or activation fee.
Open API dashboardQuick start
- Sign in and create a product-specific key in the API dashboard. Save the key when it is shown.
- Add at least $10 using an available payment method. Wait for payment confirmation.
- Use the same origin as the website. The deployed base path is
/api/public/v1, on the website itself. - Send the key in the Authorization header. Send a unique Idempotency-Key for every POST.
curl "https://payment-flux-pro.lovable.app/api/public/v1/account/balance" -H "Authorization: Bearer $OTPIXA_KEY"Authentication
Every endpoint needs Authorization: Bearer YOUR_KEY. Numbers keys cannot use email endpoints and email keys cannot use numbers endpoints. Keys are hashed in storage and the full key is shown once. Revoke a compromised key immediately and create a replacement. Website session tokens are not API keys.
Funding & pricing
API wallets are isolated from website funds and from each other. There is no API activation or monthly fee. Number purchases use the current website catalog price returned by /v1/prices. Catalog, account and order reads are free. The bonus tier is based on each deposit amount, not accumulated deposits, and is credited once with confirmed payment. Failed or pending payments receive no credits. Available gateways and their maximum amounts are shown in the dashboard; a $5,000 tier does not raise a local gateway's limit. API balances cannot be transferred to website wallets.
$10: 0%; $50: 10%; $100: 15%; $250: 20%; $500: 25%; $1,000: 30%; $2,500: 40%; $5,000: 50%.
Endpoints
Replace /v1 with /api/public/v1 on your deployed origin.
GET /v1/countries
Active countries. Free.
GET /v1/services
Active services. Free.
GET /v1/prices?country=PK
Website prices and price_id values. Free. Latest 100 entries; country is optional.
POST /v1/orders
Reserve a real number. Charged the current website price for price_id. No engine or subscription fee.
{"price_id":"UUID_FROM_PRICES"}GET /v1/orders
Latest 100 numbers API orders belonging to you. Free.
GET /v1/orders/{id}
Order, number, price, status, expiry and SMS messages. Refreshes provider status. Free.
GET /v1/orders/{id}/sms
Same order response, including sms_messages with code and full text. Free.
POST /v1/orders/{id}/cancel
Cancel an eligible waiting order. An order with an SMS cannot be refunded. Refund goes only to the numbers API wallet.
{}GET /v1/account/balance
API product balance and unit (USD or credits). No charge.
GET /v1/account/usage
Latest 100 request records for this API product. No charge.
GET /v1/account/transactions
Latest 100 deposits, bonuses, charges and refunds. No charge.
Response envelope
{"data": {...}, "request_id": "uuid", "cost": 0, "unit": "USD"}Inbox creation returns id, address, domain, kind, expiresAt and status. Order creation returns id; fetch that order to read the number and SMS. No outbound webhooks are offered by this version; poll the read endpoints.
Retries & refunds
Use an 8–120 character Idempotency-Key for POST requests. Reuse exactly the same key, URL and JSON body only when retrying the same action. The same request returns its stored result without a second charge. Different input with the same key returns 409. GET calls are separate billable requests unless you explicitly reuse an Idempotency-Key; replay returns the stored result, not fresh mail. A pending request returns 202: retry with the same key, never issue a new purchase blindly. Provider failures refund the reserved request cost. Expired inboxes are unavailable; an existing allocation is not refunded merely because its five-minute lifetime ended. Contact support with request_id for a request stuck pending after interruption.
Errors & security
- 400
- invalid_request — invalid body, ID or missing idempotency key
- 401
- unauthorized — invalid, missing or revoked key
- 402
- insufficient_balance — fund this API product
- 403
- account_disabled — contact support
- 404
- not_found — wrong product, private resource or expired inbox
- 409
- conflict — idempotency key reused for different input
- 503
- service_unavailable — retry safely or contact support
Never expose keys in browser code, URLs or logs. Keep HTML messages isolated in a sandboxed iframe without scripts or same-origin permission. Only use inboxes and numbers for lawful activity you are entitled to perform. OTPIXA is independent of Google and Microsoft. Current responses do not advertise rate-limit headers. Avoid rapid polling and retry provider errors with backoff.
Contact supportIn-depth integration guide
Pricing examples, funding bonuses, mailbox types, safe retries and production checklists.
Read the complete numbers API guide