OtpGet Sandbox API Key: Test Your Integration Without Spending a Cent
Nothing is more stressful than testing a purchase flow with real money. That is exactly why OtpGet gives every developer a sandbox key. It behaves like the real API but nothing you do can touch your real balance.
What the sandbox does
- Servers, countries, services and prices are the real, live ones, so you build against real data.
- Numbers are fake and no real order is placed.
- You get a virtual balance. Buying lowers it, cancelling or expiry refunds it.
- After a purchase, a test code arrives after a few seconds so you can test your polling or webhook logic.
- A sandbox key can never be used for real purchases, and it can never spend your real balance.
How to use it
Take the sandbox key from the API tool page and use it exactly like your live key. The URL does not change:
https://otpget.com/stubs/handler_api.php?api_key=sbx_YOUR_SANDBOX_KEY&action=getBalance
That is the whole trick. Your code, your parameters and your parsing stay identical.
A good test plan
- Call
getBalanceand confirm you read the virtual balance. - Buy a number with
getNumberand store the order id. - Poll
getStatusuntil the test code arrives. - Buy again and cancel with
setStatusto confirm the refund path. - Deliberately trigger errors: a wrong key, a very high quantity, an empty balance.
Resetting the sandbox
If you spend the virtual balance or want a clean slate, use the reset button on the API tool page. Orders and balance return to their starting state.
Going live
Replace the sandbox key with your real key. That is the only change. No code branches, no different endpoints, no surprises on launch day.
Start building with OtpGet
Create a free account at otpget.com, copy your API key from the dashboard and open the API documentation. Our support team is available 24/7 if you get stuck.