question

sirmorya3ank avatar image
sirmorya3ank asked ·

Filter and Expansion doesn't work together

I am trying to filter response from orders API using modifiedTime filter and expand payment and line items together. However, payments field doesn't get expanded.

Command:

curl -s "https://apisandbox.dev.clover.com/v3/merchants/[VALID_MERCHANT]/orders?filter=modifiedTime>=1463520604000&expand=payments%2ClineItems" --header "Authorization: Bearer [VALID_API_TOKEN]" | python -mjson.tool
OrdersPayments
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

AnthonyPinto avatar image
AnthonyPinto answered ·

I just copy-pasted the queries section of your curl ?filter=modifiedTime>=1463520604000&expand=payments%2ClineItems and it worked for me without a problem. Are you certain the orders you are returning have payments? An order without payments won't even return a payments attribute.

Just to be sure, you aren't getting a response message "message": "Invalid permissions for expandable fields.", right? This would mean that your token does have orders permission, but doesn't have one or more of the permissions required for expansions.

1 comment 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.

That order had payment attached to it. However, I tried it for other order and it works now.

0 Likes 0 · ·

Welcome to the
Clover Developer Community