Capture Event when User Selects a Date in Calendar

Solved
Highlighted
Shopify Partner
19 0 11

Hi,

 

I want to add a personalizable calendar to my Shopify store. Whenever a user (who is logged in) marks a date in their calendar it should be stored in the database on my own server together with the user's account details. I am looking into custom application development for this and came across webhooks for certain events. My question is, can I create a custom webhook so that whenever the user clicks a date in their calendar it notifies my app and I can forward it to my database? Or can I accomplish it some other way?

 

Thanks

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

Hey @Tehreem,

 

You can't create custom webhooks, but there might be another approach. Can you elaborate on the end goal? By user are you referring to a customer or merchant?

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Shopify Partner
19 0 11

@SBD_ wrote:

Hey @Tehreem,

 

You can't create custom webhooks, but there might be another approach. Can you elaborate on the end goal? By user are you referring to a customer or merchant?


Hi @SBD_,

By user I meant customer. My end goal is to allow every customer to mark important dates in their calendars so I can send them reminders about upcoming events and whether they would like to purchase something accordingly.

 

Thanks,

Tehreem

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

This is an accepted solution.

Ah cool, in that case you can avoid webhooks and just send a request to your app when a date is selected. 

If a user is logged in, you can access their ID with liquid.

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes
Highlighted
Shopify Partner
19 0 11

@SBD_ wrote:

Ah cool, in that case you can avoid webhooks and just send a request to your app when a date is selected. 

If a user is logged in, you can access their ID with liquid.


Hi again,

 

So I am implementing the simple requests to my app and sending the customer's ID with liquid to see if they are logged in. I wanted to know how secure this is..? How would I know it is actually a logged-in customer sending a request to my app and not some malicious code? Any way to authenticate the customer?

 

Thanks

Tehreem

0 Likes
Highlighted
Shopify Staff
Shopify Staff
1041 140 167

There's no way to know for sure, perhaps you could use something like this instead: https://shopify.dev/docs/storefront-api/reference/mutation/customeraccesstokencreate?api[version]=20...

Notice; Out of office, replies will be delayed until my return. Thanks!
0 Likes