BACK

how to enable private app development shopify

How To Create A Private Shopify App & Learn How To Use Shopify API | Shopify App Development so you

WeeklyHow

Updated on Feb 11,2023

How To Create A Private Shopify App & Learn How To Use Shopify API | Shopify App Development

The above is a brief introduction to how to enable private app development shopify

Let's move on to the first section of how to enable private app development shopify

Let TThunt's experts help you find the best TikTok product on your Shopify business!

Find TikTok products (It's Free)
No difficulty
No complicated process
Find winning products
3.5K Ratings

WHY YOU SHOULD CHOOSE TTHUNT

TThunt has the world's largest selection of TikTok products to choose from, and each product has a large number of advertising materials, so you can choose advertising materials for TikTok ads or Facebook ads without any hassle.

How To Create A Private Shopify App & Learn How To Use Shopify API | Shopify App Development

so you want to create the shopify app,but you don't want to waste your time,creating or setting up,a developer's account and a development,store,well in this video i'm going to show you,how to create a shopify private app,without creating a developer's account,or a development store,stay tuned for that,now the reason why i'm making this video,is because previously one of you guys,commented on my i guess latest video,and you're saying that previously i,created a video about how to create,a shopify private app when in fact it,wasn't really a private app instead it,was i believe a custom shopify app,so you know what yeah you're right that,was a click bait a little bit,so today i'm going to show you how to,really create a private app,and also i'm going to fix that video so,there you go fixed,before we start this video make sure,that you have the two softwares that,you're going to need,so you can start making a shopify app,because the difference between,private app and then custom app or,public apps that,you don't really need to install or to,do oauth or authentication to install,a shopify app to your to your shopify,store because basically if you create a,private app,it's already there it's already,installed so all you need to do is just,to create your own server,or you can use um softwares or,platforms like postman or api,testers so yeah we're going to do all of,that step by step but,first make sure that you have angr and,then,sam because later on later on in this,video we're going to create our own,server our own website,so you can do api calls so without,further ado,let's begin let's open our shopify store,so basically this is my shopify store,this is only a development store but it,doesn't really matter even if you have a,development store or a shopify store,it's all the same so open your shopify,store and go to apps page,and then you should have the following,page and here at the very bottom,of the page select the manage private,apps,and you should have the following page,and then you'll have to enable,private app development so click that,and you should have the following um,window that says you'll have to,read the terms and conditions the,policies and all of that so if you have,time,you can read all of this but i don't,want to waste your time i don't want to,make this video long so,just read the following terms and,conditions or policies,so i'll just check the following check,boxes and i'll select,enable private app development and,finally after that we can finally create,our own private app so here i'm going to,select,private app or create private app,and we can finally fill up the following,form that's going to show up in three,two one there you go,so here in the app details you can just,name your private app,whatever name you wanna name it because,it doesn't really matter,it's not gonna be it's not gonna be in,the,shopify app store so you can just name,this whatever you want so i'll call,it weekly how example,app and then for the emergency email you,can just,type your email i'll just type my own,email here,and then underneath of this we have the,following admin api,this is where you can activate your um,the products you the access scopes,basically so you can access the,analytics,customers the discounts the orders the,draft orders,gift cards inventories and so on and so,forth,so if you have time you can enable all,of this changing from no,access to read access to read and write,and so on and so forth so say for,example i want to access the,the orders as well as the uh,the products so where is the product so,here products i'll change just to,read and write as well as for the orders,i'll change,it to read and write there it goes so,after all of that,once you have set your access scopes you,can just scroll down and make sure that,you are using the latest version,of api for webhook if you're going to,use webhooks obviously,but it doesn't really matter you can use,the 2021 in your api calls,or 20 i think the latest or the least,version that you can use is 2020-10 i,think i'm not really sure but yeah,as much as possible use the latest,version of api,so with that all being said i'll just,select the save button i'll just click,that,and you should have the following model,window just click the create app,so basically it's just reminding you to,read the terms and conditions,or the terms of use and once that's,created you will have the following,api key password example url,and shared secret but the most important,part here is basically is just the,api key and then the password just a,reminder,don't share your password to anyone it's,really important,you don't want anyone to access your,your api,your data basically your shopify store,so as much as possible,don't share your password so with that,being said let's continue and do api,calls so as an example we have here the,following example url,we can use this in our postman so here i,have the postman,if you don't have postman account you,can go to postman.com or that call,and then you can create a new account,and make sure that you have created,um a workspace or a collection i think,that's collection,so you have to select your workspace and,you should have the following,window and here in the request url you,can paste the following url that we,copied from the example,url input field so here we're using the,orders api so we can change this to,products uh basically products that json,and then if you send this you should,have a response right over here at the,bottom,so i should bottom so here we have an,empty product because we don't have a,product yet,yet here in our shopify store so if we,create a new product let me just open,this in a new tab,and let me just wait for it and i'm,going to create a new product just an,example,click add product,and here i'll just name this to um,example,shirt and for its description we can,just name it or you can just give it a,text of,example description,and then you can just basically leave it,as just make sure that the,product status is active and then the,collection is set to home page and so on,you can just click,save and you should create the product,there you go,and let's go back to our postman and,then if we,click the send button once again it,should update the response and we should,have here,the product example product or i think,example example shirt,so click send and there you go as you,can see now we have here the response,products,and we have the id the title example,shirt example description,my vendor my shopify store and when it,was created,and so on and so forth so basically from,now on you can do,api calls using the following um,url or yeah url so,now that we have the url or the,uh example url or the uh yeah the url,what am i talking about,now we have the url we can do our own we,can create we can finally create our own,app so if you want to create user,interface,so you can easily um create,products or create orders and so on,you can finally create your own server,so let's open,vs code so i'm going to create a new,project,so here in the file i'm going to,create a new project,so i'll select open folder and you know,what i'll do,that um in my,desktop doesn't really matter i'll,create a new folder,and i'll just call it,sorry and then i'll select this folder,and we should have a new project right,over here you know the first,thing that we need to do is to apply or,upload anger because we're going to,create,uh a terminal or we're going to create a,tunnel,so we can access the local host,so open your browser once again and open,a new tab,and search for and grow and here,just select the angry or the official,website and you can just,go here in the downloads page or,download and you can just,download your download and graph for,windows or if you're using mac or,linux or linux you can just select the,more options and just select the,following,operating system but since i'm using,windows i'll just select download,for window and while we're waiting for,that i'll go,back to um to vs code and i'm going to,create a new folder,and i'll call this includes and this is,where i'm going to create the,the files or the functions so i can do,api,calls so i didn't mention in this video,we're going to use,php but if you want to use node,or react or python or ruby or,what is the other one um javascript i,guess,i already mentioned node what you're,basically going to do is just to use,functions like,fetch and then you only need to pass the,url,and then once you do that then you'll,basically have the response,from that url from that endpoint,so in this video i'm going to use php,because i'm used to,php if you don't know that you don't,notice that let's go over here in the,includes folder i'll create a new file,and i'm going to call this,shopify.php and then here i'm going to,create a new,php tag and then i'll create a class so,public,oh let's just call it class doesn't,really matter so class and i'll call it,shopify,and i'm going to create the uh the,variables we need,three variables i need the shop url,the api key and then the password so,i'll create a public variable so,first is the api key and next,is the shop url or the password,to do the password and then last is the,supposed to be the shop underscore url,like so and then we're going to create,three functions,to set the values for the api key for,the password and then the shop url,so i'll create a new function i'll call,it,set url for the or you know what let's,do the api given so set,api key i'm going to create uh,parameter here and i'll call it key and,in here we're going to access the this,variable and i'm going to access the,api key variable and i'll pass here the,value of,e now we can just finally copy this,so we don't have to manually type it,again again again,and here i'll change the name of the,function to instead of set api key,i'll set this to set password function,and for the parameter,i'll change this to pw and,for this i'll change the api key to,password because we're accessing the,password variable here,and then change this to pw because we're,passing the values,the value of the pw variable to the,password,variable of this class and then we can,just create the last,function and that is for the shop url so,set,url and for the parameter let's set this,to url,and for the um variable for our class,set this to shop url,shop url and we're passing the value of,url there we go so now we have the,three functions we can finally create,the index.php here in our,root folder so i'm going to create the,index.php,create the php tag and i'm going to use,the um shopify.php using the include,ones function and,supposed to be inside the includes,folder and supposed to be shopify.php,and i'm going to create a class or a,class here,or an object so shopify and then new,shopify because we have here the shopify,class,and then we can just um we're not using,constructor here so basically what we're,going to do is just to access the um,functions so shopify and then i'm going,to,use this url,you are function now i can just copy,this,paste it underneath and change the,functions to set,underscore api,and last is you set password,i think that's right set password url,and then apit,there you go and then for this it's,either we create,variables for the url api or password or,we can just,pass it in here so let's open our,private app which is supposed to be in,here,so let's copy the api key using the copy,to clipboard button,go back to vs code and what is that the,api key okay,so here in the set api key i'll just,pass the,api key like so and then for the,password,i'll just copy the password here,i'll just paste it in here so again,don't share your password,and then set url i'll just copy my,um domain here so weekly how,example story that my,shopify.home.com.com,copy that go back to via,go back to vs code and then paste the,domain,here so we have my domain my api key and,then the password,and there you go we have set up our,shopify class,so the last thing that we're going to do,is to to create the,api call so i'm going to create another,function i'm going to call this,um rest um api,okay so for this function we're gonna,need the endpoint the api endpoint,and then i guess we also need the um,the limits or the,the query variables and we also need the,method,so yeah i guess that's all we need so,first is the,um api endpoint so api,endpoint and then next,is just an empty array for our,query so set this to an empty array,and last is the um the method,so method or we can just set this to um,get like so and then inside of this,function we can finally,set up our our url so,let's create a new variable here and,call it url,i'm going to create the https,and then we're going to concatenate the,the api key the password and then the,shop url,so here in our browser we have the,following example,so we can honestly just copy this go,back to our vs code and paste that you,know what,let's just get rid of this dot symbol,end up with semicolon,and paste the string here so we need the,api key the password,the domain of our shopify store and then,the api,endpoint so okay so first is the api key,let's just add in here a set of single,quotes,and dot symbols and between these dot,symbols we're going to concatenate the,um,the api key so this,and then api underscore,here and next up is the password,so highlight the password placeholder,and replace that with,single quotes and then add dot symbols,and then between the start symbols we're,going to do the same thing,this and then we're going to access the,password,there we go and last is the or second to,the last is the shopify domain,so here we place that with single quotes,and then add a set of,dot symbols and then between this dot,symbols we're going to use the,shop url so this and then shop,underscore url,and last is the api endpoint so we can,just,get rid of this and concatenate the api,endpoint like so so there you have it,now we have the url,we can just save this and underneath of,this variable we can finally create,the um the curl so first of all,we're going to check we're going to,check if the method is get,or delete or i guess if it's set,so if and we're going to check if,in the method variable using the in,array function,and we're using the method variable and,we're going to check if in that variable,there is get or delete if it's,get or,billion so if it's get or delete,and then or so this is the,closing off,let me just double check so this is for,this function,i'm going to add here an end or,ampersand,and then if the we're going to check if,the query is not null using the,is null function and then we're going to,pass here the query variable and make,sure they use,exclamation y to negate the value so if,it's not,null then inside of this if condition or,statement we're going to,um convert the query variable into a,into a query variable basically for the,url so url and then we're going to,concatenate the url,with um question mark and then we're,going to use the http build query,function,and we're going to pass here the query,variable,there you go so it saved that or,saved the file and then underneath of,this condition we can finally start,um creating the curls so let's create a,curl,and i'm going to use the curl init,tutorial init,and then we're going to use the url,which is this one,and we're going to set the option so we,need the header,the return transfer the follow location,the redirects uh what else do we need,uh we're going to verify the ssl i guess,and then,connect timeout and then the custom,request because we're going to pass the,method okay so curl,set option and we're going to pass here,first the,ch variable and then we're going to use,the,option curl opt underscore um header,and we're going to set this to true so,we can get the um the headers,then next up let's just copy this,line honestly paste it here,um next is the return transfer so,curl up and then return,transfer and we can just set it to true,and next is the follow location so curl,opt follow location,and then we can also just set it to true,and then next is the maximum redirect,and we can just set it three and not,max with dear is supposed to be curl up,curl opt underscore max redirect there,you go,face another set opt and next there's,the,curl opt underscore ssl underscore,ssl underscore verify,pierre we can just set it to false,because we're using localhost what else,do we need,the time out so curl opt,timeout and then,you just set it to 30. and then next up,is the,connect time mouse curl opt and we can,just use,connect time out make sure that you,are typing wt for the connect,and then timeout there we go,and then last is the custom request so,curl,up before we continue make sure that you,set this to 30 as well instead of,true so last is the custom request so,custom,request and we're going to pass here the,method,viable so method there you go,so i think we're almost done the next,thing that we're going,to do is to check if the get variable,is set to post or put because we're,going to pass,that to another um another set options,for our curl so underneath,of the curl set off function we're going,to create a new if statement we're going,to check,if the method is equal or is not equal,to,get it's by default it's set to get,right,and then and we're going to check,if in that variable using the in array,function,we're going to check if in the method,variable,if the value of method variable is set,to post,or um post that i did it correctly,now i need to create an array so,post and then,put so let me just let me just double,check the previous one so in array,method and then array get delete,method array post and put there you go,uh let me just add spaces here so i can,see,the beginning and then the end of the,functions,so this is for the if alright so i think,we're good now so,and inside of this condition we're going,to check if the query variable,contains or if it's an array or yeah,because,here,all right so inside of this condition,we're going to check if the,um array is an array so if,it's array and we're going to use the,query variable,if it's an array then what i'm going to,do,is to convert it into a query variable,so i'm going to use the same variable,i'm going to use the http build query,and then we're passing here the query,variable,and that with semicolon and then we're,going to use the,curlset opt function once again make,sure that you use the,ch variable and we're going to use the,curl,set curl opt curl opt underscore,post fields and then we're passing here,the query,there you go end it with semicolon and,finally we can get the response,using the um execute or coil execute so,response,and then we're going to use the curl,execute,and we're passing here the ch variable,and then we're also gonna need the error,cell error,and then we're going to use the curl,error number function,make sure they use the ch variable and,lastly we're getting the,our um the error message,you miss me sorry my camera just stopped,recording,anyway let's continue by um continue,by creating the error message,variable so msg and then we're going to,use the,curl underscore error function and then,we're passing here the ch,variable and that with semicolon and,finally we can close the,curls so curl underscore,close and just pass here the ch variable,and there you go we can just check if,there is an,error in our curls so,if error is set,then we can just console.log,not console.log just return the message,so return,and then our message like so otherwise,if there are no errors then we can just,um,get the response right okay so in else,statement we're going to create the,response variable,supposed to be response not response,response there you go then we're going,to use the preg,filter or preg split because this is,going to be an array,so craig split and then we're going to,use the pattern,so make sure that you're using the,double quotes,and then forward slash forward slash,forward slash,so between these forward slashes we're,going to create the pattern so,backwards slash r backward slash n,backwards slash r backwards slash n,new lines and then or,if the pattern is next line next line,then we're going to split that as well,or we're going to check if the pattern,yes,um backward slash r and backwards slash,and then for the second parameter we're,going to pass here the response,um zero which is basically just an array,with,zero key so end it with semicolon,and then finally we can start creating,the header and then the body for our,response,so create a new variable call it headers,and it's going to be an array,now the great thing about this verb or,this function is that you can reuse this,again and again and again,i'm going to show you that later in this,video create a new headers variable it's,going to be an array,and also create another variable and,call it,content,and then we're going to use the explode,function,and we're going to explode that by using,the,next line so next line make sure that,you're using double quotes okay,and for the second parameter we're going,to use the response variable and make,sure that you set,the key to zero and that with semicolon,finally we can just set,the status so we have here the status,because by default there,are no there is no status key for our,headers,so basically what it displays as http,200 response so you need that specific,value to be in the status key that's why,we're creating the status key here,so for this key we're going to use the,content variable and make sure that,you're using the,zero because the first key of the,content variable is the http,200 response so end up with semicolon,and finally we can just use the array,shift to um,to get rid of the http 200 from the,content,variable so content okay so after that,we're going to loop through the content,using the for,each function so for each content,let's just call this um c,from s content,wait a second so for each,for each content for each content,as c that's that's what i'm trying to,say,so basically for each header from the,content variable,we're passing the value to the c,variable so for,each content then we're going to create,a new variable here,called data and then we're going to use,the explode,function and we're going to use the,delimiter,comma or colon and we're going to use,the delimiter colon,and then supposed to be the content,variable end up with semicolon and then,we're going to use the headers variable,and then the key that we're going to,pass in here is the uh,the first key of the data because,explode will basically separate and,separate the value into two sub arrays,so here we're going to use the data or,the data variable,and then we're going to use the zero key,and then for its value we're going to,use the,data and then the first key or the,number one,key the one the key one and also,there are times that,there are times that the data zero,contains spaces,so make sure that you're using the trim,function so trim trim,dream dream dream so,trim like so so there you go we're,basically,done now we can just continue by,creating the response,so we're going to return that so return,we're going to return an array,and then the first key um let's call it,headers,and we're passing here the value of,headers,second key is for the um body,we can just pass here the response,and then the key one so there you go end,up with semicolon and i,think we're done now we can just save,this and open the index.php,and finally we can create a new variable,here and call it,products and we're going to use the,shopify and then the rest,api function and first is the endpoint,so we can use the admin,api and then supposed to be 20 21,0 4 and then the api,products that json like so,and then the second parameter is just an,empty,array and then the last parameter is,we'll set it to get,end up with semicolon and finally we can,just convert it,into uh associative arrays so,products and then we're going to use the,json the code,and then the viable products then make,sure that you're using the body,because here in our shopify we're,passing the body if you want to access,the headers you can use the headers,so the second parameter for the json the,code set it to true to make it an,associative array,and then lastly we're going to,um echo out the volume of products so,echo,and then print r print,r and then products and end it with,semicolon it's saved,and we can finally create the tunnel so,let me just go back to our browser and,i'm going to,open the um the zip file,and i'm going to move this to um,to our project so open vs code,and reveal this in file explorer,and i'll just open this folder and paste,the anchor,inside so it should be,right over here now there you go open,the terminal and create,a new tunnel by typing http and grog and,then,18. and there you go as you can see now,we have our secured url we can just copy,this,go back to our browser here's my browser,here we go,open a new tab and then paste the,url here and then we're going to make,sure that we're accessing the,sheesh the sheesh folder so open that,and we have a problem so,okay so i can access the samp but i,can't access my folder,what is the problem let me just,oh it's in the desktop that's why so we,have to move that,onto a sam makes sense,so i'll just move this so press ctrl x,and i'm going to open my sam folder,and here in the htdocs just paste the,shish folder and i'm going to close the,vs code for now,and i'm going to paste the sheesh folder,there you go and i'm going to reopen my,um,vs code okay so next up,let's create a new terminal again so,angr,http 80 this time it should work so,okay we got a new secured url just,copied us,open our browser again and paste it here,and access the,sheesh folder print that,and we have an error so undefined array,key one line 63,where is my vs code so include,shopify.php,the line 63 um,let me just double check the response,variable first,so echo print r,and then the response,with semicolon go back to your browser,refresh the page,so we get the following sponsor http,so we also have in here the following,response,for our um products so as you can see,we have here the variants we also have,here the,the id so what is the problem,okay is it not converting into an array,so response craig's plea,oh okay i got it now so let's just get,rid of the echo statement,this is not supposed to be key zero,supposed to be just response and then,we're going to limit this into two,that's why so again double check your,practically,that's why response and then limit us to,hit save go back to your browser and,refresh the page,all right so i've got another error so,uncut type our explode argument to,spring must be typed string array,given in line 59,59 data explode content,supposed to be c not content,hit save again let's open our browser,i'm getting errors now,there you go finally now we got the,products so here as you can see an array,and we have the example t-shirt,description and so on so there you have,it guys,that's how you create a shopify app on,your own server on your own website,you can basically just access your api,using,the following function so if you want to,create if you want to use another,api endpoint what you can do is just,copy this lines or three lines or just,just two lines basically and then let's,just honestly echo,um comment this out and instead of,products,let's use orders hit save,go back to your browser refresh and it,should give you an,empty array which is for orders so there,you have it you can finally just create,html,css or javascript codes to create,a working shopify app so there you have,it i'm not gonna go through,all of that i'm just showing you how to,create the shopify app and use the api,key the password,the url the api endpoints and so on,now the problem here is that you don't,really access it,through your shopify app or shopify,store so here in the apps page,you won't see your app right over here,but you can access your shopify app,using your own server,so there you have it guys that's how you,create the shopify private,app without using or creating a,developer's account,now like i said the difference here is,that you don't access the,private app through your admin dashboard,so you can only access your shopify app,through your own,server or using postman or api,testers so yeah if you want me to create,an actual,shopify app using private apps,let me know comments below and if you,enjoyed this video make sure you hit,thumbs up,and subscribe and hit that notification,bell button,so you won't miss my future upload did i,just stator,i think i just thought but anyway thank,you guys so much for watching and i will,see you,next time peace

Congratulation! You bave finally finished reading how to enable private app development shopify and believe you bave enougb understending how to enable private app development shopify

Come on and read the rest of the article!

Browse More Content