Create source account
To establish a bank feed with your customer's accounting software, you'll first need to set up source accounts. These accounts serve as representations of the company's financial accounts within the Codat platform.
During the subsequent mapping process, these source accounts can be linked to corresponding accounts in the customer's accounting software.
For GBP bank accounts, sortCode
is also a required field.
Codat categorizes bank accounts into either credit or debit types for standardization.
Below is a list that matches Open Banking's AccountSubType with Codat's standardized accountType:
AccountSubType | accountType (Codat) |
---|---|
ChargeCard | Credit |
CreditCard | Credit |
CurrentAccount | Debit |
EMoney | Debit |
Loan | Credit |
Mortgage | Credit |
PrePaidCard | Debit |
Savings | Debit |
- Request
- Response
Example request body for creating a debit account:
POST /companies/:companyId/connections/:connectionId/connectionInfo/bankFeedAccounts
{
"id": "ac-001",
"accountName": "Checking Account",
"accountType": "Debit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 4002
}
Example of a response for a credit card received upon source account creation:
{
"id": "a3f28138-e2b9-4daa-92e1-5a99fb29ac42",
"accountName": "Checking Account",
"accountType": "credit",
"accountNumber": "4243",
"currency": "GBP",
"balance": 100.00,
"status": "pending",
"modifiedDate": "2023-09-06T09:13:40.2266667"
}
Note that this is a synchronous response - assuming the sourceAccount passes validation, you should expect a 200
status code indicating a successful operation.
The account status will stay as pending
until the company associates the source account with a corresponding target account in their accounting software.
You must wait for the status to change to linked
before you can successfully transmit any bank transactions.
Once the source account is successfully created you can then guide the company through the mapping process.
You can create multiple accounts in different currencies using the same POST endpoint for the company and data connection.
If the user has not enabled multi-currency in their accounting software you will get an error message which you can display to the user.
Updating a source account
In certain situations, you might wish to modify a source account prior to its mapping. This could occur if the user at the company has a preference for a specific bank account name to appear in their accounting software.
To achieve this, you can use the update-source-accounts endpoint.
PUT /companies/:companyId/connections/:connectionId/connectionInfo/bankFeedAccounts/:accountId
{
"id": "ac-001",
"accountName": "Bank of X Checking Account",
"accountType": "Debit",
"accountNumber": "12345670",
"currency": "GBP",
"balance": 4002
}
Removing a source account
If your customer decides to close their account, you can also remove it from Codat . Doing so will not delete the account from their accounting software, but it will disable the bank feed, preventing any new transactions from appearing.
DELETE /companies/:companyId/connections/:connectionId/connectionInfo/bankFeedAccounts/:accountId