checkout trigger on order complete

Highlighted
New Member
6 0 0

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

 

thanks! 

0 Likes
Highlighted
Shopify Partner
530 38 109

Quickest thing to do would be to setup a webhook that would trigger upon order completion. Details here --> https://help.shopify.com/en/manual/orders/notifications/webhooks

0 Likes
Highlighted
New Member
6 0 0

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

 

Looks like this might be the answer: https://shopify.dev/docs/admin-api/rest/reference/events/event

0 Likes