A space to discuss GraphQL queries, mutations, troubleshooting, throttling, and best practices.
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?
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