Settlement instructions Create a settlement instruction
Create a settlement instruction
Saves one of your own bank accounts or crypto wallets to receive FX order proceeds. Pass its `id` as the order destination with type `external_account`. Its currency must match the currency the order buys. Gravv does not check the details with a bank or check for duplicates.
Api-Key
Headers
NameDescription
Idempotency-Key1 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
instruction_typeSend it in lower case, exactly as listed
Possible values: bank_account, crypto_wallet
account_nameName on the account or wallet
currencyCurrency this destination receives, such as
USD or USDC. Gravv stores it as sent and filters match it exactly, so always send upper case.is_defaultMakes this the default for its currency and unsets the old default.
Default
falseaccount_numberRequired for
bank_accountbank_nameRequired for
bank_accountbank_coderouting_numberswift_codeibancountryaddressThe bank's address, stored as sent
wallet_addressRequired for
crypto_wallet. Gravv does not check its format, so check it yourself.networkRequired for
crypto_wallet, such as polygon or stellar. Send lower case.memoRequired when
network is stellarResponse
Returns 200 OK. The saved settlement instruction
NameDescription
dataA settlement instruction. The response leaves out empty fields.
Show 23 child attributesobject
idUse it as an FX order
destination.idtenant_idtypeThe same value as instruction_type
Possible values: bank_account, crypto_wallet
instruction_typeSend it in lower case, exactly as listed
Possible values: bank_account, crypto_wallet
account_namecurrencyis_defaultstatusAlways active; the API does not return deleted instructions
Possible values: active
account_numberbank_namebank_coderouting_numberswift_codeibancountryaddresswallet_addressnetworkmemocreated_atupdated_atdate_createddate_updatederrorErrors
| Status | Meaning |
|---|---|
| 200 | The saved settlement instruction |
| 400 | A missing or invalid field |
Was this page helpful? Yes No
Previous
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v1/settlement-instructions' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: usd-settlement-account-1' \
--header 'Content-Type: application/json' \
--data '{
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US"
}'
const response = await fetch('https://api.gravv.xyz/v1/settlement-instructions', {
method: 'POST',
headers: {
'Api-Key': '<api-key>',
'Idempotency-Key': 'usd-settlement-account-1',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US"
}),
});
const data = await response.json();
console.log(response.status, data);
import requests
url = "https://api.gravv.xyz/v1/settlement-instructions"
headers = {
"Api-Key": "<api-key>",
"Idempotency-Key": "usd-settlement-account-1",
}
payload = {
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": True,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US",
}
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(`{
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US"
}`)
req, err := http.NewRequest("POST", "https://api.gravv.xyz/v1/settlement-instructions", bytes.NewReader(payload))
if err != nil {
panic(err)
}
req.Header.Set("Api-Key", "<api-key>")
req.Header.Set("Idempotency-Key", "usd-settlement-account-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/v1/settlement-instructions")
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"] = "usd-settlement-account-1"
request["Content-Type"] = "application/json"
request.body = JSON.generate({
"instruction_type" => "bank_account",
"account_name" => "Acme Treasury LLC",
"currency" => "USD",
"is_default" => true,
"account_number" => "000987654321",
"bank_name" => "Example Bank",
"routing_number" => "026009593",
"country" => "US",
})
response = http.request(request)
puts response.code
puts response.body
<?php
$payload = [
'instruction_type' => 'bank_account',
'account_name' => 'Acme Treasury LLC',
'currency' => 'USD',
'is_default' => true,
'account_number' => '000987654321',
'bank_name' => 'Example Bank',
'routing_number' => '026009593',
'country' => 'US',
];
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => 'https://api.gravv.xyz/v1/settlement-instructions',
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => [
'Api-Key: <api-key>',
'Idempotency-Key: usd-settlement-account-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 = """
{
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US"
}
""";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://api.gravv.xyz/v1/settlement-instructions"))
.header("Api-Key", "<api-key>")
.header("Idempotency-Key", "usd-settlement-account-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/v1/settlement-instructions");
request.Headers.TryAddWithoutValidation("Api-Key", "<api-key>");
request.Headers.TryAddWithoutValidation("Idempotency-Key", "usd-settlement-account-1");
request.Content = new StringContent(
"""
{
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US"
}
""",
Encoding.UTF8,
"application/json");
using var response = await client.SendAsync(request);
Console.WriteLine((int)response.StatusCode);
Console.WriteLine(await response.Content.ReadAsStringAsync());
Responseapplication/json
200400OK
{
"data": {
"id": "b7e1c2d3-4f5a-4b6c-9d8e-7f6a5b4c3d2e",
"tenant_id": "0d9c8b7a-6f5e-4d3c-2b1a-0f9e8d7c6b5a",
"type": "bank_account",
"instruction_type": "bank_account",
"account_name": "Acme Treasury LLC",
"currency": "USD",
"is_default": true,
"status": "active",
"account_number": "000987654321",
"bank_name": "Example Bank",
"routing_number": "026009593",
"country": "US",
"created_at": "2026-10-12T09:20:00Z",
"updated_at": "2026-10-12T09:20:00Z",
"date_created": "2026-10-12T09:20:00Z",
"date_updated": "2026-10-12T09:20:00Z"
},
"error": null
}
{
"data": null,
"error": "memo is required for the stellar network: invalid input"
}