question

Ajmal M A avatar image
Ajmal M A asked Miguel Deactivated edited

How to get Merchent information from Merchent code

I have an app on the clover store. Now i need to integrate web-hook to get the information about the merchant's that install/uninstall my app.

I successfully subscribed to the web-hook. In web-hook i got response like

{"appId":"J95Gsdas46S7BEWA","merchants":{"SND85564GM":[{"objectId":"A:J9546S7GHWA","type":"CREATE","ts":149888207876098}]}}

From this how i will get the merchant information like name, email id etc?

I am aware about the api GET /v3/merchants/{mId} but how i can generate access_token for this from the server side?

Please help me regarding this.

API TokenWebhooks
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 will need to go through our OAuth flow to get generate an auth token. Once the token is generated, you may store this to make subsequent calls to our API. After a merchant installs your app, they will need to authenticate with OAuth.
2 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.

Ajmal M A avatar image Ajmal M A commented ·

Hi Miguel, The usecase is not like that. This application not have accessable to any merchent. It is for our internal tracking. The clover provides webhooks to get details of install and uninstall information. But webhook info contains only the merchent id. From webhook request endpoint how can i identify the merchent details?

0 Likes 0 ·
Miguel avatar image Miguel Ajmal M A commented ·

@Ajmal M A, if it's an internal tracking, then one solution would be to maintain your own database of merchant info to cross reference with the merchant id you receive with the webhook. The only way to call our REST endpoints is to use an API token generated from OAuth or the Clover Android SDK.

0 Likes 0 ·

Welcome to the
Clover Developer Community