BuyButton and Webhooks integration to receive instant notifications

Highlighted
New Member
3 0 0

Hi ,

 

We have a requirement to integrate our website with Shopify to enable customers to purchase products and we can provide a digital gift randomly to few users as part of a promotion.

 

We plan to integrate buy button and Webhooks to achieve this.

We have 2 locales on our website en_GB and fr_FR which are technically 2 separate brands so they want to integrate separately and manage their gifts individually but on the same website.

With webhooks we see that we have to setup the webhooks with an app. So first question is :

Q1 ) Do we need different shopify accounts or can we manage it with one and setup 2 separate webhooks to achieve this?

Q2) Can some custom information be passed to us back via the webhooks two separate orders from the 2 markets (en_GB and fr_FR)

Q3) Do we display a transaction id or any reference number to the user when the payment is completed via shopify buy button and is the same information available to us via webhooks so we can validate Users Claim for the gift ( if needed).

 

If someone can suggest the overall workflow of the journey that can be created here will really help us in achieving what we plan to achieve.

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 163

Hey @NM30,

 

1) One account should be fine, with a single webhook. You can create webhooks through admin > settings > notifications too.

2) You might need to call the API once the webhook arrives. If that doesn't work, see 3)
3) Consider using the Storefront API, you can include custom attributes.

 

 

0 Likes
Highlighted
New Member
3 0 0

Thanks @scottydont 

 

This is helpful.

For your point 1:

 

Can we also have multiple accounts link to a single domain? The reason I am asking is as we have 2 different markets and they want seperate Shopify accounts.

But the urls of the webhooks will have same domain although the endpoints will be different.

Eg:

a) With Shopify Account One we will setup our webhook ( something like https://abc.xyz.com/api/gethook1
b) With Shopify Account Two we will setup our webhook ( something like https://abc.xyz.com/api/gethook2

 

Hope this should work our without any problem or do you see any challenge here with the ask?

 

Thanks for the Storefront API, thats helpful.

 

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 163

Thanks for the details.

 

Can we also have multiple accounts link to a single domain?

I guess this could be done with subdomains if you're adding the domains to the Shopify account.

 

If you're hosting away from Shopify + using the Storefront API, this won't be a concern - you can send requests to the myshopify domains. You'll just need a Storefront API key for each store.

 

But the urls of the webhooks will have same domain although the endpoints will be different. Do you see any challenge here with the ask?

Sounds good. Webhooks contain a x-shopify-shop-domain header too so you'll know which store the order is coming from (if you wanted to avoid managing two routes).

 

Let me know if I can clarify anything!

0 Likes
Highlighted
New Member
3 0 0

Thanks @scottydont ,

 

So does this also mean that if we have 2 separate shopify accounts, I can point webhooks from both accounts to the same endpoint?

x-shopify-shop-domain header will help us differentiate the requests on our website?

 

Also Can you help us with some information around if we can setup a sandbox environment within shopify and test out the overall integration we have been discussing, before launch?

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1040 139 163

So does this also mean that if we have 2 separate shopify accounts, I can point webhooks from both accounts to the same endpoint?

x-shopify-shop-domain header will help us differentiate the requests on our website?

That's right.

 

Also Can you help us with some information around if we can setup a sandbox environment within shopify and test out the overall integration we have been discussing, before launch?

Sure, try creating a development store: https://help.shopify.com/en/partners/dashboard/managing-stores/development-stores

0 Likes