question

ojhatushar avatar image
ojhatushar asked Jeffrey Blattman edited

How to get only New line item added from register app

We have make an app using clover sdk. I am applying discount through my app on a line item from background service.I always want to get only new line item which are added from register app and not all of the them which are already discounted means when applying discount I do not want to traverse each and every line item which are already discounted.I want to get only that line item which are not discounted.
LineItemsDiscounts
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

Jeffrey Blattman avatar image
Jeffrey Blattman answered Jeffrey Blattman edited
You can inspect the time stamp on the line items. You'll need to track a "last time I checked the line items" yourself and compare the LineItem.createdTime field.

You could also track a list of UUIDs you've "seen", and only consider those you have not.

There's no way from the SDK to directly ask "give me the line items added since this time".
10 |2000

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