If you offer discounts or gift cards in your online store, please note that Paytrail's interface does not support negative lines. The amount of the unitPrice must be a positive integer in cents. Otherwise, the API rejects the request if unitPrice is not a positive integer in cents. It is not possible to import a discount or gift card as a separate negative line from the online store, instead the amount must be sent as one total amount in the API call and the discount must be calculated in the online store.
The API also rejects the payment if the total amount of unitPrice units does not match the amount (in the amount field).
Product lines (items) are not mandatory fields in the implementation of the payment service. So if desired, only the total amount (amount) can be sent via the API. The exception is for Shop-in-Shop payments that require the items field.