Why is my post API call resulting in a null shop query?

Topic summary

A developer is encountering an error when making POST API calls in a Shopify app built using the official PHP template.

Core Issue:

  • POST requests return a null shop query parameter, causing a TypeError in Shopify\Utils::sanitizeShopDomain()
  • The error occurs at line 19 in the AuthRedirection library
  • Bridge connection has been established and routes are defined in web.php

Error Details:

  • The sanitizeShopDomain() method expects a string but receives null instead
  • This suggests the shop parameter is not being properly passed or retrieved during POST API calls

Status: The issue remains unresolved with no responses or solutions provided yet. The developer needs help identifying why the shop query parameter becomes null specifically during POST requests.

Summarized with AI on November 16. AI used: claude-sonnet-4-5-20250929.

https://github.com/Shopify/shopify-app-template-php. I have created shopify app using this template. I defined all routes in web.php file. and I try to call post api in my dashboard page. I have established bridge connection also. Issue is that When I call post API. I got shop query null.

Shopify\Utils::sanitizeShopDomain(): Argument #1 ($shop) must be of type string, null given, called in /app/app/Lib/AuthRedirection.php on line 19 {“exception”:"[object] (TypeError(code: 0): Shopify\Utils::sanitizeShopDomain(): Argument #1 ($shop) must be of type string, null given, called in /app/app/Lib/AuthRedirection.php on line 19 at /app/vendor/shopify/shopify-api/src/Utils.php:32)