question

mattgx avatar image
mattgx asked mattgx answered

Issue with payment on order via REST API

I'm having an issue posting a payment on an order. I think I may be making an obvious mistake, but after reading nearly every post here on payments, I still can't seem to figure this out.

I'm here:

https://sandbox.dev.clover.com/api_do...

I have my merchant ID, order ID, and for body I have this:

{ "amount": 1300, "order": { "id": "KGKV01ZDT3KRC" } }

When I submit, I get this:

Request URL

https://apisandbox.dev.clover.com:443... Response Body

no content Response Code

0 Response Headers

Which, I assume, means I did something incorrect.

I've also tried here: https://sandbox.dev.clover.com/api_do...

I have merchant ID, order ID, and I expand payments, with this body:

{ "amount": 1300, "order": { "id": "KGKV01ZDT3KRC" } }

It returns this

Response Body

{ "href": "https://sandbox.dev.clover.com/v3/merchants/X78Z366Q7S05T/orders/KGKV01ZDT3KRC", "id": "KGKV01ZDT3KRC", "currency": "USD", "taxRemoved": false, "isVat": false, "state": "paid", "manualTransaction": false, "groupLineItems": true, "testMode": false, "createdTime": 1476313100000, "clientCreatedTime": 1476313100000, "modifiedTime": 1476315495000 } Response Code

200 Response Headers

{ "Content-Type": "application/json; charset=utf-8" }

However, in the Sandbox Clover Web Admin, when I look at the order, I see this for payments:

Payments Pay Type:

No Payments

I'm expecting, in at least UpdateOrder, that that is how I add the payment. Does someone else see what I'm doing incorrectly here? Everything is optional. Maybe I'm missing something that finalizes the payment?

I also don't understand the difference between UpdatePayment and UpdateOrder, does this effectively do the same thing?

Thank you for your time.

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

mattgx avatar image
mattgx answered

Thanks to Mark at Clover, I got this resolved. Here were his steps:

  1. POST request to https://apisandbox.dev.clover.com/v3/merchants/{MID}/orders/{orderID}/payments (eg. here: https://sandbox.dev.clover.com/api_docs#!/orders/CreatePaymentForOrder )
  2. Headers: { "Authorization": "Bearer " + API token, "Content-Type": "Application/JSON" }
  3. Body: { "amount": 1300, "tender": { "id": "XXXXXX" } }

In this case, the Tender ID corresponded to Cash. You can find a merchant's unique Tender IDs by making a request to https://apisandbox.dev.clover.com/v3/merchants/{MID}/tenders

What I learned: the Tender ID is required. After I did this, I was able to see the payments when I query the Payments endpoint. Thank you Mark!

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