question

James Tickett avatar image
James Tickett asked anandchakru commented

How can I retrieve Customers within Orders using the API?

I've tried:

customers?expand=addresses,emailAddresses,phonenumbers,cards,orders&return_null_fields=true

and can see the Customers with Order IDs. In the API docs for Orders, it says you can expand on 'customers' to return an array like so:

orders?expand=customers,payments&return_null_fields=true&filter=id=0J2MK6G4AY168

...although the response we get has no Customers array in it. I am targeting the order ID provided from the first Customers query, so I am sure this order should be linked to a customer.

OrdersCustomers
1 comment
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

anandchakru avatar image anandchakru commented ·

+1 for the question, since I'm <5 for upvoting

0 Likes 0 ·
Miguel avatar image
Miguel Deactivated answered

I tried the following, and it returns the order with customer details:

https://apisandbox.dev.clover.com/v3/merchants/{mId}/orders/{orderId}?expand=customers
10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

James Tickett avatar image
James Tickett answered

Ah. I've just tried this again and realised I must have been using the wrong Order ID somehow. It's working now!

10 |2000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Welcome to the
Clover Developer Community