Skip to main content

Webhook
object

Contains functions for verifying Shopify webhooks.

Verifies requests coming from Shopify webhooks.

Request
required

Promise< <Topics> | <Topics, Resources> >
Was this section helpful?

Get the API version used for webhook request.

Was this section helpful?

Webhook API version

Example

import { ActionFunction } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export const action: ActionFunction = async ({ request }) => {
const { apiVersion } = await authenticate.webhook(request);
return new Response();
};

Get the shop that triggered a webhook.

Was this section helpful?

Webhook shop

Example

import { ActionFunction } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export const action: ActionFunction = async ({ request }) => {
const { shop } = await authenticate.webhook(request);
return new Response();
};

Get the event topic for the webhook.

Was this section helpful?

Webhook topic

Example

import { ActionFunction } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export const action: ActionFunction = async ({ request }) => {
const { topic } = await authenticate.webhook(request);

switch (topic) {
case "APP_UNINSTALLED":
// Do something when the app is uninstalled.
break;
}

return new Response();
};

Get the webhook ID.

Was this section helpful?

Webhook ID

Example

import { ActionFunction } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export const action: ActionFunction = async ({ request }) => {
const { webhookId } = await authenticate.webhook(request);
return new Response();
};

Get the request's POST payload.

Was this section helpful?

Webhook payload

Example

import { ActionFunction } from "@remix-run/node";
import { authenticate } from "../shopify.server";

export const action: ActionFunction = async ({ request }) => {
const { payload } = await authenticate.webhook(request);
return new Response();
};