Need PHP library support on first steps of using PHP REST API Library

Shopify Partner
9 0 1



I'm fairly new to coding agains Shopify REST API.


Until today I used a third party library to talk to shopify's REST API because I'm not able to get the original library up and running. Here the links I've read and followed.

-- I tried the Curl REST Example and got this working as described in the docu.

Here what I have in code
- In composer.json I have 


"shopify/shopify-api": "^5.1"




Here the sample code, which is causing the error message


namespace ShopifyConnector\ShopifySdk\Request;

use Shopify\Rest\Admin2023_07\Product;
use Shopify\Utils;

class ProductTest
    public function getAll()
            new FileSessionStorage(),

        $requestHeaders = [
            'Content-Type' => 'application/json',
            'X-Shopify-Access-Token' => 'SAME_TOKEN_AS_IN_CURL_EXAMPLE',

        $requestCookies = [];
        $isOnline = true;

        $test_session = Utils::loadCurrentSession(

        $p = Product::all(
            $test_session, // Session



This code causes an 


with this message

Missing Authorization key in headers array

I dug a bit deeper into the library and found that I should have provided an authorisation header with some kind of Bearer token?


Can someone help me, please? And tell me what I'm doing wrong and what I'm missing?


Jus a bit background about the App I'm building: It is an self hosted PHP application which reads products and orders from shopify and uses these data to tell our own production team what what they should focus on.


Who can help, please?


Thanks in advance for the help provided.



Replies 2 (2)

Shopify Staff
1829 269 406

Hey @dj_thossi 


Thanks for all the details. Please copy them over to an issue here to get eyes from the PHP folks:

Scott | Developer Advocate @ Shopify 

Shopify Partner
9 0 1