1. Create a financial account
Observed — createFinancialAccount mutation captured from /admin/company/bank-details.
Why
A business unit (organization) must be linkable to a bank account (IBAN/BIC) for collections and for mentions on notices/receipts.
Prerequisites
- API token
- Valid IBAN / BIC (anonymized here)
Step — Create the account
- GraphQL
- Node.js
- curl
mutation createFinancialAccount($financialAccount: FinancialAccountInput!) {
createFinancialAccount(financialAccount: $financialAccount) {
id
iban
bic
bankName
accountHolderName
isPrimaryAccount
}
}
{
"financialAccount": {
"bankName": "Example Bank",
"bic": "BNPAFRPP",
"iban": "FR76XXXXXXXXXXXXXXXXXXXXXXX",
"isPrimaryAccount": false,
"bankAddress": {}
}
}
import { ublo } from '../ubloClient.mjs';
const data = await ublo(
`mutation createFinancialAccount($financialAccount: FinancialAccountInput!) {
createFinancialAccount(financialAccount: $financialAccount) {
id
iban
bic
bankName
isPrimaryAccount
}
}`,
{
financialAccount: {
bankName: 'Example Bank',
bic: 'BNPAFRPP',
iban: 'FR76XXXXXXXXXXXXXXXXXXXXXXX',
isPrimaryAccount: false,
bankAddress: {},
},
},
);
const financialAccountId = data.createFinancialAccount.id;
console.log({ financialAccountId });
- Bearer
- Cookie session
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H "Authorization: Bearer $UBLO_API_TOKEN" \
-H 'Content-Type: application/json' \
-d @- <<'EOF'
{
"query": "mutation createFinancialAccount($financialAccount: FinancialAccountInput!) { createFinancialAccount(financialAccount: $financialAccount) { id iban bic bankName isPrimaryAccount } }",
"variables": {
"financialAccount": {
"bankName": "Example Bank",
"bic": "BNPAFRPP",
"iban": "FR76XXXXXXXXXXXXXXXXXXXXXXX",
"isPrimaryAccount": false,
"bankAddress": {}
}
}
}
EOF
curl -sS -X POST "$UBLO_GRAPHQL_URL" \
-H 'Content-Type: application/json' \
-b cookies.txt \
-d @- <<'EOF'
{
"query": "mutation createFinancialAccount($financialAccount: FinancialAccountInput!) { createFinancialAccount(financialAccount: $financialAccount) { id iban bic bankName isPrimaryAccount } }",
"variables": {
"financialAccount": {
"bankName": "Example Bank",
"bic": "BNPAFRPP",
"iban": "FR76XXXXXXXXXXXXXXXXXXXXXXX",
"isPrimaryAccount": false,
"bankAddress": {}
}
}
}
EOF
Update
Observed mutation: updateFinancialAccount(id, financialAccount).
Next
Keep financialAccountId → Create a business unit.
Schema: createFinancialAccount · domain Banking / Organization.