question

bwei81490 avatar image
bwei81490 asked David Marginian Deactivated edited

Programmatically Retrieve My Sales Data

I use clover for my business and I wanted to be able to programmatically retrieve my sales data. I'm trying to build my own BI solution blending data from various sources for my business and I was wondering whether there was an endpoint oyu expose for merchants to retrieve their sales data.

If so, how might the creds required? @

clover developer community
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

·
David Marginian avatar image
David Marginian Deactivated answered David Marginian Deactivated edited

You can generate a merchant token via your dashboard and use it to query our REST API. https://docs.clover.com/clover-platform/docs/create-an-api-token. The warning on this page regarding merchant tokens largely applies to 3rd party apps. There are restrictions in place for merchant tokens (rate limiting, etc.) but I wouldn't expect problems for the use case you described. Info on using the REST API here - https://docs.clover.com/clover-platform/reference/api-reference-overview.

6 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.

bwei81490 avatar image bwei81490 commented ·

I attempted to use the export API as laid out here https://github.com/clover/export-api-examples/blob/master/python/create_export.py.


I gave my token read/write access but some reason I'm getting an unauthoerized error. Is there anyway you could send me a sample API call?

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bwei81490 commented ·

That script hits the sandbox environment by default. Sandbox is a testing environment used for 3rd party devs when they are testing their apps. I assume you want to run that script in production. Did you change the url in the script to use the production url? https://docs.clover.com/docs/making-rest-api-calls

0 Likes 0 ·
bwei81490 avatar image bwei81490 David Marginian ♦♦ commented ·
0 Likes 0 ·
Show more comments
bwei81490 avatar image bwei81490 commented ·

In addition I attempted a test API call and I'm getting a 401. Just confirming my merchant ID is equivalent to MID which I can find by going to help in my web dashboard? What I see is a 12 digit number. I'm only asking because I've seen merchantID referenced as 13 digits

0 Likes 0 ·
David Marginian avatar image David Marginian ♦♦ bwei81490 commented ·

As I just mentioned, you are likely hitting the wrong environment:

https://community.clover.com/articles/23744/resolving-401-unauthorized-responses-when-making-a.html (just the environment section is relevant for you).

https://docs.clover.com/docs/making-rest-api-calls

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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