Account API - Manage your account programmatically | Stannp UK

Account

Manage your account balance and top up funds.

Get account balance

You can use the API to check your account balance.

GET

Request Example

curl "https://api-eu1.stannp.com/v1/accounts/balance" \
-u {API_KEY}:

Response Example

{
  "success": true,
  "data": {
    "balance": "214.4200"
  }
}

Top up balance

Top up your account balance. The amount is specified in the smallest currency unit (pence for GBP, cents for USD/CAD). Tax and any payment processing fees are calculated server-side. Requires a saved card on your account. Tip: Consider enabling auto top-up to ensure your sends are not impacted by a low balance.

POST

Parameters

ParameterDetailsDescription
net
body integer required
The amount to top up in the smallest currency unit (e.g., 1000 = £10.00). Tax may be added.
card_id
body integer optional
The ID of a saved card to charge. If not provided, the account's default card will be used.

Request Example

curl -X POST "https://api-eu1.stannp.com/v2/balance" \
-H "X-Api-Key: {API_KEY}" \
-H "Content-Type: application/json" \
-d '{"net": 1000}'

Response Example

{
  "data": {
    "status": "success",
    "net": 1000,
    "tax": 200,
    "payment_processing_fee": 0,
    "gross": 1200
  }
}