Add a Stellar USDC wallet, make it the default for its currency, and retire a closed bank account so no order pays it.
4 min read
This recipe adds a Stellar USDC wallet, makes it the default for its currency, and retires a closed bank account so that no order pays it.
Who it is for. A treasury team that receives FX proceeds into several of its own bank accounts and wallets, and needs to add, switch and retire them.
Status. Available.
Money example
Harbor Digital receives USDC on Stellar and naira at its bank.
1.
It adds a Stellar USDC wallet as an instruction, with its memo.
2.
It makes the new wallet the USDC default. The older USDC instruction stops being the default.
3.
Its old naira account closes, so it deletes that instruction. Gravv then refuses any order that still points at the instruction, instead of paying a closed account.
Before you start
A scoped key needs payee:create to create and update, and payee:delete to delete. Reading needs no permission.
Find out what is required
The create call names every missing field. The only network rule is that stellar needs memo. Gravv does not check wallet addresses, so copy them carefully.
The response is the new instruction, with id132c8884-fe71-46b0-8c73-2fdb614f7bb8, is_defaultfalse and statusactive. Gravv stores network as typed, so stellar, Stellar and XLM are three different values. Keep one lower-case spelling.
The deleted instruction disappears from every read. Gravv refuses an order sent to it with bad destination: [400] invalid order destination. Orders already completed keep its id as destination_id. If it was the default, make another instruction the default, because Gravv does not promote one for you.
What can go wrong
Response
Why
Fix
400 memo is required for the stellar network: invalid input
A Stellar wallet with no memo
Add memo
400 wallet address is required for crypto wallets: invalid input / network is required for crypto wallets: invalid input
A field is missing
Add the missing field
400 settlement instruction <id>: resource not found
The instruction is unknown, belongs to another business, or is already deleted (a second delete also returns this)
List your instructions to get current ids
400 invalid id
The path id is not a UUID
Use the id from the list
A PATCH to change currency or instruction_type does nothing
Both are fixed after create
Delete the instruction and create a new one
A PATCH with "" does not clear a field
An empty string keeps the value, so you cannot clear any field
Create a new instruction
A PATCH accepts a Stellar network with no memo
The update runs no checks
Always send memo with a Stellar network
Two defaults for "the same" currency
usdc and USDC are different currencies to the default rule
Always send upper case
The list stops at 10
The page size is 10 unless you send items_per_page
Send items_per_page
Webhooks you will receive
Gravv sends no webhooks for settlement instructions.
Testing in sandbox
You can test every step of this recipe in sandbox. Instructions are records only, and every response above is the same in sandbox.