question

trunga avatar image
trunga asked David Marginian Deactivated edited

Querying Data Relationally

I am using the API but there is no relational data offered where reporting queries are efficient. For instance if i want to do aggregate queries across different types of data as in inventory and orders there are now ways to query relationally. Am i missing something? Is there a way to query data that is relational and indexed rather than querying for individual collections and relating the data myself.

App Market
10 |2000

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

David Marginian avatar image
David Marginian Deactivated answered

Can you please provide details on the query you are trying to perform? Have you looked at the REST API usage docs? https://docs.clover.com/clover-platform/docs/making-rest-api-calls. The API has the ability to expand fields which may give you what you need. You can also filter on joined fields (on orders for example you can filter on customer.id, etc.). This information is available in the REST API reference page - https://docs.clover.com/clover-platform/reference/orders-1.

10 |2000

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

trunga avatar image
trunga answered David Marginian Deactivated edited

Hi, so if i wanted to perform a query to find all the inventory that has not sold in a particular period of time how would i do that

2 comments
10 |2000

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

David Marginian avatar image David Marginian ♦♦ commented ·

I don't think you can answer that question directly from the API, but I may be wrong. My initial thought would be that you would have to retrieve the inventory items (may not be possible if there are a lot of items) and then make another call to obtain the orders within a time-range and expand the line items. That will give you all the items that had been sold then as you mentioned above you would need to do some work to get the answer you need. There certainly may be a better way.

1 Like 1 ·
maricris avatar image maricris David Marginian ♦♦ commented ·

Another way would be to create a separate DB table to keep track of all of the sold items per week.

0 Likes 0 ·
trunga avatar image
trunga answered

I need an example of a joined field because i did not see that in the docs

10 |2000

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

trunga avatar image
trunga answered

what your saying is what i think it is. i don't think there is an easier way from what options are provided

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