question

curtis avatar image
curtis asked curtis commented

Create tender using REST API

An endpoint is not available on v3 Rest API, but there is one for v2.

Upon hitting the v2 endpoint with the following request endpoint:

{ "tender": { "opensCashDrawer": false, "labelKey": "com.clover.tender.mycloverintegration", "enabled": true, "label": "My Clover Integration" } }

I get an empty JSON object as a result

{}

When hitting it again, I get the error: 'This tender label already exists'.

I don't see the tender I just created via v3/merchants/mid/tenders nor on the Clover device itself

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

Mike M avatar image
Mike M answered curtis commented

After a little debugging, it seems that this is a 2 step process.

First you create the system tender (as you currently are doing) via: https://www.clover.com/rest-api#POST /v2/tenders

Then you register the tender with the merchant using the exact same JSON body via: https://www.clover.com/rest-api#POST /v2/merchant/{mId}/tenders

The latter API request will return you a Tender object with its UUID.

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.

curtis avatar image curtis commented ·

I get the following exception when calling the second endpoint: {"message":"Error creating merchant tender as you are not the owner of the system tender"}

0 Likes 0 ·
Mike M avatar image Mike M commented ·

Just following up on this per our separate conversation.

The tenders are keyed off the app that your access token is associated to. If you try to register the tender with a merchant using another app's token, it will fail with the error you are describing.

Since tenders are primarily designed for being used on the device via Custom Tenders, we would highly recommend you take advantage of the connector methods that take care of these API calls for you. https://github.com/clover/clover-andr...

0 Likes 0 ·

Welcome to the
Clover Developer Community