question

justanotherprogrammer avatar image
justanotherprogrammer asked ·

API integration timezone

When retrieving a list of all payments, the docs suggest the transactions in the report will always be returned in the timezone of the requesting machine ip. Is there a way to override this to get results back in a consistent timezone, such as UTC? Use case would be my system being in AWS, where I don't know what timezone the machine(s) may be in.
REST API
3 comments
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

There may be a mistake in the docs. Can you please provide a link to the doc you found which suggest the time is converted automatically?

0 Likes 0 · ·

It was here that I saw it. While it did talk about the web dashboard specifically, I guess it confused me into thinking the api was trying to get fancy as well. The docs aren't particuraly clear in regards to the timestamps/timezone/etc.

1 Like 1 · ·
zgreathouse avatar image zgreathouse justanotherprogrammer ·

Thank you for your feedback. We'll try to make this more clear in the documentation.

0 Likes 0 · ·
zgreathouse avatar image
zgreathouse answered ·
When you hit the endpoint: GET /v3/merchants/{mId}/payments - in the response body you will see that all time related fields on each payment object (createdTime, clientCreatedTime, modifiedTime...etc) are saved as a Unix Time Stamp which can be converted.

Apps, such as the Merchant Dashboard and Clover's Transactions app, convert the time stamp to local time. To be clear any conversion must be explicitly done by your app.

Example Payment Object:

        {
            "id": "*************",
            "order": {
                "id": "*************"
            },
            "device": {
                "id": "********-****-****-****-************"
            },
            "tender": {
                "href": "https://sandbox.dev.clover.com/v3/merchants/*************/tenders/*************",
                "id": "*************"
            },
            "amount": 2832,
            "taxAmount": 234,
            "cashbackAmount": 0,
            "employee": {
                "id": "*************"
            },
            "createdTime": 1547071649000,
            "clientCreatedTime": 1547071649000,
            "modifiedTime": 1547071651000,
            "offline": false,
            "result": "SUCCESS"
        
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

justanotherprogrammer avatar image
justanotherprogrammer answered ·
Those were the timestamps I had been using, really the concern was that the timezone would somehow get manipulated by the requesting IP. Thank you for confirming that is not the case and I had just misunderstood. Knowing that for certain now, converting it to the correct timezone is an easy step to finish up this integration.
Share
10 |2000 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community