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

Open an account

Open a v2 account with one POST /v2/accounts, and read the errors it can return.

8 min read

API version: v2.

POST /v2/accounts opens an account at the option you chose, with the data its requirements form asks for. There is no draft, submit or process step. The one call starts the bank's review.

A money example. Ada's account for her 1,200.00 USD invoice is a wallet-backed USD account on polygon. You send one request with her details, her passport and a utility bill. The response has status pending. A few minutes or days later the bank approves the account, and her client can pay.

Before you start

•
The customer's basic KYC is completed. The API checks this first. Until it passes, the API reports no other error.
•
You have an option from capabilities and its form from requirements.
•
The customer has not reached max_accounts_per_customer at that option. The limit counts the customer's pending and active accounts there in the same currency and the same account_type. To count them, use GET /v2/accounts?customer_id=….
•
account_type is one the option lists. Only your business's own customer can hold card or default.

Send the request

Open a wallet-backed USD account
curl --request POST \
--url https://api.gravv.xyz/v2/accounts \
--header 'Api-Key: <API_KEY>' \
--header 'Idempotency-Key: 5eedf850-57d4-4d57-ad69-6f0593c45c2b' \
--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": "<bank_code>",
"network": "polygon",
"label": "Ada USD",
"data": {
"root": {
"first_name": "Ada",
"last_name": "Okafor",
"date_of_birth": "1991-03-14",
"email": "ada.okafor@example.com",
"phone_daytime": "+447911123456",
"gender": "female",
"citizenship_country": "GB",
"tax_residence_country": "GB",
"permanent_address": {
"address_line": "12 Crown Street",
"city": "London",
"state": "GB-LND",
"postal_code": "EC1A 1BB",
"country": "GB"
}
},
"documents": [
{
"document_type": "passport",
"issuing_country": "GB",
"number": "533401372",
"issued_date": "2022-01-31",
"expiration_date": "2032-01-30",
"filename": "passport.jpg",
"content": "<base64 of the passport photo page>"
},
{
"document_type": "proof_of_address",
"issuing_country": "GB",
"filename": "utility-bill.pdf",
"content": "<base64 of a recent utility bill>"
}
]
}
}
'
Response (HTTP 200)
{
"data": {
"account_id": "6f1c2a9e-3b1d-4f7a-9c62-0d8e4b7a5c11",
"status": "pending"
},
"error": null
}

Save account_id. The response has no application_id, so read it from GET /v2/accounts/{id}.

What to send

•
For a wallet-backed option (non-empty token_wallets), send network from the option's token_options. Instead of network, you can send the wallet_id of one of your wallets on one of those networks. Never send both.
•
For a fiat-only option, send neither network nor wallet_id.
•
Send category: sub_account for a customer's account, main only for your business's own account. These are the only two you can open. If you leave it out, it is main for your business's own customer and sub_account for any other customer.
•
Send account_type from the option's account_types: operating (the default), regular, card or default. A default account also needs category main.
•
Send customer_type. In data.root, send citizenship_country for a person or incorporation_country for a business.
•
An individual sends no parties. Everything about the applicant goes in data.root.
•
For a business, send data.parties[]. Name each person from the customer record by id, and add the facts the record lacks (ownership, control, signer, documents). If you leave parties out, the API declares every associated person without those facts, and the request fails validation on them.
•
Identity documents carry number, issued_date, expiration_date and issuing_country. content is raw base64, not a data: URI.
•
Each document is at most 2 MB. In sandbox, keep the files in one request under 500 KB in total. Sandbox refuses requests from about 600 KB with a 413.
•
Gravv does not deduplicate a request body over 1 MiB under its Idempotency-Key. Documents of about 770 KB or more make a body that large. A retry of such a request runs again instead of returning the first response. After a timeout, list the customer's accounts before you send it again.

Errors

Every 400 lists all the problems it found in details, keyed by field. Fix them all, then send the request again with a new Idempotency-Key. Gravv stores a 4xx response under its key for 24 hours and replays it if you reuse the key.

ResponseWhyFix
400 the customer for the customer_id supplied has not completed KYC; … (CUSTOMER_KYC_INCOMPLETE)basic KYC is not completedFinish KYC, then send again with a new key
400 no customer record exists for the customer_id supplied; … (CUSTOMER_NOT_FOUND)Wrong id, or an id from the other environmentUse the id from POST /v1/customers in the same environment
400 Date of Birth is required (and 1 other field; see details)Missing fields, each named in detailsFill every key in details
400 network is required for account options that support wallet integrationWallet-backed option without network or wallet_idSend network
400 network is only accepted for account options that support wallet integrationnetwork sent to a fiat-only optionRemove it
400 this account does not provide a token wallet on bitcoin; … (SELECTION_CONFLICT)The option does not offer that networkUse one of its token_options
400 Network must be sent as a top-level request field; data.root.network is no longer acceptednetwork inside data.rootMove it to the top level
400 invalid request payload: unknown field "blockchain_network"An old field nameSend network
400 invalid request payload: unknown field "provider_override"v2 has no provider_override or bank fieldPin a bank with bank_code
400 missing idempotency key in request headersNo Idempotency-Key headerSend one
400 wallet_id and network are mutually exclusive; send only oneBoth sentSend one
400 bank_code=<code> does not open accounts for customers resident in XX. … (COUNTRY_NOT_SERVED)The option does not serve that countryChoose another option
400 bank_code=<code> does not offer currency=GBP; … (CURRENCY_NOT_SUPPORTED)The option does not offer that currencyChoose another option
400 bank_code=<code> does not offer account_type=<type>; it offers … (ACCOUNT_TYPE_NOT_SUPPORTED)The pinned bank_code does not offer that type, such as yieldSend one of the types it lists
400 CATEGORY_NOT_SUPPORTED, CUSTOMER_TYPE_NOT_SUPPORTED or SUBDIVISION_NOT_SERVED on bank_codeThe pinned bank_code does not serve that category, customer type or stateChoose another option
400 bank_code=<code> is not a bank we offer accounts at; … (UNKNOWN_BANK), or BANK_NOT_AVAILABLEThe bank_code does not exist, or is not open to your businessCopy bank_code from capabilities
400 no account option is available for the requested combination (…) (UNSUPPORTED_COMBINATION)Without bank_code, no option fits what you sent, such as account_type yieldSend a combination that capabilities lists
400 ACCOUNT_TYPE_RESERVED_FOR_TENANT on account_typecard or default for a customer other than your businessUse operating or regular
400 DEFAULT_REQUIRES_MAIN_CATEGORY on categorydefault without category main. Send main even though it is the default for your own customerSend category main
400 Category "virtual" is not supported; valid values: main, sub_accountOnly main and sub_account can be openedSend one of them
400 details.documents: required: requires document proof_of_addressA required document is missingAdd it to data.documents
400 document content too large: maximum size is 2MB; …A file over 2 MBCompress it
400 unsupported file type "image/heic"; allowed types are JPEG, PNG, and PDFWrong formatConvert it
400 content must be base64 (standard or URL-safe)A data: prefix or bad base64Send raw base64
400 details.gender: invalid_enum: … expected one of: female, maleThese forms do not accept otherAsk the customer, or choose another option
400 state "LND" is not an ISO-3166-2 subdivision; …A bare state codeSend the full code, such as GB-LND or US-CA
400 parties are not accepted for an individual customer; …parties on an individualRemove parties
400 customer_type=business does not match this customer's registered profile, which is individual. …Wrong customer_typeSend the customer's type
400 this customer already has an existing reference at the resolved bank; root-level fields are no longer accepted for it …The bank already knows this customerSend no data.root
409 this customer already holds the maximum number of USD accounts permitted for this account type (5)The per-customer limit, counted per currency and account_typeReuse an account, or ask support to raise the limit
409 CARD_ACCOUNT_ALREADY_EXISTSThe customer already has a card accountUse it. A deleted, frozen, failed, rejected or closed card account frees the slot
409 DEFAULT_ACCOUNT_ALREADY_EXISTSYour business already has a default accountUse it. A frozen default account still holds the slot
409 MAIN_ACCOUNT_ALREADY_EXISTS on categoryYour business already has a main default accountSend category sub_account
409 WALLET_ALREADY_ASSIGNED on wallet_idThat wallet already backs another accountUse another wallet, or send network
409 customer already has an application in progress for this bankAn earlier application at this bank is openFix that application
409 this account provider is currently disabled for this accountThe option is switched off for your business or this customerChoose another option, or contact support
422 idempotency_key_reusedThe same key with a different bodyUse a new key for each different request
503 the customer record could not be verified right now; … (CUSTOMER_RECORD_UNAVAILABLE)Gravv could not read the customer recordRetry with the same key
503 Service temporarily unavailable. …, 500, 504A temporary faultRetry with the same key. Gravv does not open a second account

The machine codes, such as CARD_ACCOUNT_ALREADY_EXISTS, are in details, under the field they concern. The codes on bank_code appear only when you send bank_code. Without it, the same problems return UNSUPPORTED_COMBINATION.

Accounts opened under your business's own bank customer

Gravv can set up your business so that, at a given bank, every customer's account opens beneath your business's own customer at that bank. It is off unless Gravv turns it on for you. When it is on:

1.
Open your business's own account at that bank first, with the customer_id of your main account.
2.
Wait for applications.accounts.completed.
3.
Then open your customers' accounts.
ResponseWhyFix
400 TENANT_ACCOUNT_REQUIRED on customer_id: this tenant opens accounts for its customers under its own account at this bank, and that account does not exist yet: …Your business's own account at that bank does not exist yetOpen it first
409 TENANT_ACCOUNT_IN_PROGRESS on customer_id: the tenant's own account at this bank is still being opened; try again once it completesYour own account there is still opening. The error carries its application_idRetry once it completes

Webhooks

Gravv sends applications.accounts.pending, then possibly applications.accounts.blocked, then applications.accounts.completed or applications.accounts.failed. Gravv never sends account.activated for a v2 account you open. See Track activation.

Was this page helpful? Yes No