Hi
How to get merchantId using my APIKEY?
I'm doing the integration with clover and my intention is not obligate the merchant to informed manually the merchantId during the configuration in my APP
To retrieve the merchantId using your API key in Clover, you can make a request to the /v3/merchants endpoint of the Clover API. Pay by Plate Ma
Here's an example of how you can make the request using cURL:
curl -X GET \
-H "Authorization: Bearer <your_api_key>" \
https://api.clover.com/v3/merchants
Replace <your_api_key> with your actual API key.
This will return a JSON response containing an array of merchants. If you are integrating with a single merchant, you can assume that the first item in the array is the correct merchant and retrieve the id field from that object.
Here's an example of how you can retrieve the id field using the jq command-line tool:
curl -X GET \
-H "Authorization: Bearer <your_api_key>" \
https://api.clover.com/v3/merchants \
| jq -r '.elements[0].id'
When I tried to retrieve the merchantId by endpoint `https://api.clover.com/v3/merchants` I have the error 401. This endpoint doesn't allow without passing the merchantId by params. I created the API Token by Clover's dashboard and have all permissions.
See below my permissions.
Yeah, that isn't a valid endpoint, nowde1976 must be some sort of chat bot.
All Clover endpoints are merchant specific, you must have the merchant id to make an API call.
You will obtain the merchant id during the OAuth flow when the merchant is redirected to your app - https://docs.clover.com/docs/using-oauth-20, Step 2.
6 People are following this question.