Have your say in Community Polls: What was/is your greatest motivation to start your own business?
Our Partner & Developer boards on the community are moving to a brand new home: the .dev community forums! While you can still access past discussions here, for all your future app and storefront building questions, head over to the new forums.

Webhook to create users in my own server

Webhook to create users in my own server

Diepy
Visitor
2 0 0

I sell digital products (software), I've my own licenser system and user management.

I would like to use shopify for the web/cart/checkout/etc, but I need to manage the users and licensing from my own server.

 

in shopify: myweb.com (I don't need to create users in shopify side)

in my server: userarea.myweb.com

 

I can create a webhook to point to userarea.myweb.com/orderaproved

 

orderaproved url: (in my server)
...
if data['customer'] doenstExist
user = createUser(data['email'], passwd)

for product in data['products']:
user.createLicense(product['name'])
...

 

I've two questions:

1) Webhooks is the best solution for that?

2) Is there more information about the data sended by the webhook? (a description for each property)

 

Thanks

 

 

Replies 3 (3)

ui-gab
Shopify Partner
211 13 55

Hey,

 

1. Webhooks are good method to get the most up to date customer information as it is created/updated/deleted. However Shopify also recommends querying the existing customer table as well, because sometimes a hook may get misplaced or doesn't fire. This is important if you absolutely need to have the entire data set of customers from shopify's database.

 

2. For webhooks: https://help.shopify.com/en/api/reference/events/webhook#events

If you are looking for specific information about each of the fields, I find that it is sometimes scattered, and the best place to look if it exists is information about that object. 

For the customer: https://help.shopify.com/en/api/reference/customers/customer

ui-gab
https://www.uiavenue.ca
We specialize in data analytics. If I've helped you today, please give our give our app a try (15-day free trial) https://apps.shopify.com/ui-ave-analytics and maybe write a good review.
Send me a message if you want a free data analysis consultation.
Diepy
Visitor
2 0 0

Thanks for your response.

Ok, I've tested the "test" webhook, but I would like to know is there is any difference if I use paypal as a payment method,

Do you have a webhook response example for that? This is crucial to know if I can migrate my platform to shopify,

 

Thanks!

ui-gab
Shopify Partner
211 13 55

From what I've seen there isn't a difference or not much of a difference between a webhook sent by paypal vs just regular checkout.

This is assuming you are integrating paypal using Shopify's Paypal integration ( Website Admin/Settings/Payment Provider ).

 

I do not have a production environment website, so I'm not able to give you a webhook response example. It doesn't allow the payment process to proceed, so I'd have no way to get that webhook.

Based on what I've seen, it should create the customer information when using paypal, but I'm not 100% as I am not able to test.

ui-gab
https://www.uiavenue.ca
We specialize in data analytics. If I've helped you today, please give our give our app a try (15-day free trial) https://apps.shopify.com/ui-ave-analytics and maybe write a good review.
Send me a message if you want a free data analysis consultation.