Open a sandbox savings account, fund it, save, add interest, read a statement, withdraw, and trigger a failed save, a waiting withdrawal and a refunded withdrawal.
7 min read
Use this recipe to run the whole savings flow in sandbox: open a savings account, fund it, save, add interest, read a statement and withdraw. Then trigger the three outcomes you need screens for: a failed save, a withdrawal that waits, and a refunded withdrawal.
Who it is for. A neobank adding a savings jar to its app, testing every screen before launch.
Status. Available in sandbox. Savings is not yet available with a live key.
Money example
1.
You simulate a 150.00 USD deposit. Available is 150, saved is 0.
2.
You save 100. About a minute later: available 50, saved 100.
3.
You add 0.25 of interest. Saved is 100.25.
4.
You withdraw 50. Available 100, saved 50.25.
5.
A save of 5.13 fails, and nothing moves.
6.
A withdrawal of 5.13 waits about 2 minutes, then completes. Available 105.13, saved 45.12.
7.
A withdrawal of 5.14 fails, and the 5.14 stays in savings.
Before you start
•
A sandbox key (grvSec_sandbox_) that can initiate transfers.
•
A sandbox customer whose KYC is completed. New sandbox customers do not complete KYC today, so ask support for a verified one if you have none. See Verify a customer in sandbox.
•
A webhook URL set in the Dashboard in Sandbox mode, to see the events.
Find out what is required
A savings account takes customer_id, customer_type, currencyUSD and categorysavings. A customer can hold one. Saves and withdrawals use the savings account id on both sides of POST /v1/transfer. See How savings works.
The response has account_id and statuspending. Read the account with GET /v2/accounts/{id} until it is active, or wait for applications.accounts.completed.
After transfer.status.completed, available is 100 and saved is 50.25.
7. Trigger the other outcomes
Repeat step 3 or step 6 with these amounts. Each needs a new Idempotency-Key.
Move
Amount
What happens
Save
5.13
transfer.status.failed. Nothing moves
Withdraw
5.13
transfer.savings.awaiting_liquidity, and pending_balance is -5.130000 while it waits. About 2 minutes later, transfer.status.completed
Withdraw
5.14
transfer.status.failed. The 5.14 stays in savings
What can go wrong
Response
Why
Fix
400 that says the customer has not completed KYC, on step 1
The customer is not verified
Use a verified sandbox customer
400 no account option is available for the requested combination ... on step 1
customer_type is missing
Send customer_type
409 SAVINGS_ACCOUNT_ALREADY_EXISTS
The customer already has a savings account
Use that account. Find it with GET /v2/accounts?customer_id=...
400 nothing saved: save into this account before simulating interest
Step 4 before step 3 completed
Wait for transfer.status.completed on the save
400 The amount is more than the savings balance.
A withdrawal larger than saved_balance
Withdraw less
400 savings interest can only be simulated in sandbox
A live key on step 4
Use your sandbox key
501 on a savings read
A live key
Use your sandbox key
Webhooks you will receive
•
applications.accounts.completed when the account opens.
•
A transfer.inflow.* event for the simulated deposit.
•
transfer.status.pending, then transfer.status.completed or transfer.status.failed, for each save and withdrawal.
•
transfer.savings.awaiting_liquidity for the 5.13 withdrawal.
•
savings.interest.credited for the simulated interest.
Testing in sandbox
This page is the sandbox guide for savings. Sandbox differs from live in four ways: the rate is fixed at 3.50 and indicative is true, there is no nightly interest, the 1 USD smallest save is not applied, and the .13 and .14 amounts above choose the outcome.