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

RavindraPatel
Shopify Partner
29 1 5

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)
267 40 51

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.

 

To learn more visit the Shopify Help Center or the Community Blog.

RavindraPatel
Shopify Partner
29 1 5

Hello @csam 

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