Numbers REST API: SMS Integration, Pricing & Safe Workflows
A practical guide to temporary receiving numbers: live catalog prices, separate API funding, deposit bonuses, SMS polling, cancellation and reliable retries.
OTPIXA editorial team · Updated 16 November 2026 · 13 min read
Numbers REST API: what you are actually integrating
A numbers REST API gives your application a structured way to request a virtual number, inspect an order and retrieve an incoming verification message. It is not the same product as an outbound SMS gateway. An outbound gateway sends your own messages to customers. OTPIXA's numbers API is designed around receiving messages for supported services through a temporary number order. That distinction matters before you write code, estimate costs or decide whether the product fits your workflow.
A practical integration starts with a country and service, looks up the current price, creates an order, then checks that specific order until a message arrives or the order reaches its expiry. The response contains identifiers your application should preserve. Those identifiers connect your purchase, the number, the incoming SMS and your billing history. A reliable client follows this lifecycle explicitly instead of treating number acquisition as a single fire-and-forget request.
This guide explains the implemented OTPIXA request contract, separate API funding, pricing, deposit bonuses, retries, cancellation and integration safeguards. It also separates implemented behavior from operational readiness. A documented endpoint is not proof that its connected services are healthy. Before using the API for customer work, complete an authenticated order and SMS test on the deployed host. If the service returns an availability error, pause purchases rather than assuming the payment or allocation succeeded.
Appropriate use cases and important boundaries
Temporary receiving numbers can help with authorized account verification, controlled onboarding workflows and quality assurance for systems you are entitled to test. Teams may need to compare delivery across countries, validate how their software handles a verification code or reduce manual copying between an approved workflow and an internal tool. The API makes those tasks programmable while preserving the order record needed for troubleshooting.
Do not use temporary numbers to bypass a platform's rules, impersonate another person, evade enforcement, operate scams or access accounts you do not own. A destination platform may reject virtual numbers, limit country support or require a long-term number. OTPIXA cannot guarantee that every external platform accepts every supplied number. A successful allocation and a successful verification on another website are different outcomes and should be represented separately in your application.
Temporary access also makes these numbers unsuitable as the sole recovery method for a permanent account. You should not assume that a purchased number remains yours indefinitely, that it supports calls, that it can send SMS or that you can use it again next month. Build your product around the actual order expiry and supported receiving workflow, not assumptions borrowed from a mobile subscription.
Separate API wallet, without a subscription fee
The numbers API uses a USD balance separate from the ordinary website wallet and separate from the email API credit balance. Funding the website wallet does not automatically fund the numbers API. Funding email credits does not give you a number-purchase balance. This separation is intentional: an integration can track its own spending without mixing automated request charges with a person's website activity.
There is no numbers API subscription or activation fee. Purchases use the current website catalog price for the selected price record. Website engine-activation rules are not an additional API activation charge. Your integration still needs sufficient numbers API funds for the purchase, and the supported catalog must contain an active offer. Free catalog and order reads do not remove the requirement to pay for a successfully supplied number.
The minimum API deposit is $10. Deposits become spendable only after payment confirmation. A pending checkout, a screenshot of a transfer, a browser redirect or an unsuccessful payment is not a funded balance. Keep your integration's funding state distinct from its order state. Do not begin allocating numbers until the account balance endpoint reflects usable funds in the numbers product.
Deposit bonuses and exact examples
The bonus is determined by each individual deposit amount, not by adding together smaller deposits. The following values are the configured numbers API tiers. The final column includes the base payment and its bonus; it is not a cash withdrawal promise or a transfer into the ordinary website wallet.
| Deposit | Bonus | Numbers API balance added |
|---|---|---|
| $10 | 0% | $10 |
| $50 | 10% | $55 |
| $100 | 15% | $115 |
| $250 | 20% | $300 |
| $500 | 25% | $625 |
| $1,000 | 30% | $1,300 |
| $2,500 | 40% | $3,500 |
| $5,000 | 50% | $7,500 |
Two separate $25 deposits do not turn into one $50 deposit for bonus calculation. A $100 confirmed payment adds $100 of base funds and $15 of bonus funds to the numbers API account. The payment confirmation path is intended to apply each real payment once, including its bonus. Repeated checkout polling should not repeatedly increase a balance.
Use a currently available method in the dashboard. The website includes crypto and local payment options, but availability and limits depend on the configured gateway. A published $5,000 bonus tier does not override a payment method's maximum. For cryptocurrency, confirm the displayed coin, network, address and exact amount before sending. An incorrect network can prevent settlement even if a wallet shows that funds were sent.
How number prices are selected
Number pricing depends on the service, country and active offer. The website's stated typical WhatsApp range is $0.30–$0.40 for many countries, with higher examples around $1–$3 for Australia, Taiwan and Yemen. Facebook and Instagram examples are around $0.03–$0.04. These are contextual examples, not a fixed quote for every country, operator or future request. The live catalog is the source for the purchasable price.
Your application should retrieve prices rather than hardcode those examples. The price response contains an id, a numeric price, country_iso2, service_id and operator_id. The purchase body uses the price record's ID. It does not use the display name of a service, a guessed country identifier or a client-selected dollar amount. This avoids ambiguity and keeps the purchase aligned with an actual active offer.
The service checks the active price when processing an order. A cached catalog entry may no longer be available, and market prices can change. Present a current quote to your user, retain the chosen price ID and reconcile the eventual order price with your own records. If your workflow requires explicit approval before spending beyond a budget, enforce that decision in your application before submitting a purchase.
Authentication and the deployed base URL
Every numbers endpoint requires a product-specific API key in the Authorization header. Create it in the numbers API dashboard, save it when it is shown and store it on your own server. The full key is not a website login token. Numbers keys cannot access email endpoints, and email keys cannot buy numbers. Use distinct secret names in your deployment to avoid mixing them accidentally.
The deployed API path is /api/public/v1 on the same host as the website. Documentation may abbreviate endpoints as /v1/orders, but the actual URL includes /api/public. No separate API subdomain is needed. Use the host where your current website deployment runs, and verify that it contains the current API version before building an integration around it.
export OTPIXA_ORIGIN="https://otpixa.com"
# Set OTPIXA_NUMBERS_KEY securely in your server environment.
curl "$OTPIXA_ORIGIN/api/public/v1/account/balance" \
-H "Authorization: Bearer $OTPIXA_NUMBERS_KEY"Do not paste production keys into public examples, frontend bundles, query strings, screenshots or issue trackers. Restrict access to the server environment that needs the key. If a key is exposed, revoke it in the dashboard and create a replacement. Merely removing the key from a public page does not undo exposure; rotation is the appropriate response.
Discover countries, services and current offers
Start with GET /v1/countries and GET /v1/services. These reads are free. Country records include the ISO code and calling code; service records include the identifier, slug and display name. Treat IDs as identifiers and names as presentation values. Localizing a name should not change which service your code purchases.
Next call GET /v1/prices?country=PK, replacing PK with a supported uppercase two-letter country code. The country filter is optional. The current implementation limits these reads to 100 entries and does not document cursor pagination. Do not assume one unfiltered response contains every possible offer. Narrow the country when appropriate and build your selection screen around the actual returned offers.
curl "$OTPIXA_ORIGIN/api/public/v1/prices?country=PK" \
-H "Authorization: Bearer $OTPIXA_NUMBERS_KEY"An active price is not an unlimited-stock promise. Supply may disappear between discovery and purchase. Handle an unavailable allocation as a normal integration outcome: preserve the request identifier, show a clear status and retry safely only when appropriate. Never display a phone number that you invented as a fallback. An empty or failed supply response must not be converted into a successful customer order.
Create an order with durable retry protection
Create a purchase with POST /v1/orders, a JSON body containing price_id and a unique Idempotency-Key. The key must be 8–120 characters. Generate it once for a specific purchase and save it before submitting the request. This is different from the API credential: the credential identifies the account, while the idempotency key identifies one operation.
curl -X POST "$OTPIXA_ORIGIN/api/public/v1/orders" \
-H "Authorization: Bearer $OTPIXA_NUMBERS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: order-your-internal-reference-001" \
-d '{"price_id":"REPLACE_WITH_PRICE_UUID"}'The normal purchase response includes an order ID inside the response envelope. Fetch that order to obtain the number and current state. Store the order ID, request ID, chosen price ID, expected country and service, and your internal workflow reference. A durable record is much safer than relying on a single browser tab or a transient variable in a worker process.
If your HTTP client times out after sending a purchase, you do not know whether the server allocated a number. Retry the same operation using the same idempotency key, URL and body. Do not generate a new key simply because you did not receive the first response. Doing so represents a new purchase and can lead to an additional valid allocation.
Read the number, SMS and expiry
Use GET /v1/orders/{id} for the order details or GET /v1/orders/{id}/sms for the same order response including its SMS messages. These reads are free. The response can include the order reference, phone number, price, status, expiry and message records with the detected code, full text and creation time. Preserve the full message when your authorized workflow needs context; a numeric code alone may be ambiguous.
Order reads refresh provider status through the implemented receiving flow. They are not a guarantee of immediate delivery. Use bounded polling and stop when the order completes, becomes unavailable or expires. Free reads are not permission to overwhelm the service. A measured interval, a deadline and backoff after transient errors produce a more stable integration than a tight loop.
Build your user-facing states around reality: number allocated, waiting for SMS, message received, cancelled, expired or service unavailable. Do not show “verified” merely because a number exists. The destination application's acceptance is a separate event. If you display a countdown, base it on the returned expiry and use server responses as the authority rather than allowing a local timer to extend the order.
Cancellation, refunds and accounting
An eligible waiting order can be cancelled through POST /v1/orders/{id}/cancel, with an empty JSON object and a unique idempotency key. An order that already has an SMS cannot be refunded through this cancellation flow. Do not promise cancellation after successful receipt, and do not assume a cancellation request succeeded before checking the returned state.
Refunds for API orders belong in the numbers API wallet, not the ordinary website wallet and not the email credits account. Provider failures use reserved-charge handling so a failed allocation can release the request cost. That is different from demanding a refund after a successfully supplied number has already been used or an order has reached its ordinary lifetime.
curl -X POST "$OTPIXA_ORIGIN/api/public/v1/orders/ORDER_UUID/cancel" \
-H "Authorization: Bearer $OTPIXA_NUMBERS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: cancel-your-internal-reference-001" \
-d '{}'Keep a local accounting trail, but reconcile it with the API ledger. A local “cancel requested” flag is not evidence of a refund. Inspect balance and transactions after the cancellation completes. If a request remains pending, give support the request ID rather than repeatedly issuing new purchases or cancellation operations without understanding the existing record.
Response codes and retry decisions
Successful responses use an envelope with data, request_id, cost and unit. For numbers the unit is USD. A 202 response indicates a pending operation rather than a finished purchase. Treat that state as a reason to reconcile the same request, not as either a definitive failure or permission to create a replacement purchase immediately.
A 400 means invalid input or a missing valid idempotency key. A 401 means missing, invalid or revoked API authentication. A 402 means the relevant API account needs funds. A 403 indicates an inactive account. A 404 can mean an unavailable resource or a wrong-product endpoint. A 409 indicates an idempotency key was reused with different input. A 503 means the service could not complete the request.
For input errors, fix the request. For authentication errors, check the product and key rather than retrying indefinitely. For insufficient balance, wait for confirmed funding. For transient availability errors, use backoff and preserve the operation's identity. If the response says an operation is pending, continue with the same idempotency key. Never build a generic retry policy that creates new paid requests for every error code.
Monitoring and a production acceptance checklist
Use GET /v1/account/balance, GET /v1/account/usage and GET /v1/account/transactions to inspect the API product. These account reads are free and return the latest records rather than a documented unlimited export. The current request and ledger views are limited to 100 entries. Preserve the operational records your own business needs without storing unnecessary SMS contents or exposed credentials.
A useful monitoring view tracks purchase success, waiting time, delivered messages, cancellations, pending requests and balance changes. Separate payment errors from number-supply errors. If the API cannot validate keys because its connected account service is unavailable, you should pause the integration globally instead of allowing every customer to trigger the same failing purchase path.
Before launch, test a valid key, a revoked key, the wrong product key, insufficient funds, a real authorized number purchase, the SMS readback and an eligible cancellation. Re-submit an identical purchase with its original idempotency key and confirm that it returns the same operation without charging again. Check the separate wallet afterward. Funding and payment replay tests require a verified real payment or an approved gateway test environment; an unpaid invoice does not verify wallet settlement.
Choosing the next step
Start small: connect one country and one service, read the catalog, fund the correct product and complete one authorized order lifecycle. Once the record reads back correctly and the ledger reconciles, expand to more offers. Do not claim production readiness based only on a public dashboard loading or an unauthorized request returning 401; neither checks a paid allocation or incoming SMS.
Read the numbers API reference for endpoint details, use the numbers API dashboard to manage keys and funding, and consult support for an unresolved request. If your workflow also needs an email inbox, use the separate email API guide. The products share a website, but their credentials, balances and purchasing units remain deliberately distinct.