question

sithum avatar image
sithum asked David Marginian Deactivated commented

REST Pay API requests throwing a Authorization failed error

Hi there

I'm trying to use the the REST Pay API along with Cloud Display App to accept payments of my custom app. I'm firing the '/v1/device/ping' call using the given postman collection to check the device status. It gives me this response.

{
    "timestamp": 1648645014931,
    "path": "/v1/device/ping",
    "error": "Internal Server Error",
    "message": "Authorization failed.  The Authorization header or X-Clover-Device-Id you passed may be invalid.",
    "requestId": "98b633ea-12547930",
    "type": "ERROR"
}


I have set the 'X-Clover-Device-Id' with device serial number, 'X-POS-ID' with the appid and 'Authorization' headers with access token correctly.


App Id - HN1XP6GA4H0ZA

Test merchant id - 5ZTFCGXQKVZNA

Serial Number - C032UQ83960149


Will you be able to have a look and tell me is there anything wrong with the request or app configurations that might result in this response ?

screenshot-from-2022-03-30-18-47-17.png


REST API
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 commented

Just FYI, X-POS-ID is a value you set to identify the POS terminal on your end. You shouldn't set that to the app id. How are you obtaining the token? Does your app have merchant read permissions? Please make sure you are following the steps here - https://docs.clover.com/docs/rest-pay-development-basics.

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.

sithum avatar image sithum commented ·

I followed the steps described here to obtain the access token and yes the app has merchant read permissions. It is retrieved from the url's query parameter. I have set the Default OAuth Response to 'Token' since this for a testing purpose .My app can be viewed in the test merchant's apps list as well.

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

Device C032UQ83960149 isn't associated with merchant 5ZTFCGXQKVZNA.

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