Discussions
Corrigo API -- strange date handling for InvoiceDate
10 months ago by Jarek
Hey Corrigo,
I've come across some strange handling of dates in the system. The issue I'm describing here is around InvoiceDate -- it's possible the issue is more widespread, but my tests so far have focused on just the one spot.
When PUTing invoices, for the InvoiceDate
field:
- Our (third party) system stores raw dates
- Corrigo's UI handles raw dates
However, Corrigo's API both expects and returns datetimes.
Furthermore, it seems to alter the time that's sent through.
From my testing:
- Sending '2024-02-14T16:00:00+00:00' results in Corrigo storing/returning '2024-02-14T8:00:00+00:00'
- Sending '2024-02-14T8:00:00+00:00' results in Corrigo storing/returning '2024-02-14T0:00:00+00:00'
- Sending '2024-02-14T0:00:00+00:00' results in Corrigo storing/returning '2024-02-13T16:00:00+00:00'
ie, it subtracts 8 hours each time! This is worst in that third case, because the UI then truncates that to the previous day!
My question to the experts:
- This looks like a bug, can you please confirm that this is unintentional and that you should be capturing dates here rather than datetimes?
- Is the 8 hr difference significant? Can i assume it'll always be subtracting 8hrs, and work off that heuristic as workaround?
- Is this more prevalent across the board? Can i make the same assumptions around date handling for all other places in the corrigo API (eg dates on RequiredDocuments)?
Cheers,