question

tommyd avatar image
tommyd asked David Marginian Deactivated commented

Rest Pay Display API BETA error 401

Hello,

I'm trying to connect a Clover Flex v2 device using the Rest PayDisplay API BETA https://docs.clover.com/docs/beta-rest-pay-api-contents

I always get error 401 in Postman. My device ID is good (see request below)

Do we need to be part of a beta program to use this api ?? Any idea of what would be the problem ?

Thanks for you help !


{
    "timestamp": 1648221529866,
    "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": "7b7237d9-9288285",
    "type": "ERROR"
}


screen-shot-2022-03-25-at-112905-am.png


REST APICloud Pay Display
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

David Marginian avatar image
David Marginian Deactivated answered

An access token is required to use the API. You should read the getting started guide - https://docs.clover.com/docs/rest-pay-development-basics and https://docs.clover.com/docs/configuring-a-local-connection

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

tommyd avatar image
tommyd answered David Marginian Deactivated commented

Hello,

I forgot to say that I already have an app id / app secret and I'm able to get a valid bearer token within postman.

Thank you.

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

David Marginian avatar image David Marginian ♦♦ commented ·
You aren't passing the token in the request: Authorization Bearer {token}.
0 Likes 0 ·
tommyd avatar image tommyd David Marginian ♦♦ commented ·

Hello David,

Postman is passing the token automatically in the header (see Authorization tab below)

Thank you

screen-shot-2022-03-25-at-120538-pm.png

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

Are you passing the device's serial number in the device id header? Does your app have Merchant read permissions? Information on resolving 401s in general can be found here - https://docs.clover.com/docs/401-unauthorized. If you cannot get things working after reading that you will need to provide us with your merchant id, app id and the serial number you are passing.

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