hey what's up guys in this video i am,going to show you,how to create webhooks what to do with,webhooks,and how to do with webhooks so let's,start,what is webhook so whenever you buy an,item from any store,at the same time you receive an email,so this is a web hook a web hook will,trigger that,email on creation of,order or an integration of products,or maybe anything so let's create,a webhook,first of all,go to the online store,first of all go to the setting and then,notification,as you can see,order edited order confirmation,these are also shopify web hooks,so whenever you buy an item you will,receive an email,by these webhooks,so let's create a webhook,in the end you can see create webhook,just click on it and,you will see,webhooks,product creation product deletion there,are so many webhooks,you can choose and create whatever you,want,order creation format json,and the url so webhooks are based on,address also called url,so what what is url whenever you buy,an item a webhook will trigger,that url so in this case i am using,my server,just paste it and,create a file on the server,i don't have any other server that's why,i am using staging server,first of all create a folder,called shopify folder,and then open it,create a php file,product.php,so let's complete the url,product dot php so this is my address,url i'm going to,put into so,choose ipa version,202104 is the latest version,save it as you can see on the order,question,our webhook is created so whenever,an order created this url will hit,this is not enough i am going to do it,by code,for first of all i need an app,i have already created it if you do not,know how to create an app,watch my previous videos,i am going to save my credentials,api key,apk passport just copy paste,secret key shared secret key,you now the latest version of the,shopify is,202104 is the latest version,i am saving it also,after that i have,a shopify collection,so this is the end point for creating,a web hook i am going to use it,just copy it paste it,and put the credentials,api key,change it ap password,and the store name you can see the store,name is,there,change the version,after that you have done just copy it,and paste,it to back it will not work,because the body is missing,for the body i have to go to the,shopify documentation for creating,a web hook just copy the,body,and paste it,but this is the webhook for the orders,i have to find the webhook for the,products,i have to search,just replace it and,it is the same and,also change the address,so this is this is the address,change it,now see what happened,a web hook is created by code,by shopif file endpoints,i am going to see,i am going to retrieve all the webhooks,just hit this url,by replacing first,as you can see i have created only one,webhook,by shopify endpoint,products create so this is done,after that i have to code it,to retrieve the data from shopify,whenever a product is created,just close it also,and go to the local host,just create a folder,in the folder create a php file,save it,i have to create another file for the,later,use,open it and go to the shopify,documentation,there is a code for getting shopify,response whenever,a product is created,this code will retrieve the response,from shopify just copy it,and paste it into file,uh i need a secret key,just replace it,after that you have to code little more,just it,i am putting if condition,if it is verified,then,give me response,from that data,else,response,just close it,after that i am creating,a json file,i am using functions,for creating,file,write it if it is not created,if it is created successfully otherwise,die with the error,cannot open the,file,write it,and,print the response in this file,don't forget to close the file,just make sure everything is fine,i think it is fine just copy the code,and,put into the server,save it and,go to shopify,if everything is fine there will create,a file,new shirts,save it and i am going to check it,just go to the,here we go a file is created just open,it,as you can see a shopify product,response,is printed,it's mean it is good,now i have to send,a id,after the product question,as you know this is the json so i am,going to,decode it json,decode,i am going to decode it into array,that's why i am,putting the true,after that in the json response,there is id i am going to use this id,product id,is equal to,after that i have to hit the id,to the other url,so i think i have a code,just copy it,and paste it i have a called code,if not empty product id then,it will go there,what was the my file name,product sync,dot php,i need a url,url shopify production.php just copy it,and create a new php file,copy this code also,open the php file,save it and close after that i have to,do the do a little code there,if,requested,product id,then do whatever you want,if you get the product id then you can,get the,response from the shopify,by using gold card,or anything else you can use,the calls,i can use this endpoint for getting the,product response,just i have to replace the,product id there and change also the,credentials,copied open the file,save it and close,whenever the webhook is triggered,it will give the id and the id will,hit this url and in the url,you can do whatever you want with the id,that's it so if you like my video please,like comment and share and don't forget,to subscribe it,thanks for watching
Congratulation! You bave finally finished reading how to setup the order creation webhook in shopify and believe you bave enougb understending how to setup the order creation webhook in shopify
Come on and read the rest of the article!