Orders with failed payment

I am building an application that will download orders for some reporting, but while testing I noticed that I downloaded and order that had a tender with a failed payment. This order was done through the square online website. On the dashboard this order does not show up and the failed payment does not show up, but if I download all Square Online orders through the API for that day this order is retrieved. I find it odd that a failed credit card would still create an order in the system that nobody can see.

I don’t see an easy way for me to disregard this type of orders using the Order API since that state of the order is OPEN. OPEN does not work for me since we have orders that get picked up at a later date. The only way I can see is to look at the tender on each order and see if the total amount approved matches the total on the order. Please tell me there is an easier way to do this. I am hoping there is an easier way since the POS system only shows paid for orders. Is there some field I can use to make sure the order is paid?

Thanks,
Jeff

Hi @jtstephenson welcome to the forums!

Unfortunately there is not a straight-forward way of finding paid orders. Typically speaking, if an order is COMPLETED then that would mean it has been closed and paid for. However, an order can also be paid for and still be OPEN depending on how it was created. For example, if it has a fulfillment, and it was paid for, but the fulfillment was never updated/closed, then the order would be paid for, but it would still be OPEN.

So, long story short, if an order is COMPLETED you know it has been paid for already. Otherwise, if it’s OPEN then yes, you’ll need to check the payment(s) on the order and see if:

  1. The payment(s) was successful
  2. If yes to 1: the payment(s) add up to the order total

If both of the above are true, then the order has fully been paid for.

Hello @sjosey,

Thank you for your reply. I will go down that path. I was just hoping that there was a better way since it seems that orders do not show up in the POS unless they are paid. I thought maybe there was some field that you all are using to make that happen instead of going through multiple steps.

Thanks,
Jeff