Skip to main content

Update bills

Update existing bills using Codat's Bill Pay solution

Invoices or bills?

We distinguish between invoices where the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. owes money and those where the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. is owed money. If the companyCompany In Codat, a company represents your customer's business entity. Companies can have multiple connections to different data sources. receives an invoice and owes money as a result, we call this a bill.

Update a bill

Software coverage

This action is currently only supported for FreeAgent, QuickBooks Online, and Xero.

In some cases, your SMBSMB The primary customer segment that Codat helps businesses serve, typically companies with annual revenues under $500 million. customer may want to update their existing bill: for example, to change a tax rate, change a nominal code for a line item, or associate it to a different supplier.

Use our Update bill endpoint to perform this operation. The following rules apply:

  • You can only update the bills in Open status, and updates to bills in any other states will be rejected.
  • During the update, all existing bill line items will removed and replaced with new line items.
  • You can change the following values:
    • reference
    • supplierRef.id
    • issueDate
    • dueDate
    • currency
    • currencyRate
    • lineItems[]

For integration-specific rules and errors, review the Software requirements section.


Example payloads

PUT /companies/{companyId}/connections/{dataConnectionId}/payables/bills/{billId}

{
"reference": "INV-001",
"supplierRef": { "id": "supplier-id" },
"issueDate": "2026-01-28",
"dueDate": "2026-02-28",
"currency": "GBP",
"currencyRate": 1.0,
"status": "Open",
"lineItems": [
{
"description": "Service fee",
"unitAmount": 100.00,
"quantity": 1,
"accountRef": { "id": "account-id" },
"taxRateRef": { "id": "tax-rate-id" },
"taxAmount": 20.00,
"trackingRefs": [{ "id": "tracking-id" }]
}
]
}

Software requirements

We have summarized the key differences between the integrations that support updates to bills below:

FeatureFreeAgentQBOXero
Reference max length255 characters21 characters255 characters
TaxRateRefMust be nullRequiredRequired
Tax handlingUse taxAmount onlyUse taxRateRef.idUse taxRateRef.id
AccountRef formatNominal codeNumeric stringGUID
Max line items40No limitNo limit

Validation errors

You may encounter a validation error when sending a request to update a bill. In the sections below, we`ve included general and software-specific errors to help resolve these.

General validation errors

ValidationError message
Missing supplierRefSupplier Ref must not be empty.
Missing supplierRef.idSupplier Ref Id must not be empty.
Missing issueDateIssue Date must not be empty.
Missing dueDateDue Date must not be empty.
Missing currencyCurrency must not be empty.
Invalid currencyCurrency Length must be equal to 3.
Currency rate <=0Currency Rate must be greater than 0.
Missing statusStatus must not be empty.
Invalid statusStatus must be equal to Open.
Missing or empty line itemsLine Items must not be empty.
Negative line items totalSum of LineItems must be greater than or equal to 0.
Reference too longReference Length must be less than or equal to 255.
Bill not found404 Not Found

Software-specific errors

IssueError message
Invalid account codeAccount Ref was not found in FreeAgent.
Invalid supplier IDSupplier Ref Id was not found in FreeAgent.


Was this page useful?
👏
👍
🤔
👎
😭