question

mlyon avatar image
mlyon asked butchercd2 answered

"expand" parameter on /v1/charges endpoint - how to use?

The API Reference documentation for the /v1/charges endpoint shows that it can take an "expand" parameter as an array of strings to "specify fields in the response for expansion". However the documentation doesn't list what fields can be expanded, and anything I try doesn't seem to work.

Ideally I'd like to expand the customer data. I've tried sending this as an array query like 'expand[]=customer', as well as a string like 'expand=customer', and neither work. I've also tried this with 'customers', 'order', 'orders', etc, trying to stumble upon anything that actually does work, to no avail.

Changing the expand parameters in the API Reference form and then submitting a request through the online form doesn't appear to change the request at all. So I think that's an issue with the API reference, but I've also attempted this with my own code and it doesn't work either.

Any advice here would be appreciated.

REST APISandboxe-commerce api
10 |2000

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

1 Answer

·
butchercd2 avatar image
butchercd2 answered

I'm not certain about the /v1 API but for /v3 customers I had to pass the array contents in literal form without any spaces between them - I was not able to copy them from the documentation:

addresses,emailAddresses,phoneNumbers

->

POST https://sandbox.dev.clover.com/v3/merchants/{mId}/customers?expand=addresses%2CemailAddresses%2CphoneNumbers

10 |2000

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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