API Documentation
Complete REST API reference for OTPZap virtual number and OTP verification integration.
Connection Info
https://otpzap.com/api/v1Authorization: Bearer YOUR_API_KEYQuick Guide
OTPZap supports 3 servers with different workflows:
- Server 1 - Use
product_idfor orders. Stock and pricing visible at /products endpoint. - Server 2 - Use
service_id+country_id+operator_id. Supports multiservice and special services. - Server 3 - Email OTP. Use
/s3/domainsthen create orders with/order/email-create.
Account & Balance
/balanceCheck account balance.
/topup/createCreate a QRIS deposit invoice (rupiah). Redirect the customer to payment_url to complete payment. Balance is credited automatically on successful payment. Invoice valid for 30 minutes. Send a unique Idempotency-Key header to avoid duplicate invoices on retry.
/topup/check?order_id=APIDEP-3-xxxCheck deposit status. States: pending | success | expired | failed. Polling also drives reconciliation automatically.
🪙 Crypto Payments
Crypto deposits (BTC, USDT, ETH, USDC, etc.) are currently available through the web dashboard only - not exposed via the Public API. Customers can choose crypto payment directly on the Deposit Balance page in the dashboard. Crypto payment window: 25 minutes after invoice creation.
Server 1
Use product_id from the /products endpoint. 1 product = 1 service + 1 country + 1 price tier. Catalog data is fetched fresh by OTPZap; fetch again before creating an order and avoid long client-side caching.
/countriesList of available countries (Server 1).
/services?country_id=7List of platforms/services. Optional parameter: country_id.
/products?platform_id=1&country_id=7List of products + pricing + stock. Parameters: platform_id, country_id, page, limit, sort.
Server 2
Use service_id + country_id + operator_id. Supports multiservice and special services. Service data is also fresh from OTPZap.
/s2/countriesList of available countries (Server 2).
/s2/services?country_id=7List of services + pricing per country.
/s2/operators?country_id=7List of operators per country.
/s2/specialList of special services (no country/operator parameter required). These services use pre-allocated virtual numbers dedicated to specific platforms.
Server 3 - Email OTP
Use Server 3 for email inbox rental. First choose a target site and domain, then create an email order. The first 20 minutes are the waiting window; after a message arrives, session lifetime follows the email domain/service policy.
/s3/sitesSuggested target sites. Suggestions only; any valid site domain can be sent to the create endpoint.
/s3/domains?site=openai.comAvailable email domains, stock, price, activation rate, and cancellation fee preview.
/order/email-createBuy Email OTP. Optional fields: qty, subject, regex, or domains[] for aggregator mode.
/order/email-check?ref=APIE-3-xxxPoll email status and messages. Returns inbox preview, extracted OTP/headline, full message timeline, and updated expires_at.
/order/email-reorderRequest a new message on the same email inbox. The waiting window resets to 20 minutes and OTPZap balance is not debited again.
/order/email-cancelCancel before any message arrives. Refund can be reduced by the system cancellation fee.
/order/email-finishFinish an email order after a message arrives and close the activation window.
Order Management
The following endpoints apply to SMS orders on Server 1 and Server 2. Email OTP uses the dedicated Server 3 endpoints above.
/order/createBuy an OTP number. Optional header Idempotency-Key prevents duplicate orders on retry. Use IDs from the latest catalog response. Optional service_name must match the service name for the selected ID when sent.
/order/check?order_id=65Check status & fetch OTP. Poll this endpoint every 5 seconds. Status flow: pending → otp_received (S1, number still active) → success. Failed orders are auto-refunded.
Key fields: otp_code is the latest/final OTP for automated integrations. otps[] is the timeline of all OTPs received (oldest first), so do not use the first array item as the main OTP. Useful when resend adds a new OTP - you can detect a new entry by array length change. resend_count = how many resends used. resend_locked_until = WIB timestamp until resend is unlocked (null if available).
/order/cancelCancel a pending order. A 2-minute cooldown applies to all orders (single & multiservice). Balance is refunded automatically when system confirms cancellation. Error codes: 409 if status is not pending, 429 if cooldown not yet elapsed (check Retry-After header), 502 if system rejects.
/order/finishMark order as finished. Use after the OTP is received and the number is no longer needed.
/order/resendResend SMS. Per-OTP gating: after one resend, the next call returns HTTP 429 until a new OTP arrives through polling. Status and existing OTP are not reset - new OTP appears as an additional entry in otps[]. Not all platforms support resend.
/order/replaceServer 1 only. Atomically cancel the current order and buy a fresh number at the same product/price. Old balance refunded, new balance deducted in one transaction.
Webhook
OTPZap sends POST requests to your webhook URL when events occur. Configure via dashboard or the API endpoints below.
Events:
order.otp_received- OTP received successfullyorder.cancelled- Order cancelled & balance refundedorder.finished- Order finishedorder.replaced- Server 1 order replaced with a new numberdeposit.success- Deposit successful*- Wildcard, subscribe to all events
Webhook Management
/webhook/getFetch current webhook configuration. secret is never returned here (security - only shown once at set/update time).
/webhook/updateCreate or update webhook configuration. Method is PATCH (not POST). URL must be HTTPS and resolve to a public IP (private IPs are rejected for anti-SSRF protection).
Optional fields: secret minimum 16 characters (if not provided or shorter, OTPZap auto-generates a 48-char hex). Save this secret somewhere safe - it will not be shown again at /webhook/get. is_active defaults to true; set to false to pause delivery without deleting config.
Error 422: URL is not HTTPS, URL resolves to private/loopback IP (anti-SSRF), or an event is not valid (see list above).
Webhook Security
Signature Verification:
Need help? Contact us via Telegram.