Database synchronization with shopify
After configuring the constants to your liking, you should sync your database with shopify, to populate it with all products and collections of your store. Here you will learn, how to run the initial sync with shopify.
Initialization
As of now, once the project has been set up and hooked up with shopify, it's required to manually issue a request to the backend, which then synchronizes the shophub database with all products, collections and more.
For that simply run a http POST request against the following url:
_.apiBaseUrl/v1/tasks/synchttp://localhost/apiThe shophub database is now synchronized with the data from your shopify store.
Add Shopify webhooks
For shophub to run as expected, webhooks need to be established between shopify and shophub, so the database of shophub is kept up to date, with data changes in shopify. This is currently configured manually, but is considered under construction to add a simple endpoint that registers all required webhooks automatically.
Shophub currently utilizes the following webhook topics:
- products/create
- products/update
- products/delete
- collections/create
- collections/update
- collections/delete
- discounts/create
- discounts/update
- discounts/delete
Read more about webhook topics in the shopify docs here (opens in a new tab)
Next steps
After wrapping up synchronizing your database with shopify products, learn more about seeding your database with CMS mock banners here.