Covers all questions related to inventory management, order fulfillment, and shipping.
Hi,
We are building a custom shipping calculator app using the carrier service api for one of our clients. They want to offer free shipping for certain customers.
But upon checking the carrier service request, I can see that no information about a customer is being sent, not even the customer id.
Is there any way I can achieve this functionality?
Hi Sniper2804,
As you've found when a customer goes through the Shopify checkout process and the system reaches out to the Carrier Service for shipping rates, the data included in the requests are typically related to the order itself (e.g., order contents, destination address) rather than information about the customer who is placing the order - which is why you're not seeing data like `customer_id`.
As a work around, you could potentially store customer-specific shipping rules in a metafield (or a separate system) based on the customer ID, and then use that information when generating shipping rates within your app. However, this would not involve the Carrier Service API directly.
Here's an general approach on how it could work:
Hope this helps!
Liam | Developer Advocate @ 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 Shopify.dev or the Shopify Web Design and Development Blog