All the discount categories follow the same basic rules. For each, you specify an amountOff or percentOff. Digital River first applies the discount and then determines taxes based on that reduced amount. To determine the aggregate value of all applied discounts, check totalDiscount.
Line item discounts
For each items[] that you want to discount, set either a percentOff or amountOff.
To indicate how many products the discount should be applied to, assign an integer to discount.quantity. If you don't define this parameter, then the discount is applied to the entire quantity of that items[].
In the following percent off request, discount.quantity is 1, so the discount isn't applied to the entire quantity of that items[]. In the amount off request, discount.quantity isn't defined, so the discount is applied to the entire quantity.
You can also apply discounts to shipping costs. The following POST /checkouts demonstrates how to use shippingDiscount to specify either a percentOff or amountOff:
If you include multiple discount types in a request, Digital River first applies any line-item discounts and then the entire purchase markdown. Product and order-level discounts don't reduce shipping costs. If you want to give customers a break on their shipping, you'll need to apply a shipping discount.
Validation errors generated by zero-value discounts
You must send a discount value greater than zero. This applies to all types of discounts.
If you submit a POST /checkouts, POST /checkouts/{id} or POST /invoices and amountOff or percentOff is 0 or less, a 400 Bad Request is returned.
{"type": "bad_request","errors": [ {"code":"invalid_discount_percent","parameter":"discount","message":"The value must be an integer between 0.01 and 100.00 inclusive." } ]}
{"type": "bad_request","errors": [ {"code":"invalid_discount_amount","parameter":"discount","message":"The value 0.0 is not permitted." } ]}