Paytrail's API now supports negative unitPrice values, allowing discounts and gift cards to be listed as separate line items. This means that gift cards or discounts can be specified as negative line items. If your online store uses discounts or gift cards, you can now list them as separate line items with a negative unitPrice value. This simplifies the handling of transactions since you no longer need to consolidate discounts or gift cards into different product lines on your store’s side before making the API call.
While discounts can now be listed as negative line items, it is essential to ensure that the amount of all unitPrice values matches the total amount specified in the amount field. The API will reject the payment if the totalled unitPrice values do not match the amount field.