question

saad-bin-iqbal avatar image
saad-bin-iqbal asked Raymond Lee Deactivated answered

Why I get this message on making payment ?- {"message":"Payment amount must exist and not be negative."}

I get this message({"message":"Payment amount must exist and not be negative."}) on using this below API to make payment using custom Tender.

POST /v3/merchants/{mId}/orders/{orderId}/payments

I provide the details(Parameters)

{ "employee": { "id": "S48JPDMXXXX7W" }, "order": { "id": "17SYWXXXJBQPY" }, "tender": { "instructions": "erter", "visible": true, "editable": false, "id": "2GQ9XXXXXRGRY", "label": "Coupon", "labelKey": "com.bluepumpsoftware.application", "opensCashDrawer": false, "supportsTipping": false, "enabled": true }, "amount": "2243" }
Clover Mini
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

Raymond Lee avatar image
Raymond Lee Deactivated answered
The request looks good, one thing that I would check is that you are passing in the right header for the request, it should be "application/json":
  1. POST /v3/merchants/T0JQJVBQJTH1Y/orders/0KQ3318TFX4GC/payments HTTP/1.1
  2. Host: https://apisandbox.dev.clover.com
  3. Content-Type: application/json
  4. cache-control: no-cache

I was able to reproduce your issue if I passed in:
  1. Content-Type: application/x-www-form-urlencoded
Response:
  1. {
  2. "message": "Payment amount must exist and not be negative."
  3. }
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