We're moving the community! Starting July 7, the current community will be read-only for approx. 2 weeks. You can browse content, but posting will be temporarily unavailable. Learn more

[Beginner] Having trouble recieving webhook subscriptions

[Beginner] Having trouble recieving webhook subscriptions

headless_cheque
Shopify Partner
2 0 0

Framework: Remixjs

Tutorial Used: https://shopify.dev/docs/apps/build/webhooks/subscribe/get-started?framework=remix&deliveryMethod=pu...

Webhook: orders/create

My Config:

 

  [[webhooks.subscriptions]]
  topics = [ "orders/create" ]
  uri = "pubsub://mouthful-facet-448222-a1:webhook-tut-sub"

  [[webhooks.subscriptions]]
  topics = [ "orders/create" ]
  uri = "/webhooks/app/orders-create"

 

I also setup an endpoint

app/routes/webhooks.app.orders-create.jsx
import { authenticate } from "../shopify.server";

export const action = async ({ request }) => {
  try {
    const { topic, shop } = await authenticate.webhook(request);
    console.log(`Received ${topic} webhook from ${shop}`);

    // Process the webhook payload
    const payload = await request.json();
    console.log("Webhook payload:", payload);

    return new Response(null, { status: 200 });
  } catch (error) {
    console.error("Webhook error:", error);
    return new Response("Webhook failed", { status: 500 });
  }
};

 

What I tried:

shopify app webhook trigger --topic orders/create --address pubsub://mouthful-facet-448222-a1:webhook-tut

The above worked to publish a message and I see it in my google pub/sub console, but not my app.

 

Even after deploying multiple times, does not log any messages and my app insights reports these webhooks as 503 as if my app isn't running.

What is my next debug step?

Replies 0 (0)