Sandbox Simulate a deposit
Simulate a deposit
Sandbox only. A live key gets a 403. Sends a test bank deposit to an account through the normal deposit flow, with fees, ledger entries and webhooks. The account must be `active` with bank details.
Api-Key
Sandbox only. A live key gets a 403. Sends a test bank deposit to an account through the normal deposit flow, with fees, ledger entries and webhooks. The account must be active with bank details.
A 200 means Gravv accepted the deposit, not that it settled. Wait for the transfer.inflow.completed or transfer.inflow.deposit_settled webhook. Each new Idempotency-Key makes a new deposit.
Headers
NameDescription
Idempotency-KeyRequired for POST requests. The key is 1 to 255 printable ASCII characters. A retry with the same key within 24 hours returns the first response, so reuse the key when you retry the same request.
Body parameters
NameDescription
account_idAn
active account of yours with bank detailsamountPositive amount in major units, as a string. It must fit the rail's smallest unit.
currencyDefaults to the account currency
railRail the deposit arrives on. Defaults to the bank's usual rail.
Possible values: ach, wire, rtp, swift, sepa, fps
Response
Returns 200 OK. Deposit accepted
NameDescription
dataShow 3 child attributesobject
acceptedreferenceReference of the test deposit
statePossible values:
pending, processing, blocked, completed, failed, compensatederrorErrors
| Status | Meaning |
|---|---|
| 200 | Deposit accepted |
| 400 | Invalid amount or rail, or the account cannot take a test deposit |
| 403 | Not a sandbox key |
| 404 | Not found, or not in your business |
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v2/accounts/simulate/deposit' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: open-usd-account-jane-1' \
--header 'Content-Type: application/json' \
--data '{
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire"
}'
const response = await fetch('https://api.gravv.xyz/v2/accounts/simulate/deposit', {
method: 'POST',
headers: {
'Api-Key': '<api-key>',
'Idempotency-Key': 'open-usd-account-jane-1',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire"
}),
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.gravv.xyz/v2/accounts/simulate/deposit"
headers = {
"Api-Key": "<api-key>",
"Idempotency-Key": "open-usd-account-jane-1",
}
payload = {
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire",
}
response = requests.post(url, headers=headers, json=payload)
print(response.status_code)
print(response.json())
package main
import (
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
payload := []byte(`{
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire"
}`)
req, err := http.NewRequest("POST", "https://api.gravv.xyz/v2/accounts/simulate/deposit", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Api-Key", "<api-key>")
req.Header.Set("Idempotency-Key", "open-usd-account-jane-1")
req.Header.Set("Content-Type", "application/json")
res, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
panic(err)
}
fmt.Println(res.Status)
fmt.Println(string(body))
}
require "json"
require "net/http"
require "uri"
uri = URI("https://api.gravv.xyz/v2/accounts/simulate/deposit")
http = Net::HTTP.new(uri.host, uri.port)
http.use_ssl = uri.scheme == "https"
request = Net::HTTP::Post.new(uri)
request["Api-Key"] = "<api-key>"
request["Idempotency-Key"] = "open-usd-account-jane-1"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"account_id" => "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount" => "250.00",
"rail" => "wire",
})
response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
'account_id' => '6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11',
'amount' => '250.00',
'rail' => 'wire',
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.gravv.xyz/v2/accounts/simulate/deposit',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Api-Key: <api-key>',
'Idempotency-Key: open-usd-account-jane-1',
'Content-Type: application/json',
],
CURLOPT_POSTFIELDS => json_encode($payload),
]);
$response = curl_exec($ch);
if ($response === false) {
throw new RuntimeException(curl_error($ch));
}
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
echo $status, PHP_EOL, $response, PHP_EOL;
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
public class Main {
public static void main(String[] args) throws Exception {
String payload = """
{
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.gravv.xyz/v2/accounts/simulate/deposit"))
.header("Api-Key", "<api-key>")
.header("Idempotency-Key", "open-usd-account-jane-1")
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(payload))
.build();
HttpResponse<String> response = HttpClient.newHttpClient()
.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.statusCode());
System.out.println(response.body());
}
}
using System.Net.Http;
using System.Text;
using var client = new HttpClient();
using var request = new HttpRequestMessage(HttpMethod.Post, "https://api.gravv.xyz/v2/accounts/simulate/deposit");
request.Headers.TryAddWithoutValidation("Api-Key", "<api-key>");
request.Headers.TryAddWithoutValidation("Idempotency-Key", "open-usd-account-jane-1");
request.Content = new StringContent(
"""
{
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"amount": "250.00",
"rail": "wire"
}
""",
Encoding.UTF8,
"application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200400403404OK
{
"data": {
"accepted": true,
"reference": "d3b07384-d9a0-4c8f-9e2b-6f1a2c3d4e5f",
"state": "pending"
},
"error": null
}
{
"data": null,
"error": "account has no linked virtual account to deposit into"
}
{
"data": null,
"error": "Forbidden: insufficient permissions to perform this action"
}
{
"data": null,
"error": "Resource not found"
}