Dedicated to the Hydrogen framework, headless commerce, and building custom storefronts using the Storefront API.
We're trying to set up a system where after a successful checkout, if the user has purchased a particular item (an installation appointment), that we would then make a call to a remote server with the user's contact information to set up the appointment. To implement this, what would our options be (ie. could this be done via a javascript call (would we have access to the order info in JS?), or would it need to be called from the server)?
Also wondering, would this require a Shopify Plus plan, or could it be done with the lower tier plan?
Solved! Go to the solution
This is an accepted solution.
You can implement this for both Shopify and Shopify Plus. Some information is available on the client side so you can try the pure JS implementation and do the call from the Thank You page.
But I would suggest the server side option as you can then handle order cancellations for example, say the customer changed his mind and you can then cancel the appointment.
You can use webhooks (https://help.shopify.com/en/api/reference/events/webhook) for this and subscribe to orders/create and orders/cancelled events so you can call your services to create/cancel an appointment.
This is an accepted solution.
You can implement this for both Shopify and Shopify Plus. Some information is available on the client side so you can try the pure JS implementation and do the call from the Thank You page.
But I would suggest the server side option as you can then handle order cancellations for example, say the customer changed his mind and you can then cancel the appointment.
You can use webhooks (https://help.shopify.com/en/api/reference/events/webhook) for this and subscribe to orders/create and orders/cancelled events so you can call your services to create/cancel an appointment.