question

Bryanne Vega avatar image
Bryanne Vega asked ·

Rest API get last payment ID?

How can I request to last payment from the Rest API?

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.

Jacob Abrams avatar image
Jacob Abrams answered ·

How about this:

https://dev1.dev.clover.com/v3/merchants/{mId}/payments?orderBy=createdTime&limit=1
2 comments 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.

https://apisandbox.dev.clover.com/v3/merchants/677*********/payments?orderBy=createdTime&limit=1 Result: : Received non-OK status from server: HTTP/1.1 401 Unauthorized Permission: "Read Payments" on gets is enabled at the app settings. Tried with the auth code, same result.

0 Likes 0 · ·

After a while I've noticed that if you specify "orderBy" it won't let me have the lastest payment made. Removing that solved my issue :)

0 Likes 0 · ·
Mark R avatar image
Mark R answered ·

@jacobabrams answer works! I just tried it. Remember to pass your API token on the "Authorization" header. If you try following with curl, you will see the result.

curl "https://apisandbox.dev.clover.com/v3/merchants/{mID}/payments?orderBy=createdTime&limit=1"  -H "Authorization: Bearer YOUR_TOKEN_HERE"
1 comment 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.

Ah, typos... Got to love them. Thank you.

0 Likes 0 · ·

Welcome to the
Clover Developer Community