API Reference

Top up a Balance

To top up a balance in your account, you'll need to send a request to our top-up endpoint containing data such as the customer details, amount with which you wish to top-up, currency, country and a Boolean indicating whether you intend to save your token.


📘

Top up currency

The top-up is made to the balance whose currency is specified in the request body


const url = 'https://api.stallsone.com/v1/balances/topup'
const headers = { 'Authorization': `Bearer ${stalls_sk}` }
const body = {
  "amount": 25000,
  "currency": "USD",
  "country": "US",
  "save_token": true
}

await axios.post(url, body, { headers })
import requests
url = 'https://api.stallsone.com/v1/balances/topup'
headers = { 'Authorization': f'Bearer {stalls_sk}' }
body = {
	"amount": 25000,
	"currency": "USD",
	"country": "US",
	"save_token": true
}

requests.post(url, data = body, headers = headers)
{
    "message": "Balance topup initiated.",
    "execution_data": {
        "payment_service_provider": "stripe",
        "client_secret": "pi_1IsEtAHgvhVXTLClASWJQqrV_secret_N75CvppiIatcHcavV2bFHhNmC"
    },
    "payment": {
        "currency": "USD",
        "amount": 25000,
        "country": "US",
        "save_token": true,
        "type": "balance_topup",
        "balance_transaction": "credit",
        "customer_id": 1,
        "reference": "pay_e130037977014de58626fdb15aa2291b",
        "created_at": "2021-05-17 23:26:16",
        "updated_at": "2021-05-17 23:26:17",
        "balance_id": 1
    },
    "balance": {
        "created_at": "2021-05-17 22:55:47",
        "updated_at": "2021-05-17 23:26:17",
        "timezone": "UTC",
        "reference": "bal_2e87b71763694e3898bf1cddad5a3f64",
        "customer_id": 1,
        "name": null,
        "description": null,
        "available_amount": 0,
        "pending_amount": 50000,
        "currency": "USD",
        "active": 1,
        "metadata": null
    },
    "customer": {
        "created_at": "2021-05-17 22:55:47",
        "updated_at": "2021-05-17 22:55:47",
        "timezone": "UTC",
        "reference": "cus_2573d01b49f042de8c8aef5408b3cf65",
        "type": "business",
        "email": "[email protected]",
        "phone": null,
        "first_name": "Kudi",
        "last_name": "",
        "business_name": "Kudi",
        "country": "US",
        "metadata": null
    }
}