question

Bryanne Vega avatar image
Bryanne Vega asked Bryanne Vega commented

Rest API get last payment ID?

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

10 |2000

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 Bryanne Vega commented

How about this:

https://dev1.dev.clover.com/v3/merchants/{mId}/payments?orderBy=createdTime&limit=1
2 comments
10 |2000

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

Bryanne Vega avatar image Bryanne Vega commented ·

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 ·
Bryanne Vega avatar image Bryanne Vega commented ·

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 Bryanne Vega commented

@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
10 |2000

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

Bryanne Vega avatar image Bryanne Vega commented ·

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

0 Likes 0 ·

Welcome to the
Clover Developer Community