App reviews, troubleshooting, and recommendations
Hi
i am working on shopify application with default Node template. I am trying to setup mandatory webhooks. Just for sake of clarity see the below code
deliveryMethod: DeliveryMethod.Http, callbackUrl: "/api/webhooks", callback: async (topic, shop, body, webhookId) => { logger.info('CUSTOMERS_DATA_REQUEST called') // const payload = JSON.parse(body); // logger.info({ // Body: payload // }, 'CUSTOMERS_DATA_REQUEST called') const dataRequestHandler = new CustomersDataRequestHandler(new CustomersDataRequest(topic, body)) await dataRequestHandler.handle() // const sessionId = await shopify.api.session.getOfflineId(shop) // const session = await shopify.config.sessionStorage.loadSession(sessionId); // Payload has the following shape: // { // "shop_id": 954889, // "shop_domain": "{shop}.myshopify.com", // "orders_requested": [ // 299938, // 280263, // 220458 // ], // "customer": { // "id": 191167, // "email": "john@example.com", // "phone": "555-625-1199" // }, // "data_request": { // "id": 9999 // } // } }, },
When i goto to linked Dev store, then customer and request any customer's data. i see following message at console
Session was not valid. Redirecting to /api/auth?shop=undefined | {shop: undefined} 11:28:51 │ web-backend │ [shopify-api/ERROR] Missing Authorization header, was the request made with authenticatedFetch? | {isOnline: false}
I don't understand why is doesn't work. See below webhook config
[webhooks.privacy_compliance] customer_deletion_url = "https://crab-model-briefly.ngrok-free.app/api/webhooks/customer_deletion" customer_data_request_url = "https://crab-model-briefly.ngrok-free.app/api/webhooks/customer_request" shop_deletion_url = "https://crab-model-briefly.ngrok-free.app/api/webhooks/deletion"
package.json
"dependencies": { "@shopify/app": "3.58.2", "@shopify/cli": "3.59.0" }
Solved! Go to the solution
This is an accepted solution.
I was using wrong URL like in
https://crab-model-briefly.ngrok-free.app/api/webhooks/customer_deletion
"customer_deletion" shouldn't be there
This is an accepted solution.
I was using wrong URL like in
https://crab-model-briefly.ngrok-free.app/api/webhooks/customer_deletion
"customer_deletion" shouldn't be there
June brought summer energy to our community. Members jumped in with solutions, clicked ...
By JasonH Jun 5, 2025Learn how to build powerful custom workflows in Shopify Flow with expert guidance from ...
By Jacqui May 7, 2025Did You Know? May is named after Maia, the Roman goddess of growth and flourishing! ...
By JasonH May 2, 2025