Using ecomm API we create an order via scl.clover.com/v1/orders and then pay for it with source via scl.clover.com/v1/orders/{ID}/pay .
We need to apply a discount to the order. There is a "discount type" in SCL order create for item, however there is no explanation on using "type=discount" and trying to add a discount as Item to an order throws 400 "invalid JSON Format" error, even though JSON is definitely properly formatted -- this is both on sandbox AND live. We tried various combinations of properties for "discount" item - none of which worked.
Reference:
https://docs.clover.com/clover-platform/reference/orders#postorders
POST:
curl --request POST \
--url https://scl-sandbox.dev.clover.com/v1/orders \
--header 'accept: application/json' \
--header 'authorization: Bearer ************' \
--header 'content-type: application/json' \
--data '{"items":[{"type":"sku","amount":200,"currency":"usd","description":"test 2 buck","quantity":1},{"amount":100,"currency":"usd","quantity":1,"type":"discount"}],"metadata":{"metakey":"metaval"},"currency":"usd","email":"foo@foobar.com"}'