FROM CACHE - en_header

Only get customer's first_name and last_name using order REST API

RavindraPatel
Shopify Partner
28 1 4

Hello,

I am using order REST API to retrieve particular order with a certain field like a customer but I need first_name and last_name from the customer. Is there any solution that we can pass something in URL and it returns customer data with first_name and last_name?

GET /admin/api/2021-07/orders/{order_id}.json?fields=customer

 

Replies 2 (2)
csam
Shopify Staff (Retired)
Shopify Staff (Retired)
267 40 46

Hi @RavindraPatel 

Yes, that will work. I just tested it and making a call to that endpoint with the fields=customer returns a json array of customer information, including first_name and last_name.

 

CS | API Support @ 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

RavindraPatel
Shopify Partner
28 1 4

Hello @csam 

I want only first_name and last_name in customer details, not all details.