question

ankur avatar image
ankur asked ankur action

Pay for an Order shows error for tender details

Hi,

I am new to Clover and using APIs very first time.

I wanted to make a payment for an order which I have created using API.

So i was trying to use 'Pay for an Order' API from Ecommerce Service API.


My request JSON looks below

{

"ecomind":"ecom",

"tender":{

"label_key":"com.clover.tender.cash",

"label":"Cash",

"id":"1V4SQEEE4PP76"

},

"source":"alternate_tender",

"tip_amount":0

}


When I execute this API with above request JSON, I am getting below error response.

{

"message":"400 Bad Request",

"error":{

"type":"invalid_request_error",

"code":"invalid_request",

"message":"Either tender label key, label or uuid has to be present"

}

}


I have already passed the required tender details.

Please guide


Thanks

OrdersPayments
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 David Marginian Deactivated edited

The validator for this request allows you to pass at most one of the tender fields (I believe that is what the "either" in the response message is trying to convey). For example, pass just the tender "id":

"tender":{
  "id":"tenderUuidHere"
},


10 |2000

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

ankur avatar image
ankur answered

Thanks a lot. That worked !!

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