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.

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

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

RavindraPatel
Shopify Partner
31 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
31 1 5

Hello @csam 

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