Invoices

Get invoice

The Get invoice endpoint returns a single invoice for a given invoiceId.

Invoices are itemized records of goods sold or services provided to a customer.

Before using this endpoint, you must have retrieved data for the company.

Tips and traps

To access the paymentAllocations property, ensure that the payments data type is queued and cached in Codat before retrieving invoices from Codat's cache.

get/companies/{companyId}/data/invoices/{invoiceId}

Path parameters

invoiceIdstring required
Example:13d946f0-c5d5-42bc-b092-97ece17923ab

Unique identifier for an invoice.

Response

Success

idstring

Identifier for the invoice, unique to the company in the accounting software.

invoiceNumberstring nullable

Friendly reference for the invoice. If available, this appears in the file name of invoice attachments.

customerRefAccountingCustomerRef — unresolved $ref
salesOrderRefsSalesOrderRef[] nullable— unresolved $ref

List of references to related Sales orders.

issueDatestring required

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

dueDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

paidOnDatestring

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>. Date and time fields are formatted as strings; for example:

2020-10-08T22:40:50Z
2021-01-01T00:00:00

When syncing data that contains DateTime fields from Codat, make sure you support the following cases when reading time information:

  • Coordinated Universal Time (UTC): 2021-11-15T06:00:00Z
  • Unqualified local time: 2021-11-15T01:00:00
  • UTC time offsets: 2021-11-15T01:00:00-05:00

Time zones

Not all dates from Codat will contain information about time zones.
Where it is not available from the underlying platform, Codat will return these as times local to the business whose data has been synced.

currencyCurrency — unresolved $ref
currencyRateCurrencyRate — unresolved $ref
lineItemsInvoiceLineItem[] nullable— unresolved $ref

An array of line items.

paymentAllocationsItems[] nullable— unresolved $ref

An array of payment allocations.

withholdingTaxItems[] nullable— unresolved $ref
totalDiscountnumber nullable

Numerical value of discounts applied to the invoice.

subTotalnumber nullable

Total amount of the invoice excluding any taxes.

additionalTaxAmountnumber

Additional tax amount applied to invoice.

additionalTaxPercentagenumber

Percentage rate of any additional tax applied to the invoice.

totalTaxAmountnumber required

Amount of tax on the invoice.

totalAmountnumber required

Amount of the invoice, inclusive of tax.

amountDuenumber required

Amount outstanding on the invoice.

discountPercentagenumber nullable

Percentage rate (from 0 to 100) of discounts applied to the invoice. For example: A 5% discount will return a value of 5, not 0.05.

statusInvoiceStatus required— unresolved $ref
notestring nullable

Any additional information about the invoice. Where possible, Codat links to a data field in the accounting software that is publicly available. This means that the contents of the note field are included when an invoice is emailed from the accounting software to the customer.

modifiedDatestring

The date when the record was last fetched from the accounting software, commerce software, or open banking provider and updated in Codat’s data cache.

Use it to identify and retrieve records that have changed since your last fetch. For example, filtering modifiedDate to today will provide new records updated in Codat today.

This date is populated for all data types except for attachments, balance sheets, company information, and profit & loss reports (read more).

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.

sourceModifiedDatestring

The date when a record was last modified in the accounting software, usually by the business or a business process. For example, when payments are made against an invoice.

It is not populated (read more) when:

  • Pulling attachments
  • The accounting software does not provide modification dates for a data type
  • A record has been deleted from the source platform and Codat doesn't have a record of when the deletion occurred
  • A record has been voided. For certain platforms that soft delete records, isDeleted metadata is used to identify void records

In Codat's data model, dates and times are represented using the <a class="external" href="https://en.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601 standard</a>.