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
Hey Community! As the holiday season unfolds, we want to extend heartfelt thanks to a...
By JasonH Dec 6, 2024Dropshipping, a high-growth, $226 billion-dollar industry, remains a highly dynamic bus...
By JasonH Nov 27, 2024Hey Community! It’s time to share some appreciation and celebrate what we have accomplis...
By JasonH Nov 14, 2024