Gravv
/Docs
Search docs or ask a question⌘K
DocsAgent
ChangelogTry sandbox
Accounts v2 Create an account

Create an account

Opens a bank account, with a token wallet where the bank offers one, for a customer whose KYC is completed. First call `GET /v1/accounts/capabilities` to choose `bank_code`, `currency` and `account_type`, then `GET /v2/accounts/requirements` to build `data`.

POSThttps://api.gravv.xyz/v2/accountsTry it
Api-Key

Opens a bank account, with a token wallet where the bank offers one, for a customer whose KYC is completed. First call GET /v1/accounts/capabilities to choose bank_code, currency and account_type, then GET /v2/accounts/requirements to build data.

The response has only account_id and status: pending. Get the account for application_id and status_reason, and poll until it is active, or wait for the applications.accounts.completed webhook. Gravv does not send account.activated for v2 accounts. The API rejects unknown fields. When you retry, reuse the same Idempotency-Key.

For a savings account send category: savings, currency: USD, and no wallet_id. A customer can hold one savings account. It cannot have a settlement wallet and cannot be closed yet.

Headers

NameDescription
Idempotency-Key:stringRequired
Required 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

Choose the tab for the kind of account. Each kind takes different top-level fields and a different form in data.

Wallet-backed USD accountWallet-backed EUR or GBP accountUSD account in the US (no wallet)EUR or GBP account with its own IBANNGN accountAccount held in KenyaSavings account

A USD account with US bank details whose deposits arrive as USDC in the account's own wallet. Choose an option whose token_wallets is not empty, then send network or wallet_id.

NameDescription
customer_id:stringRequired
An existing customer whose KYC is completed. The API checks it before every other field.
customer_type:string

individual or business. Always send it, because bank choice and routing use the value you send. Defaults to the customer's profile type.

Possible values: individual, business

account_type:string
Account type from the option's account_types: operating, regular, card or default. Defaults to operating. Only your business's own customer can hold card or default.
currency:stringRequired

Three-letter ISO 4217 code. The API also accepts lower case.

Possible values: USD

category:string

main for your business's own account, sub_account for a customer's account. Defaults to main for your business's own customer and sub_account for any other customer.

Possible values: main, sub_account

label:string
Your label for the account, at most 255 bytes
bank_code:string
A bank_code from GET /v1/accounts/capabilities whose option has a non-empty token_wallets. Leave it out to use the default USD option, the highest-priority bank that fits.
network:string

Network for the account's token wallet. Send network or wallet_id, never both. It must be one of the networks in the option's token_wallets (token_options on the requirements form), and one of stellar, polygon, ethereum, avalanche_c_chain or solana.

Possible values: stellar, polygon, ethereum, avalanche_c_chain, solana

wallet_id:string
An existing wallet of yours to use instead of network. Gravv takes the network from the wallet, and the option must offer that network. Send one, not both.
data:object
The form from GET /v2/accounts/requirements. Put root scope fields in data.root, party fields in data.parties[], and documents in data.documents[] or a party's documents.
Show 3 child attributesobject

Send at least one of network or wallet_id.

Response

Returns 200 OK. Account opening started

NameDescription
data:object
Show 2 child attributesobject
error:null

Errors

StatusMeaning
200Account opening started
400Invalid request, a customer that does not exist or has not completed KYC, or no bank fits the request. The machine code is in details.<field>, such as ACCOUNT_TYPE_RESERVED_FOR_TENANT on account_type (card or default for a customer other than your business), DEFAULT_REQUIRES_MAIN_CATEGORY on category, or, with bank_code, UNKNOWN_BANK, BANK_NOT_AVAILABLE, ACCOUNT_TYPE_NOT_SUPPORTED, CURRENCY_NOT_SUPPORTED, CATEGORY_NOT_SUPPORTED, CUSTOMER_TYPE_NOT_SUPPORTED, COUNTRY_NOT_SERVED or SUBDIVISION_NOT_SERVED. Without bank_code, the same problems return UNSUPPORTED_COMBINATION. A savings account returns SAVINGS_CURRENCY_NOT_SUPPORTED on currency (not USD), SAVINGS_ACCOUNT_TYPE_NOT_SUPPORTED on account_type (not regular), SAVINGS_NETWORK_NOT_SUPPORTED on network (not avalanche_c_chain) or SAVINGS_WALLET_NOT_ACCEPTED on wallet_id.
409The customer is at the account limit, the bank is disabled for this account, an application is already in progress at this bank, or a request with the same Idempotency-Key is still running. Also CARD_ACCOUNT_ALREADY_EXISTS (a second card account for the customer), DEFAULT_ACCOUNT_ALREADY_EXISTS (a second default account for your business), MAIN_ACCOUNT_ALREADY_EXISTS (a second main default account), WALLET_ALREADY_ASSIGNED (the wallet already backs another account) and SAVINGS_ACCOUNT_ALREADY_EXISTS (a second savings account for the customer).
422You used the Idempotency-Key before with a different body.
503Gravv could not read the customer record. Retry with the same key.
Was this page helpful? Yes No
Request
cURLJavaScriptPythonGoRubyPHPJavaC#cURL
curl --request POST \
--url 'https://api.gravv.xyz/v2/accounts' \
--header 'Api-Key: <api-key>' \
--header 'Idempotency-Key: open-usd-account-jane-1' \
--header 'Content-Type: application/json' \
--data '{
"customer_id": "0b6f3c1e-2a4d-4c8e-9f10-7d2a6b5e4c33",
"customer_type": "individual",
"currency": "USD",
"account_type": "operating",
"category": "sub_account",
"bank_code": "cross_river_bank",
"network": "polygon",
"label": "Jane USD",
"data": {
"root": {
"first_name": "Jane",
"last_name": "Doe",
"date_of_birth": "1990-04-02",
"email": "jane@example.com",
"phone_daytime": "+447700900123",
"gender": "female",
"citizenship_country": "GB",
"tax_residence_country": "GB",
"permanent_address": {
"address_line": "1 High St",
"city": "London",
"state": "GB-LND",
"postal_code": "EC1A 1BB",
"country": "GB"
}
},
"documents": [
{
"document_type": "passport",
"issuing_country": "GB",
"number": "123456789",
"issued_date": "2020-01-15",
"expiration_date": "2030-01-14",
"filename": "passport.jpg",
"content": "<base64>"
},
{
"document_type": "proof_of_address",
"issuing_country": "GB",
"filename": "bill.pdf",
"content": "<base64>"
}
]
}
}'
Responseapplication/json
200400409422503OK
{
"data": {
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"status": "pending"
},
"error": null
}