Identify logged customer on rate request

triclozan
Shopify Partner
1 0 0

Hi Shopify experts! We are developing an app that provides a carrier service to our clients. One of them wants us to treat certain customers differently and provide free shipping for them (they force customers to log in before placing an order). To do that we need to identify a customer during processing requests to carrier service. However, rate requests don't even contain addressee emails. Do you know a way to connect a rate request to carrier service with a previously authenticated customer? Ideally, we need a customer id or at least the email to do the trick. Thanks!

Reply 1 (1)
Josh
Shopify Staff
Shopify Staff
1134 82 213

Hey there, 

 

I'm not aware of any surefire way to do this, as the email isn't sent to API-created carrier services. You would either have to identify customers based on name and address alone, or my only other thought would be to subscribe to checkouts/create webhooks. You could grab the name, e-mail, and even address from there for identification purposes, and then tie that to your carrier requests to identify specific customers.  

 

The problem with the webhook approach is that it's obviously a lot more complex to build, and there's also potential for the customer to go through the checkout faster than the webhook can arrive, or any other webhook-related issue causing things to work unexpectedly.

 

Josh | Shopify 
 - Was my reply helpful? Click Like to let me know! 
 - Was your question answered? Mark it as an Accepted Solution
 - To learn more visit the Shopify Help Center or the Shopify Blog