Just trying to export sales data from clover api.
I am working off the code submitted in github export-api-examples repository .
I am able to create the export successfully. But when I execute the function to get the export, it doesn't return a url to access the url.
def api_url(resource_path): """Generate the URL for an API call""" return "{}{}?access_token={}".format(HOST, resource_path, ACCESS_TOKEN) def create_export(export_type, start_time, end_time): """Request a new export""" url = api_url("/v3/merchants/" + MERCHANT_ID + "/exports/") payload = { "type": export_type, "startTime": start_time, "endTime": end_time, } resp = requests.post(url, json=payload) resp.raise_for_status() return resp.json() def get_export(export_id): """Get the current state of the specified export""" url = api_url("/v3/merchants/" + MERCHANT_ID + "/exports/" + export_id) resp = requests.get(url) resp.raise_for_status() return resp.json()
Running these functions returns:
{'id': 'VJS1YC61KWF1W', 'type': 'PAYMENTS', 'status': 'DONE', 'percentComplete': 100, 'availableUntil': 1624711390000, 'startTime': 1624511000, 'endTime': 1624597000, 'createdTime': 1624624981000, 'modifiedTime': 1624624990000, 'exportUrls': {'elements': []}, 'merchantRef': {'id': 'NZ492DDYP2AY1'}, 'retryCount': 0}
'exportUrls': the values of `elements` should return a url or urls not an empty list.
Help?