Join us for an upcoming Shopify Partner webinar on February 27, 2024. Discover the latest Checkout Extensibility features, and deep dive on improvements to Shopify Functions and Web Pixels. Register now for either the 10am EST or 2pm EST sessions.
Solved

How to make sure checkout was paid

kcin1993
Shopify Partner
63 0 5

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

Accepted Solution (1)

Zameer
Shopify Staff
297 31 90

This is an accepted solution.

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.

To learn more visit the Shopify Help Center or the Community Blog.

View solution in original post

Replies 2 (2)

Zameer
Shopify Staff
297 31 90

This is an accepted solution.

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.

To learn more visit the Shopify Help Center or the Community Blog.

kcin1993
Shopify Partner
63 0 5

@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.