question

getswift avatar image
getswift asked ·

Get Order List expand, filters

I am trying to get a list of customer details for their name phone number, address and email id.
Earlier i would use the expand query, however, this was deprecated.
https://apisandbox.dev.clover.com/v3/merchants/<MerchantID>/orders?expand=lineItems,customers.addresses,customers.emailAddresses,customers.phoneNumbers&limit=100

The new query to filter order list with customer.id as stated in the documentation returns a 400 BadRequest. How do i get the customer name, address, phone number and email addresses? This is critical to us to get all customer deatils.

https://apisandbox.dev.clover.com/v3/merchants/ <MerchantID>/orders?filter= customer.id∾cess_token=<token>
Orders
10 |2000 characters needed characters left characters exceeded

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

1 Answer

Raymond Lee avatar image
Raymond Lee answered ·
The customers expansion for our GetOrders endpoint has been deprecated to optimize our responses to API calls. Here is the announcement that was made about this a while back, and it contains the other deprecated expansions, as well as workarounds to the expansions.
3 comments Share
10 |2000 characters needed characters left characters exceeded

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

@Raymond Lee

I did look at the workarounds. The new apis do not give the customer address, email and phone numbers. I can just get the First name, Last name and customer id.

Deprecated - GET /v3/merchants/{M_ID}/customers?expand=orders
GET /v3/merchants/{M_ID}/orders?expand=customer

Workarounds - GET /v3/merchants/{M_ID}/orders
GET /v3/merchants/{M_ID}/customers/{CUSTOMER_ID}

Deprecated - This did give the customers address, email and phone
Workarounds - This does not give the customers address, email and phone numbers
0 Likes 0 · ·

Regarding the work around, the addresses, emailAddresses, and phoneNumbers fields need to be expanded.

Example endpoint:

GET /v3/merchants/{merchantId}/customers/{customerId}?expand=emailAddresses,addresses,phoneNumbers

See suggested endpoint docs here:
https://docs.clover.com/clover-platform/reference#delegatedgetcustomer-1

See docs on expanding fields here:
https://docs.clover.com/clover-platform/docs/paginating-elements
1 Like 1 · ·
@zgreathouse

Got it working. Thank you.
1 Like 1 · ·

Welcome to the
Clover Developer Community