question

souvikbose avatar image
souvikbose asked souvikbose commented

API access token not working in sandbox

I have created and APP in the sandbox and granted all the permissions . But when I generate any access token via the Oauth callback url , the same token is not authorizing.

It keeps saying

{

"message": "401 Unauthorized"

}


SandboxAPI Token
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

souvikbose avatar image
souvikbose answered souvikbose commented

This is the URL structure .
https://sandbox.dev.clover.com/v3/merchants/xxxxxxxxxxxx/orders?access_token=xxxx-xxx-xxxx-xxxx-xxxxxxxxxxxxxxx

body: {"customers":[{"merchant":{"id":"xxxxxxxxxxxx"},"orders":[],"metadata":{},"id":"cust12345","firstName":"Souvik","lastName":"Bose","marketingAllowed":true}],"lineItems":[{"item":{"id":"4DR5FK58ZVK6P"},"exchangedLineItem":{},"refund":{"orderRef":{},"device":{},"payment":{},"employee":{},"overrideMerchantTender":{},"serviceChargeAmount":{},"germanInfo":{},"appTracking":{},"cardTransaction":{"extra":{},"vaultedCard":{}},"transactionInfo":{"identityDocument":{"payment":{}},"promotionalMessage":{},"eCommTransactionInfo":{"storedCredentials":{}},"sepaElvTransactionInfo":{}},"merchant":{}},"printGroup":{},"id":"1","name":"Green Apple","price":20,"priceWithModifiers":20,"priceWithModifiersAndItemAndOrderDiscounts":20,"unitQty":1,"unitName":"lb","itemCode":"ITEM001","printed":true}]}

output :

{

"message": "401 Unauthorized"

}
Some points to be noted :

  1. I have generated an API token from the developer console and surprisingly it is working
  2. The tokens generated from the Oauth flow are not working
  3. I have tried tokens from both source with the only merchant id i have
  4. I have configured only one app and the Oauth flow is working fine

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