Skip to content

Shopify webhook - Failed sha256 verification #769

Closed
@jaaneh

Description

@jaaneh

I opened this originally in discussions, but unsure if this is better suited as an issue so re-opening it here. Feel free to close one and continue conversation in the other. Discussion #768


Hey there,

I've been trying to get up an going with the Shopify integration, however every time I trigger an event through Shopify it leads to a "Failed sha256 verification" error.

image

The webhook succeeds obviously when using the test event in Trigger, and it returns the payload (using the example below). I have set up webhook in Shopify, and I am also using the correct secrets/env vars.

I am self-hosting Trigger, and have input the DEV URL to Shopify as the app is not hosted yet.

Seeing as Shopify doesn't have a way to insert the secret that Trigger gives you, and they instead give us one, I assume Trigger registers this automatically when registering the trigger? Still, with the correct URL set in Shopify it fails to verify.

Here's an example piece of code that doesn't work:

import "@shopify/shopify-api/adapters/node"
import { Shopify } from "@trigger.dev/shopify"
import { client } from "../"

const shopify = new Shopify({
  id: "shopify",
  apiKey: process.env.SHOPIFY_API_KEY!,
  apiSecretKey: process.env.SHOPIFY_API_SECRET_KEY!,
  adminAccessToken: process.env.SHOPIFY_ADMIN_ACCESS_TOKEN!,
  hostName: process.env.SHOPIFY_SHOP_DOMAIN!
})

client.defineJob({
  id: "shopify/on-order-created",
  name: "Shopify: On Order Created",
  version: "0.1.0",
  trigger: shopify.on("orders/create"),
  run: async (payload, io, ctx) => {
    return { payload }
  }
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions