How to make sure checkout was paid

Solved
Shopify Partner
37 0 1

I use Shopify checkout website to let customers finish checkout.


How can I make sure the checkout was be paid? Is there any best practice to confirm if the checkout is paid or not?


I use retrieve Checkout API to get the checkout data and upload the response to this gist for a better view:
https://gist.github.com/Kcin1993/e563988f1e1e8ec56891dda3e203159d


I am using order === null to identify checkout as unPaid. And try to simulate fail payment with Bogus gateway(test payment)


Thanks for advice

0 Likes
Highlighted

Success.

Shopify Staff
Shopify Staff
296 32 59

Hey there,

 

When the checkout is complete, the `order` property will contain the ID, name, and status page URL of the associated order, prior to that, it will default to `null`.

 

That being said, it's possible for a checkout to be complete, but not technically marked as 'paid'. This is because you can have a transaction authorized, but not yet captured. So you can take a look at the list of transactions associated with the order which is also provided in the checkout payload to make sure that payment is complete. Alternatively, you can use the order ID provided to you to query the `/admin/orders.json` endpoint to retrieve the `financial_status` of the order.

1 Like
Shopify Partner
37 0 1

@Zameer

Checkout API only can retrieve one checkout in one request, in our app we often encounter API limit. As you said above, it can fully confirm the checkout is paid by judge order is null or not. I think using Order API is a better way.

 

Order API contains checkout id, we store checkout id and use Order API to confirm checkout is paid or not. This way can let our app safe in API limit.

 

Thanks for your reply. It helps a lot.

0 Likes