API reference
Add test funds
POST
/test/fundSandbox onlySandbox only. Credits simulated funds to a Sandbox wallet so you can test large or repeated transfers. Requires an Idempotency-Key. Calling it against the Live base URL returns sandbox_only.
- Required scope
- transfers:write
- Idempotency-Key
- Required
- Environments
- Sandbox
Request body
amountintegerrequiredAmount in the currency's minor unit (for example cents). Integer.
max 1,000,000,000
currencyenumrequiredISO 4217 currency code.
"USD", "EUR", "GBP", "XOF", "XAF", "NGN", "GHS", "KES"
Example request
curl -X POST "https://api.gloresend.com/sandbox/v1/test/fund" \
-H "Authorization: Bearer $GLORESEND_TEST_KEY" \
-H "Idempotency-Key: $(uuidgen)" \
-H "Content-Type: application/json" \
-d '{
"amount": 500000,
"currency": "XOF"
}'Response · 200
200 · application/json
{
"object": "balance",
"currency": "XOF",
"available": 1500000,
"reserved": 0,
"total": 1500000,
"test_data": true
}Response fields
objectenumrequired"balance"
currencyenumrequiredISO 4217 currency code.
"USD", "EUR", "GBP", "XOF", "XAF", "NGN", "GHS", "KES"
availableintegerrequiredFunds that can be used for new transfers, in minor units.
reservedintegerrequiredFunds held for transfers that are still processing, in minor units.
totalintegerrequiredavailable + reserved, in minor units.
test_databooleanrequiredtrue for every Sandbox object. Sandbox balances are simulated and have no monetary value.
Errors
- 401authentication_requiredNo credentials were supplied. Send
Authorization: Bearer <api key>. - 401invalid_api_keyThe API key is unknown, revoked or expired.
- 401environment_mismatchThe API key belongs to a different environment than the base URL you called. Sandbox keys (
gs_test_) only work against the Sandbox base URL, Live keys (gs_live_) only against the Live base URL. - 429rate_limitedToo many requests. Wait for the number of seconds in the
Retry-Afterheader. - 400validation_errorThe request body, query or headers failed validation.
parampoints at the first invalid field. - 400idempotency_key_requiredThis endpoint can create side effects and requires an
Idempotency-Keyheader. - 403insufficient_scopeThe API key does not have the scope required for this endpoint.
- 403sandbox_onlyThis endpoint only exists in the Sandbox environment.