question

jwoods avatar image
jwoods asked steve-egan commented

How do I confirm an order is completed (paid) at a PoS terminal?

My wife has a retail store where she uses a Clover PoS system, and I am doing some order integration work for her.

We have recently found that some of the sales associates are creating an order simply to scan a barcode (a price check). These orders are abandoned, but they continue to show up in the orders list (GET https://api.clover.com/v3/merchants/<... ).

As part of the integration I'm writing, I need to decrement inventory in an online store (3dCart) for items sold in the physical store (Clover). For the past week, I have not been properly filtering these "OPEN" orders, resulting in a skewed inventory since the items were not sold, but were decremented from the online inventory.

I began looking at the state field in the order response, but the API documentation says:

state
string
OPTIONAL
A String generally describing the state of this Order. The value null indicates an empty Order that is not displayed in user interfaces. Other value such as "open" and "locked" are not checked or enforced by client or server and thus are not useful for making any logical decisions about this Order.

I've found that in my case, there are no "null" orders. The "PAID" orders show "locked" and the "OPEN" orders show "open".

Am I incorrect in using this field to detect unpaid orders?

Orders
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

jim-patel avatar image
jim-patel answered steve-egan commented

An order that has not been paid but has had the order receipt printed will also have a state of locked.

What I do to make sure an order is paid is get the payments for the order and add them up to make sure the payment amount is greater or equal to the order total.

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.

steve-egan avatar image steve-egan commented ·

When summing up the payments on an order you also need to take into consideration tips and refunds. See the answer to this question https://devask.clover.com/question/41... which gives sample code on how to correctly determine if an order is fully paid.

0 Likes 0 ·

Welcome to the
Clover Developer Community