Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Usage of Admin Rest API with Custom App created from Shopify admin

Usage of Admin Rest API with Custom App created from Shopify admin

MVWebmaster
Visitor
2 0 3

Hi,

All the API documentation describes the 'resource' way of interacting with API.

Example: https://shopify.dev/api/admin-rest/2022-07/resources/order#post-orders

 

So when I want to create Order via API I should write this line

 

$order = new Order($this->test_session);

 

But, as I have created an App within Shopify admin panel and obtained access token there as well - I don't have session object. 

 

What is the way to use API in this way for custom apps created within shopify admin panel? How can I make a session object?

Reply 1 (1)

Alan
Shopify Staff
129 15 25

Hey @MVWebmaster - this is a great question. Generally, my understanding is that you'd want to use the access token you generated through the admin as part of an initializer. I'm not a developer myself, but I was able to track down some discussion of a similar issue that some other developers have run into in our public GitHub repository. 

It looks like they had also been dealing with PHP - there may be a solution there. 

Hope this helps, let us know if we can clarify anything on our end. Happy to keep looking into this with you if need be. 

Alan | API Support @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog