Accounts Payable
Retrieve and create bills using the Accounting API
Accounts payable
In Codat's APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms. a Bill represents an invoice from a supplier, for this use case bills can be retrieved from the Accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms., or you can create bills within your platform and post them to your customers accounting software.
Managing suppliers
In the accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms. a supplier represents a business or sole trader that provides goods or services to a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources..
Suppliers are relevant for the bill pay use case as each bill is associated to a supplier - suppliers also have important information such as addresses and contact details which could be used to notify a supplier once a payment is made.
Retrieve a list of suppliers
You can get a list of suppliers using the Accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms.
GET https://api.codat.io/companies/{companyId}/data/suppliers?page=1&pageSize=100
Query parameters can also be used to narrow the list of suppliers e.g.
status=Activereturns only active suppliersdefaultCurrency=USDreturns suppliers that provide goods or services in dollarssupplierName=Acmereturns suppliers with a name that matches the query
Currently the accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms. does not expose supplier balances on the supplier endpoint, however you can access these by
- Aggregating bills by supplier
- Using the Aged debtors report
Creating a new supplier
In some cases, a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. may do business with a new supplier for the first time, when this happens you should create the supplier first before creating a bill against the supplier.
POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/suppliers
Updating a supplier
If a supplier changes address or business name, you may want to reflect this change in the companies accounting software by updating the supplier.
PUT https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/suppliers/{supplierId}
Bills
Bills can either be created in the companies accounting software and then queried through the Accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms., or bills can be created in your application and then posted to the companies accounting software.
Get a list of bills
You can get a list of bills for a companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. from the Accounting APIAPI A set of rules and protocols that allows different software applications to communicate with each other. Codat provides APIs for accessing financial data from accounting, banking, and commerce platforms.
GET https://api.codat.io/companies/{companyId}/data/bills?page=1&pageSize=100
Query parameters can be used to filter and narrow the returned results e.g.
supplierRef.supplierName=acme increturns only bills associated to the specified supplierdueDate>2023-06-01&&dueDate<2023-06-30returns only bills due for payment between June 1st and June 30thamountDue>0returns only outstanding bills with due amounts
You can also retrieve any associated attachments for a given bill such as a pdf copy of the invoice issued by the supplier.
Create a bill
You can also create a new bill in your companies accounting software to represent goods or services purchased from a supplier.
POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/bills
Upload a copy of the invoice
In some cases where a bill is being created in your application, the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. may also want to save a copy of the pdf invoice against the bill in their accounting software. This can be supported via the bill attachments API
POST https://api.codat.io/companies/{companyId}/connections/{connectionId}/push/bills/{billId}/attachments
Read next
- Payment mapping - Enable SMBsSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. to choose how to make payments