question

sirmorya3ank avatar image
sirmorya3ank asked sirmorya3ank commented

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
Orders
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

anthonypinto avatar image
anthonypinto answered sirmorya3ank commented

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
10 |2000

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

sirmorya3ank avatar image sirmorya3ank commented ·

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