- Making a payment request.
- Making a partial capture request.
- Making a partial refund request.
- Applying a discount.
- Adjusting an authorization.
Make a payment request
For any payment request, include price and product information in lineItems. When adding price and product information, note that:- Klarna will only approve the payment if the total amount specified in
lineItemsmatches theamount.value.
Line items in a payments request
Make a partial capture request
Include the followinglineItems parameters when making a /payments/{paymentPspReference}/captures request.
Line items in partial capture request
pspReference. Once we have processed your request, you will also receive a CAPTURE webhook.
Make a partial refund request
Include the followinglineItems parameters when making a POST request to the /payments/{paymentPspReference}/refunds endpoint, where paymentPspReference is the pspReference of the authorization you want to refund.
Line items in partial refund request
pspReference. Once we have processed your request, you will also receive a REFUND webhook.
Apply a discount
There are several ways to apply a discount to the invoice:- Apply a discount to individual line items.
- Apply a discount to the whole purchase.
- Let Adyen add a discount line for you. This is the fallback option in case the other methods do not work for you.
- One pair of shoes, original price EUR 12.00 including 20% VAT
- Two pairs of socks, original price EUR 4.50 including 20% VAT
Apply a discount to individual line items
With this method of applying a discount, you reduce the cost of the applicable line items instead of discounting the basket as a whole. To apply a discount to individual line items:- Calculate the reduced amount of each line item you want to discount.
-
Send a payment request in which each line item specifies the discounted amounts:
amountExcludingTaxtaxAmountamountIncludingTax
Apply discount to individual line items
Apply a discount to the whole purchase
With this method of applying a discount, you specify the line items with their original price and then apply a discount to the basket as a whole by adding a discount line. To apply a discount to the entire basket:- Calculate the discount to the product total and the VAT.
-
In your payments request, send each fully priced line item, plus a line Item to specify the discount with the following parameters:
id: Discountdescription: DiscountamountExcludingTax: The discount amount, preceded by a minus signtaxAmount: The discount amount, preceded by a minus signamountIncludingTax: The discount amount, preceded by a minus sign
Apply discount to entire purchase
Let Adyen add a discount line for you
With this method of applying a discount, Adyen calculates thatamount.value is less than the total value of the line items, so a discount must have been applied. In this case, Adyen adds a line item for the discount before sending to Klarna.
Adyen applies discount line
Adjust an authorization
If you want to adjust an authorized payment that has not yet been fully captured, your API request must specify all captured and refundedlineItems. See Adjust an authorization for detailed instructions. This is available for Klarna with Checkout API v70 and later.
Below are two examples of adjusting an authorized payment:
These examples are based on the following order:
Cancel part of the authorization before capture
If you want to cancel or adjust the authorization before capturing, you can declare the new amount and associatedlineitems.
The following example removes Item #2 from the above order by declaring the new basket composition and amount.
Cancel part of an auth before capture
Add a product from a partially captured order
If you want to add products to a partially captured or refunded order, you must include the already captured or refundedlineItems in the update request, in addition to the new order content.
In the following example, Item #1 from the above order is captured, and we add a third item to the order:
Add product to partially captured order
