question

saad_bin_iqbal avatar image
saad_bin_iqbal asked ·

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 characters needed characters left characters exceeded

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 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":
POST /v3/merchants/T0JQJVBQJTH1Y/orders/0KQ3318TFX4GC/payments HTTP/1.1
Host: https://apisandbox.dev.clover.com
Content-Type: application/json
cache-control: no-cache

I was able to reproduce your issue if I passed in:
Content-Type: application/x-www-form-urlencoded
Response:
{
    "message": "Payment amount must exist and not be negative."
}
Share
10 |2000 characters needed characters left characters exceeded

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