question

ildefonso avatar image
ildefonso asked ildefonso answered

Discounts not applied to orders

I am posting an order through the REST API

[POST https://apisandbox.dev.clover.com/v3/merchants/{merchant_id}/orders {"total":200,"title":"436","state":"open","note":"Table: 1001 (Default)","discounts":[{"id":"HVQFVTWQ3ZZPR","name":"discount 2","amount":-100}]}]

After which I'm adding line items to it.

[POST https://apisandbox.dev.clover.com/v3/merchants/{merchant_id}/orders/WTPPZWCDHTXMP/line_items {"item":{"id":"91P076X403E7M"},"unitQty":1000}]

&

[POST https://apisandbox.dev.clover.com/v3/merchants/1VDSD3S8CXJ0G/orders/WTPPZWCDHTXMP/line_items {"item":{"id":"91P076X403E7M"},"unitQty":1000}]

When I check the dashboard from the sandbox environment, I don't see any discounts being applied to the created order.


screenshot-from-2021-06-02-11-38-48.png

It is not entirely clear from the documentation what it is that I am doing wrong. Any ideas of what it is that I am doing wrong?


Note: I am not able to see a list of discounts on the sandbox dashboard. I've created some discounts through the REST API, but they are not visible.

REST APIDiscounts
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 answered

I would highly recommend you take a look at using our atomic order endpoints which allow you to create an order is a single request - https://docs.clover.com/docs/working-with-orders.

If you want to continue using the APIs you are using the discounts need to be added in a separate call - https://docs.clover.com/docs/creating-custom-orders#adding-discounts our REST API documentation is misleading/inaccurate)

10 |2000

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

ildefonso avatar image
ildefonso answered

Thanks a lot! That did the trick

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