Solved

Orders API 2022-10, 2023-01, 2023-04 missing email, customer, shipping, billing data

cylosh
Shopify Partner
3 1 2

 

Hello, we are creating orders through Order API but we're hitting a major problem in retrieving certain fields like email, shipping and billing address in both the response and webhook data for API versions 2022-10 and higher. It works correctly for API version 2022-07 but we are using this into production and once that version becomes deprecated I'm afraid we'll be stuck with the latest versions which do not correctly retrieve the order details.

 

Check below for an example request and response for the contact email but the problem extends to shipping and billing address as well, and most importantly the webhook data for orders/create or orders/updated are also missing those fields.

 

I should mention that once we go in shopify admin and mark the order as fulfilled, then the webhook or retrieving the order data through API contains all the previously missing fields and their values. This is either a bug for 2022-10 and later versions, or I'm doing something wrong, please advise.

 

 

$ curl -X GET "https://myshop.myshopify.com/admin/api/2022-10/orders/123456789.json?fields=id%2Ccontact_email%2Cname%2Ctotal_price" \
{"order":{"id":123456789,"name":"#1234","total_price":"0.00"}}

 

 

$ curl -X GET "https://myshop.myshopify.com/admin/api/2023-01/orders/123456789.json?fields=id%2Ccontact_email%2Cname%2Ctotal_price"

{"order":{"id":123456789,"name":"#1234","total_price":"0.00"}}

 

 

$ curl -X GET "https://myshop.myshopify.com/admin/api/2023-04/orders/123456789.json?fields=id%2Ccontact_email%2Cname%2Ctotal_price" \
{"order":{"id":123456789,"name":"#1234","total_price":"0.00"}}

 

$ curl -X GET "https://myshop.myshopify.com/admin/api/2022-07/orders/123456789.json?fields=id%2Ccontact_email%2Cname%2Ctotal_price" \
{"order":{"id":123456789,"contact_email":"email@domain.com","name":"#1234","total_price":"0.00"}}

 

 

Accepted Solution (1)

cylosh
Shopify Partner
3 1 2

This is an accepted solution.

Turns out it was related to Protected customer data released in version 2022-10, it works fine now after following this https://shopify.dev/docs/apps/store/data-protection/protected-customer-data#request-access-to-protec...
This can be closed.

View solution in original post

Reply 1 (1)

cylosh
Shopify Partner
3 1 2

This is an accepted solution.

Turns out it was related to Protected customer data released in version 2022-10, it works fine now after following this https://shopify.dev/docs/apps/store/data-protection/protected-customer-data#request-access-to-protec...
This can be closed.