Modified dates
Codat uses two dates to indicate when a data record, such as an invoice, bill, or credit note, was last updated:
- modifiedDate
- sourceModifiedDate.
About the modified date
Look at the modified date to understand the freshness of any data that you’ve requested. It tells you when the most recent version of the record was fetched from the data source and updated in Codat’s data cache. Most records keep the same modified date across a number of fetches. Only records that have been updated on the accounting platform between fetches show a new modified date.
The modified date is available for all data types except for the following: attachments, balance sheets, company information, profit and loss reports.
Using the modified date
Use the modified date to identify or retrieve records that have changed since your last fetch. For example:
Retrieve company invoices updated since the last fetch
Find the date of your last fetch and use it in the following query:
GET /companies/{companyId}/data/invoices?page=1&query=modifiedDate%3E%3D{lastfetchdate}
This query retrieves records with modified dates that are greater than or equal to the fetch date that you've specified.
About the source modified date
Look at the source modified date to understand when a record was last updated in the customer’s accounting platform. The record may have been updated by the business, or a business process, such as when payments are made against an invoice.
If the source modified date is set to null
, the record has been deleted from the accounting platform but Codat doesn't have a record of when the deletion occurred. If the accounting platform uses soft deletes, void records may also be identified in the same way .
The source modified date is available for all data types except for the following: attachments, balance sheets, company information, profit and loss reports.
Using the source modified date
Use the source modified date when you want to identify records that have been updated by a business, or a business process. For example:
Find invoices issued over 12 months ago that were updated in the last month
GET /companies/{companyId}/data/invoices?page=1&query=issueDate%3C{todayMinus12Months}%26%26sourceModifiedDate%3E%3D{todayMinusOneMonth}
This query retrieves invoices with issue dates that are greater than twelve months old and a source modified date that is greater than or equal to one month old.
Updated almost 2 years ago