question

curtis avatar image
curtis asked curtis commented

How to apply discount via Rest API?

Clover has a discount tool from the app store. How can I utilize the Rest API to apply a fixed discount to either an order or item using a discount created from the discount app?

If this is not possible, how can I add a custom discount with a fixed value for a given order or lineItem via Rest API?

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 curtis commented

Support for preset discounts was never migrated to the V3 version of the REST API. you can access the discount objects used by the Discounts app by sending a GET request to v2/merchant/{merchantUUID}/inventory/discounts(check https://www.clover.com/rest-api under /discounts/)

For checking or applying discounts for an order I do recommend using the v3 endpoints. You can find the operations listed under the Orders section here: https://www.clover.com/api_docs#!/orders

Note that a discount as it applies to an order, may or may not reference a preset 'v2 style' discount object by id, under the discount attribute.

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.

curtis avatar image curtis commented ·

Thanks! For others who are stuck trying to get the v3 discount endpoints to work, note that if using the 'amount' property in a discount, the value must be a negative long else the API response will return a 400 bad request.

0 Likes 0 ·

Welcome to the
Clover Developer Community