question

dan1dd avatar image
dan1dd asked Miguel Deactivated edited

500 Internal Server Error on export api while pulling orders.

Hi, I'm trying to use export api on the orders end point and I get an error 500 as responses, what could be wrong?, I know the error 500 is on clover server side but maybe I'm sending the payload wrong?
this is what I'm sending to clover api:

opening connection to api.clover.com:443...
opened
starting SSL for api.clover.com:443...
SSL established
<- "POST /v3/merchants/MERCHANT_ID_REPLACED/exports?type=ORDERS&startTime=1499583600000&endTime=1501743600000&access_token=ACCESS_TOKEN_REPLACED HTTP/1.1\r\nAccept: application/json\r\nContent-Type: application/json; charset=utf-8\r\nConnection: close\r\nHost: api.clover.com\r\nContent-Length: 0\r\n\r\n"
<- ""
-> "HTTP/1.1 500 Internal Server Error\r\n"
-> "content-length: 39\r\n"
-> "content-type: application/json; charset=utf-8\r\n"
-> "X-Frame-Options: SAMEORIGIN\r\n"
-> "Connection: close\r\n"
-> "\r\n"
reading 39 bytes...

The access token is working otherwise I would receive a 401 code as response. I've replaced the access token here you know why..
The timestamp is: startTime=20.days.ago and endTime=Date.today. So it should work according to the docs. Any thoughts ?
OrdersREST API
10 |2000

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

1 Answer

Miguel avatar image
Miguel Deactivated answered Miguel Deactivated edited
You need to pass type, startTime, and endTime in the request body. It looks like the Export API doesn't support query parameters. Example:

{
	"type": "ORDERS",
	"startTime": "1485939600000",
	"endTime": "1488358800000"
}
10 |2000

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