checkout trigger on order complete

6 0 1

I am using the JS SDK to build shopify presence on my website. 

I figured how to build my own cart and open a checkout, submit line items and launch the checkout in a new web-browser.

My question is - how do i detect that an order was completed?

I see that there's an 'order' field in checkout - but do I have to keep polling this variable to figure out when/if  a checkout completed or is there some sort of event that i can trap?

I did notice that the checkout session pointed to by "webUrl" seems to send messages back to the window that called it which i can trap via window.onmessage() but i haven't figured out what these messages mean and if any of them flag that an order was complete.


Any help gratefully accepted 🙂



Replies 2 (2)
Shopify Partner
1030 86 276

Quickest thing to do would be to setup a webhook that would trigger upon order completion. Details here -->

6 0 1

ok - i guess it's ok to answer your own question:


Looks like this might be the answer: