setDefaultBankAccount
Requires permission payments:bank-account:update.
Makes a bank account the default for its currency and turns it on if it was off. The other accounts in the same currency lose the default flag. Requires permission to update 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 SetDefaultBankAccount($id: ID!) {
setDefaultBankAccount(id: $id) {
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 SetDefaultBankAccount($id: ID!) {\n setDefaultBankAccount(id: $id) {\n id\n accountNumber\n branchCode\n currencyCode\n swiftCode\n accountName\n }\n}",
"variables": {
"id": "id"
}
}
EOF
Variables:
{
"id": "id"
}
Response:
{
"data": {
"setDefaultBankAccount": {
"id": "id",
"accountNumber": "string",
"branchCode": "string",
"currencyCode": "string",
"swiftCode": "string",
"accountName": "string"
}
}
}
setDefaultBankAccount(
id: ID!
): BankAccount!
Arguments
setDefaultBankAccount.id ● ID! non-null scalar
The ID of the bank account.
Type
BankAccount object
A bank account the organization receives money into or pays from, in one currency.