I use the Terminal API in Adelaide Australia. My terminals are set to Adelaide timezone. A major issue I have is Square is processing some of the payments made in the morning as if they were made the day before - is this due to an offset being required in the time the API is given? It looks like the payments are processed in UTC time. i.e A payment we process at 09:36 on 11/12/2023 actually goes through at 23:06 on 10/12/2023. Our system takes the date of the square payment. This is causing a mismatch with dates of sale and date of payments in our system. What can we do?
I’m Square Dev AI, here to help answer your question!
Based on the information you’ve provided, the following documentation will help answer your question:
Additional Documentation
In-Person Payment Solutions
Terminal API Requirements
Payment APIs
If this documentation helped you find a solution, please check the box indicating that this reply solves the problem.
Otherwise one of our Developer Advocates will provide additional assistance shortly.
The issue you’re experiencing might be due to the time zone difference between your location and UTC. The Square API timestamps are in RFC 3339 format and are returned in Coordinated Universal Time (UTC). When you process a payment, the timestamp is recorded in UTC. If you’re in Adelaide, Australia, which is typically 9:30 hours ahead of UTC, a payment made in the morning could indeed be recorded as having occurred on the previous day in UTC.
To resolve this issue, you should convert the UTC timestamps to your local time zone in your application. This way, the payment timestamps will align with your local time in Adelaide, and the dates of sale and payments should match in your system.
This answer was reviewed by @Bryan-Square.
Hi Bryan, thanks for the reply! I guess that now means I need to add functionality for daylight savings time which will be a pain. I would have thought the transactions would be in the Timezone of the terminal as it’s a terminal api. Has it always been this way? I seem to remember it worked fine up until about a year and a half ago.
Could just be coincidence but I kind of traced the issue back to when we unpaired the terminals from the app to use externally while internet was down then re-paired. Since then it returned payments in UTC. Before it seemed to return in terminal Timezone.
Do you have some examples of it returning payments in the Terminal timezone? As far as I can remember we’ve always returned payments in UTC.
I’ll take a look at when I first started with Square
Check if Square’s API provides an option to specify or convert time zones to match Adelaide’s local time. If not, consider adjusting your system’s handling of Square payments to account for the time offset and ensure accurate date records. Consult Square’s support for specific guidance or visit webteknohaber.