createBankAccount
Requires permission payments:bank-account:create.
Adds a bank account to the organization. The account number must be unique within the organization. The first account in a currency becomes that currency's default, and an account flagged as default takes over from the others in the same currency. Requires permission to create bank accounts.
Errors: a failed call returns a GraphQL errors entry, not a field on the result, and data may be null or partial. Read the entry's extensions.code and message; every shape and code is in the Error reference.
Example:
- GraphQL
- cURL
mutation CreateBankAccount($input: CreateBankAccountInput!) {
createBankAccount(input: $input) {
id
accountNumber
branchCode
currencyCode
swiftCode
accountName
}
}
curl -X POST "https://<api-host>/graphql" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
--data @- <<'EOF'
{
"query": "mutation CreateBankAccount($input: CreateBankAccountInput!) {\n createBankAccount(input: $input) {\n id\n accountNumber\n branchCode\n currencyCode\n swiftCode\n accountName\n }\n}",
"variables": {
"input": {
"accountName": "string",
"accountNumber": "string",
"bankName": "string",
"currencyCode": "string"
}
}
}
EOF
Variables:
{
"input": {
"accountName": "string",
"accountNumber": "string",
"bankName": "string",
"currencyCode": "string"
}
}
Response:
{
"data": {
"createBankAccount": {
"id": "id",
"accountNumber": "string",
"branchCode": "string",
"currencyCode": "string",
"swiftCode": "string",
"accountName": "string"
}
}
}
createBankAccount(
input: CreateBankAccountInput!
): BankAccount!
Arguments
createBankAccount.input ● CreateBankAccountInput! non-null input
The account name, number, bank name, currency and optional branch code, SWIFT code, IBAN, type, notes and default flag.
Type
BankAccount object
A bank account the organization receives money into or pays from, in one currency.