question

ancient5 avatar image
ancient5 asked ancient5 answered

How to get the item for a given payment?

Hi, I'm using this endpoint to get all payments. I can't seem to get the associated item for the payment, however. I am a little confused, in fact, because reviewing the data model it is unclear to me whether there is a relationship between items and payments. On the other hand, we can pull the "Item sales" report from the Clover dashboard which displays the aggregates sales (or payments) for a given item/inventory.

What I want, ideally, is to pull this data: a payment, along with its associated item/inventory, and the tender type. The way our end users are processing payments is they'll select an inventory item and then process the payment. So surely there is a way to get at that data?

Thank you!

REST APIInventory
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

·
ancient5 avatar image
ancient5 answered

Well, I asked ChatGPT and got what looks to be the answer. You'll want to get an order, and for each order you can get the line items. The line items have an element called "item" that contains the ID of the associated inventory item (there can be multiple per order). Some orders do not have associated inventory, so instead the line item will have a name of "Sale".

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