question

mlefferson avatar image
mlefferson asked mlefferson commented

export-api-examples returns no exportUrls

https://sandbox.dev.clover.com/v3/merchants/yyyyyyyyyyyyy/exports/xxxxxxxxxxxxx?return_null_fields=true

Note below that there are no elements in the exportUrls section. There are orders loaded for this merchant for the time period specified - 4/01/18 - 4/18/18.

{
  "id": "xxxxxxxxxxxxx", 
  "type": "ORDERS", 
  "status": "DONE", 
  "statusDescription": null, 
  "percentComplete": 100, 
  "availableUntil": 1524084290000, 
  "startTime": 1525132800000, 
  "endTime": 1526601600000, 
  "createdTime": 1523997880000, 
  "modifiedTime": 1523997908000, 
  "exportUrls": {
    "elements": [ 
    ]
  }, 
  "merchantRef": {
    "id": "yyyyyyyyyyyyy"
  }, 
  "payload": null, 
  "aggregationRef": null, 
  "persistenceStrategy": "GOOGLE_CLOUD_STORAGE"
}
REST API
1 comment
10 |2000

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

mlefferson avatar image mlefferson commented ·

The code making the request is from an API Example: https://github.com/clover/export-api-examples

0 Likes 0 ·

1 Answer

chanel avatar image
chanel Deactivated answered mlefferson commented
Timestamps to be used in the Export API should be in UTC. With this in mind, from your startTime and endTime, you're looking at the time period from Tuesday May 01, 2018 00:00:00 (am) (UTC) to Friday May 18, 2018 00:00:00 (am) (UTC).
3 comments
10 |2000

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

mlefferson avatar image mlefferson commented ·

How are you computing the start and end time? I used javascript Date.UTC, and Date.UTC(2018, 04, 01) = 1525132800000

0 Likes 0 ·
chanel avatar image chanel mlefferson commented ·

In Javascript, the month count starts at 0. And within Clover, the timestamp itself is based on UTC, but the date you want should be based on the merchant's local time. So instead you'll just want Date.parse("April 1, 2018").

0 Likes 0 ·
mlefferson avatar image mlefferson chanel commented ·

Thank you for clearing up my misunderstanding @Chanel .

1 Like 1 ·

Welcome to the
Clover Developer Community