Dates and Timestamps
The following guide refers to invoices but is also relevant for other documents like credit notes, receipts, journals and bank transactions (spend and receive money)
The Date element
- The Date element is optional when creating invoices via the Xero API.
- If specified the Date element should use the YYYY-MM-DD format e.g. 2013-02-08
- If the Date element is not specified then the Xero API will automatically populate this with the current date based on the timezone setting of the organisation (you can find the timezone setting of the organisation by going to Settings > Financial Settings in Xero).
e.g. If an invoice is created for a New Zealand based organisation (with a timezone setting of UTC+12:00) at 9pm 7 Feb 2013 UTC and the date element is not specified then the Date will be set as 8 Feb 2013.
The UpdatedDateUTC element
The UpdatedDateUTC element is automatically populated by Xero (you cannot set it), and is the timestamp of the last edit to the invoice.
Retrieving modified resources
If you are trying to retrieve invoices that have been modified since a certain time we recommend you use a “If-Modified Since filter”
Experimental API calls
To get more familiar with how invoices and their associated dates/times are generated in Xero using the API, we recommend you use the API Previewer to generate some test invoices with your Xero Demo Company.