What's your biggest current challenge? Have your say in Community Polls along the right column.
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.

Re: destination.email in CarrierService rate request always has "null" value

destination.email in CarrierService rate request always has "null" value

kolevich
Shopify Partner
66 1 8

When Shopify calls our CarrierService for shipping rates with this endpoint https://shopify.dev/docs/api/admin-graphql/2024-01/queries/carrierService we always get "null" for destination.email parameter. Is there a way to get customer's email in this call? Are we missing it due to some missing app permissions? Based on the customer's email we then want to retrieve customer's data such as tags. Please advise.

 

Screenshot 2024-10-03 at 10.14.45.png

Co-founder & CEO at Calcurates. Accurate shipping rates and unique shipping rules for Shopify made simple.
Apps: Calcurates: Accurate Shipping | Calcurates: Estimated Shipping
Replies 4 (4)

Eric-HAN
Shopify Partner
255 29 27

HI, Kolevich

As the doc metioned:

For API-created carrier services, you should use only the following shipping address fields:

  • address1
  • address2
  • city
  • zip
  • province
  • country

Other values remain as null and are not sent to the callback URL.

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee
kolevich
Shopify Partner
66 1 8

Hi @Eric-HAN,
Thanks for your response, but as the destination.email parameter is presented in the API call we assume there is a way to retrieve its value. Listed parameters are very basic and doesn't provide enough shipping calculation flexibility for merchants and app developers.

Co-founder & CEO at Calcurates. Accurate shipping rates and unique shipping rules for Shopify made simple.
Apps: Calcurates: Accurate Shipping | Calcurates: Estimated Shipping
Eric-HAN
Shopify Partner
255 29 27

Hi, there

When Shopify calls the callback  to request shipping rates, the request does not include the email field of the customer at the destination. This is because the shipping rate request is primarily concerned with the logistics of shipping, such as the destination address, package dimensions, and weight, rather than customer-specific information like email addresses. The email field is generally not necessary for calculating shipping rates and is therefore not included in the request payload.

If you need to access customer information, including their email, you would typically retrieve this data through a separate query or API call that fetches customer details, rather than through the shipping rate request itself. This separation of concerns helps maintain data privacy and ensures that only the necessary information is shared with third-party carrier services.

Hope my understanding could help you. or Directly search the tech help from Shopify.
But you question is reasonable. since other fields of the customer address all are available to fetch.

- Helpful? Please hit Like and mark it as a solution
Want to modify or custom changes on store? Let me help.
- Feel free to Email Me    Buy Me A Coffee
kolevich
Shopify Partner
66 1 8

@Eric-HAN that makes sense, thank you. A "separate query or API call that fetches customer details" could help, however we were hoping we could avoid additional calls since the response time is critical for shipping methods and rates returned by our app.

Co-founder & CEO at Calcurates. Accurate shipping rates and unique shipping rules for Shopify made simple.
Apps: Calcurates: Accurate Shipping | Calcurates: Estimated Shipping