In this article
Learn how to test an order with a validate request, so you can check your integration without using your balance. You'll also learn how to read the result and move on to a real order.
The short answer
We currently do not have a dedicated sandbox or test environment. The Orders endpoint can be tested by keeping "type": "validate". This lets you test if the call would have been valid without reducing your Organisation credit balance.
POST /orders validates and processes orders. The type field accepts validate and transaction. See the v2.5 API reference for POST /orders.
Before you start
- You need your API key, sent in the X-API-Key header with every call. See Find, copy and refresh your API key.
Test an order with validate
- Call POST /orders from your own code or any API client, such as cURL or Postman. For the request format, see the v2.5 API reference for POST /orders.
- Set "type" to "validate".
- Enter the "quantity" of bundles required, for example 5.
- In "item", enter the moniker of the bundle, for example esim_1GB_7D_TR_V2. A moniker is the bundle code; see the Glossary. Bundle monikers are case sensitive and can be found in the API catalogue. See Querying the catalogue. To list the monikers available to you, call GET /catalogue (https://docs.esim-go.com/api/v2_5/operations/catalogue/get).
- Send the request.
Check the result
- If the order would succeed, you will see the bundle details and total cost in the response body of your call. The valid field in the response indicates if the request is valid.
- If it would fail, you will receive an error message in the response, detailing why it failed. See API error troubleshooting.
If you now wish to complete the order, change "type" to "transaction". This places a real order, and the total is deducted from your Organisation's balance. See Create an eSIM using the API.
Tip: Validate every new moniker or quantity before you put it live. A validate request costs nothing, and catching an error here saves a failed order in front of your customer.