laravel-shopify icon indicating copy to clipboard operation
laravel-shopify copied to clipboard

Shopify AWS EventBridge for Webhook

Open veed76 opened this issue 2 years ago • 9 comments

Hi @osiset @Kyon147 @lucasmichot

I'm registering the webhook via AWS EventBridge, I have added the ARN for the webhook address. Example:

'webhooks' => [
         [
            'topic' => 'app/uninstalled',
            'address' => "arn:aws:events:eu-west-2::event-source/aws.partner/shopify.com/9999999/staging-event-bus"
        ],
],

While I'm installing the app in the Shopify store, I got this error: https://prnt.sc/8KxBgePrZSFC

Can you please check and let me where I'm wrong?

Thank you.

veed76 avatar Apr 01 '22 15:04 veed76

Hi @veed76

I can't say much for your AWS set up but that does not look like a proper qualified url.

The error says what the issue is Invalid URL so I believe that is your problem.

Kyon147 avatar Apr 01 '22 15:04 Kyon147

Thanks @Kyon147 for reply. just want to know in this package is it possible to pass AWS ARN in webhook Address?

veed76 avatar Apr 01 '22 15:04 veed76

Thanks @Kyon147 for reply. just want to know in this package is it possible to pass AWS ARN in webhook Address?

The webhook needs to be a URL, it's not a requirement of the package but a requirement of Shopify when setting up webhooks using the API.

Here's the docs

Kyon147 avatar Apr 01 '22 15:04 Kyon147

In shopify Documentation they mentioned that we can pass ARN

https://shopify.dev/apps/webhooks/configuration/eventbridge#define-a-custom-event-pattern

image

veed76 avatar Apr 01 '22 15:04 veed76

I just registered via POSTMAN and it works with AWS ARN image

veed76 avatar Apr 01 '22 15:04 veed76

There is a support for webhookSubscriptionCreate. I check in osiste/Laravel Package and there is no support for eventBridgeWebhookSubscriptionCreate GraphQL.

veed76 avatar Apr 01 '22 15:04 veed76

There is a support for webhookSubscriptionCreate. I check in osiste/Laravel Package and there is no support for eventBridgeWebhookSubscriptionCreate GraphQL.

Hi @veed76 , indeed there is no support. Feel free to make a PR or just ask a Shopify developer to do it

lucasmichot avatar Apr 01 '22 15:04 lucasmichot

Interesting, good testing - it looks like webhookSubscriptionCreate uses type URL https://shopify.dev/api/admin-graphql/2022-01/scalars/URL

Which is why eventBridgeWebhookSubscriptionCreate exists to be able to use the ARN routes.

As @lucasmichot mentions - the package does not have that GraphQL support in it, as you've found yourself. So feel free to provide a PR.

Kyon147 avatar Apr 01 '22 15:04 Kyon147

Hi @lucasmichot @Kyon147 I have added the support for eventBridgeWebhookSubscriptionCreate, can you please review the PR: https://github.com/osiset/laravel-shopify/pull/1114

Thank you. Vishal Gohil

veed76 avatar Apr 02 '22 07:04 veed76