Skip to main content
This guide explains the API calls to send the movements of an account you hold for your end-users to their accounting software, as a bank feed. For the business context (what happens to a line in the accounting software, and who configures what), read the Bank feeds to accounting use case first.
Your end-user, or their accountant, makes the accounting choices: which bank account in their books each of your accounts feeds, and when the feed starts. You build the setup screen where they make these choices, and the logic that sends the statements.

1. Fetch the bank accounts

Fetch the bank accounts when the end-user connects their accounting software. Show them in your setup screen. Store the selection of the end-user for each consumer, for each of your accounts and for each currency. Call Get bank accounts. The list is paginated: see Pagination. When the connection gives access to several folders, add folder_id. See Multi-folder.
  • Store the id. You send it as bank_account_id on the statement.
  • Show the account_name and the code.
  • Use the iban to suggest a match with your account. It is empty when the accounting software holds no IBAN for the bank account.
  • Check the currency. The currency of a statement must be the currency of its bank account. Your end-user links each of your accounts, in each currency, to one bank account.
When no bank account matches, your end-user creates one in their accounting software. You can also create it from your setup screen with Create bank account, when the connector supports it.

2. Send the statement

Create one statement for each of your accounts and for each day. Call Create bank transactions: POST /consumers/{consumer_id}/accounting/bank-transactions

Statement fields

  • bank_statement_date: the date of the statement (YYYY-MM-DD).
  • bank_account_id: the bank account selected for this account and this currency (see step 1).
  • currency: the ISO 4217 code, for example EUR. It must be the currency of the bank account. For another currency than the one of the folder, see Multi-currency.
  • external_bank_statement_id: your identifier of the statement. Use digits only, with a maximum length of 10.
  • opening_balance: the balance of the account before the statement. Send it on every statement. The accounting software uses it to check the balance.
  • pdf and pdf_name: the PDF of the statement in base64, and its file name. The file name accepts letters, digits, -, _ and spaces, and can end with .pdf. See Attachments.
  • items: the lines of the statement.

Line fields

  • amount: the amount of the movement, including fee and tax. Send a positive amount for money received and a negative amount for money leaving the account.
  • description: the most identifying text of the movement, such as the counterparty name or the reference of an invoice. The accounting software uses it to suggest a match during reconciliation.
  • external_transaction_id: your identifier of the movement.
  • counterpart: the counterparty, with name, iban and bank_account.
  • fee_amount, tax_amount, currency_exchange_rate and general_ledger_account: optional. Each accounting software uses only the fields that it can store. Check the page of the connector.

Check the balance before you send

Send every settled movement once, and only settled movements. A pending movement is sent after it has settled. Before you send a statement, check the balance:
When the two do not match, a movement is missing or sent twice. Do not send the statement until you find the difference.

Example

POST /consumers/{consumer_id}/accounting/bank-transactions
The closing balance of this statement is 10,000.00 + 2,500.00 - 6.72 - 1,000.00 = 11,493.28. The values between < and > come from step 1 and from your own data. The response returns the id of the statement and the id of each line. Store them.

Avoid duplicates

Add a unique x-chift-client-requestid header to each request. When you retry a request that already succeeded, Chift answers with a 409 error and does not create a second statement. See Idempotency. Run your synchronization on a schedule, for example every night. Start it on the day chosen by your end-user. This day must follow the last movement already in their books. Otherwise, the same movements are booked twice.

3. Check the result

The Accounting API has no call to read bank statements. Check the result in the accounting software, on the bank account. The lines wait for reconciliation, and the balance of the bank account must match the balance of your account. For the errors, see Errors. Not every accounting software supports bank transactions. Check the coverage matrix.