Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Savings Simulate interest (sandbox)

Simulate interest (sandbox)

Sandbox only. Adds interest to a savings now, as the nightly run does in live, and sends `savings.interest.credited` with `source` `simulated`. The savings must hold money first. Needs a key that can initiate transfers. A live key gets a 400.

POSThttps://api.gravv.xyz/v1/savings/simulate/interestTry it
Api-Key

Headers

NameDescription
Idempotency-Key:stringRequired
1 to 255 printable ASCII characters. A retry with the same key within 24 hours returns the first response, including a 400. After you correct a request, send a new key.

Body parameters

NameDescription
account_id:string
The savings account
wallet_id:string
A savings wallet with no account
amount:stringRequired
The interest to add, from 0.000001 to 1000, with at most 6 decimal places

Response

Returns 200 OK. The interest was added

NameDescription
data:object
Show 8 child attributesobject
error:null

Errors

StatusMeaning
200The interest was added
400A live key, both or neither of account_id and wallet_id, an amount out of range, nothing saved yet, or an id that is not a savings one
403The key cannot initiate transfers
404The id is not a savings account or savings wallet of yours
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/savings/simulate/interest' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: savings-interest-1' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "d9eae506-77b4-4e8b-8ab3-caaf96054d79",
"amount": "0.25"
}'
Responseapplication/json
200400403404OK
{
"data": {
"transaction_id": "b75f078b-6c03-4a6d-b8e4-ecc1634b6727",
"type": "savings_interest",
"account_id": "d9eae506-77b4-4e8b-8ab3-caaf96054d79",
"wallet_id": "d4ed232e-ebd1-43b3-b6d7-b6739cadd13f",
"amount": "0.25",
"currency": "USDC",
"saved_balance": "110.250000",
"status": "completed"
},
"error": null
}