question

dbaskin avatar image
dbaskin asked David Marginian Deactivated answered

List Orders API does not return paymentState

When calling the List Orders or Get Order APIs, our results do not contain the paymentState field. We would like to only process Paid Orders via the API, but it seems we cannot filter on paymentState and we are not seeing it returned in the JSON output. When looking at the orders in the the Clover dashboard, we do see their status as Paid. Is this a reproducible issue with the API, or do we need to create our test orders differently to see this value?

OrdersREST API
image.png (46.1 KiB)
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.

David Marginian avatar image David Marginian ♦♦ commented ·

The dashboard utilizes the REST APIs. If you want to see how/what the request looks like use your browser's debugging console (network tab) to see the request that is being executed.

1 Like 1 ·
dbaskin avatar image dbaskin David Marginian ♦♦ commented ·

Thank you for the quick reply, David. The dashboard looks to be making a List Orders API call similar to mine, and getting the same response. I have two theories on how the dashboard is interpreting this result. Can you confirm if either of these are accurate?

  1. The status is computed based on looking at the order.total and the sum of the successful order.payments[].amount values. If the sum of the payments adds up to the order total, it is marked as Paid, otherwise it is Open.
  2. The status is using the order.state as a proxy. order.state == "open" maps to Open, and order.state == "locked" maps to Paid. Based on the docs this seems to not be advised, so I'd suspect this isn't it, but I'd like to confirm. From the docs on state:
Non-null values such as "open" and "locked" are not checked or enforced by the server. Therefore, these values should not be used to make any logical decisions about the Order.
0 Likes 0 ·

1 Answer

·
David Marginian avatar image
David Marginian Deactivated answered

Please see - https://community.clover.com/questions/2473/order-fully-paidgetstate-shows-locked.html. if you search this forum for "paid" you will see a few other posts. In summary this is not something we track and you must do your own calculations.

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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