Error when trying to fetch webhooks list in Shopify App built in PHP

New Member
4 0 0

We are building our own custom app for the purpose of getting order information via orders webhook and then sending that order to a third party.
We are building it in PHP using Shopify's own PHP library 
We have successfully initialized.
However when we try to fetch current webhooks, we get this error:


Fatal error: Uncaught TypeError: Argument 1 passed to Shopify\Utils::loadCurrentSession() must be of the type array, null given, called in /www/doc/ on line 45 and defined in /www/doc/ Stack trace: #0 /www/doc/ Shopify\Utils::loadCurrentSession(NULL, NULL, NULL) #1 {main} thrown in /www/doc/ on line 158


By looking at our code below, can you tell us why this error occurs?




use Shopify\Auth\FileSessionStorage;
use Shopify\Auth\Session;
use Shopify\Rest\Admin2022_10\Customer;
use Shopify\Rest\Admin2022_10\Webhookv2;
use Shopify\Utils;

    'read_analytics, read_assigned_fulfillment_orders, read_customers, read_draft_orders, read_merchant_managed_fulfillment_orders, read_order_edits, read_orders, read_script_tags, read_third_party_fulfillment_orders',
    new FileSessionStorage('/tmp/php_sessions'),

$this->test_session = Utils::loadCurrentSession(
    $this->test_session, // Session
    [], // Url Ids
    [], // Params

Replies 2 (2)

Shopify Staff
1312 215 454

Hey @cryptolikez

After some investigating we noticed a similar issue opened in the GitHub Repo for the PHP library here. I am not sure if it was you who opened that issue, but at the moment this is the best place to bring questions, discuss unexpected behaviors, and provide feedback about our API Libraries. It looks like there is now a reply in that issue, and we would suggest engaging and sharing any other details, findings, or question in the issue thread. 


Developer Support @ Shopify
- Was this reply helpful? Click Like to let us know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit or the Shopify Web Design and Development Blog

New Member
4 0 0

Thanks for nothing. I will complain.