Balance
Orders and top-ups are charged to your partner balance. The Business portal calls it your wallet, and you add funds there under Wallet. With a test key the balance is a virtual one that only exists in the sandbox.
Get your balance
Section titled “Get your balance”GET /v1/balance
There are no parameters.
curl "$ESIMIFY_API_URL/v1/balance" \ -H "Authorization: Bearer $ESIMIFY_API_KEY"const res = await fetch(`${process.env.ESIMIFY_API_URL}/v1/balance`, { headers: { Authorization: `Bearer ${process.env.ESIMIFY_API_KEY}` },});const balance = await res.json();<?php$ch = curl_init(getenv('ESIMIFY_API_URL') . '/v1/balance');curl_setopt_array($ch, [ CURLOPT_RETURNTRANSFER => true, CURLOPT_TIMEOUT => 30, CURLOPT_HTTPHEADER => [ 'Authorization: Bearer ' . getenv('ESIMIFY_API_KEY'), ],]);$balance = json_decode(curl_exec($ch), true);$status = curl_getinfo($ch, CURLINFO_HTTP_CODE);import osimport requests
res = requests.get( os.environ["ESIMIFY_API_URL"] + "/v1/balance", headers={"Authorization": "Bearer " + os.environ["ESIMIFY_API_KEY"]}, timeout=30,)balance = res.json()Response
Section titled “Response”200 OK
{ "balance": { "amount": "999751.00", "currency": "INR" }, "low_balance_threshold": { "amount": "5000.00", "currency": "INR" }, "mode": "test"}| Field | Type | Nullable | Description |
|---|---|---|---|
balance |
Money | No | What you can spend now. |
low_balance_threshold |
Money | Yes | The level below which a balance.low event is sent. null when no threshold is set, or it is set to 0. Then no balance.low event and no low-balance email is sent. |
mode |
string | No | test or live, from the key you used. |
Errors
Section titled “Errors”This endpoint returns only the common errors.
Good to know
Section titled “Good to know”low_balance_thresholdis the value from the Business portal, under Settings. A new account has none. The same value is used for test and live keys.- Every Order carries
balance_after, your balance right after the order was charged. If part of the order is refunded (refundedabove 0), your balance is higher: call this endpoint for the current figure. - Subscribe to the
balance.lowwebhook instead of polling. It is sent once each time an order or top-up takes your balance below the threshold. In live, the Business portal’s low-balance email is sent at the same moment. The sandbox sends the event only, measured against the virtual balance. - The sandbox balance starts at 1000000.00 INR and refills on its own when it drops below 10000.00 INR. See Sandbox.

