Creating a HOP Session
Create a new session whenever the customer displays your checkout page.
- HOP Specifications
- When you send a HOP session request, set theapSessionsService_paymentFlowModefield value toHOP.Cybersourceresponds with a Klarna redirect URL in theapSessionsReply_merchantURLfield. Send the customer to the redirect URL to complete the checkout. When the customer completes the checkout, Klarna redirects the customer back to the merchant website and includes a token in the merchant URL. The token generated by Klarna can then be used in the authorization request to link it to the session.
Klarna Payment Methods
When you request the session service, you can determine the Klarna payment method you
want to offer your customers. Set the optional
paymentMethod_name
request field to a value
listed in the Payment Method column. Payment Method Field Value | Description | Klarna Products |
---|---|---|
pay_later | Customer pays total bill at a set date. |
|
pay_now | Customer pays total bill at the time of checkout. |
|
pay_over_time | Customer pays bill in equal multiple installments. |
|
- Example: Payment Methods in Session Request
- <paymentMehtod_name>pay_later</paymentMethod_name>
Calculating the Grand Total Amount
Klarna requires that the grand total amount of a purchase be included in the request
using the
purchaseTotals_grandTotalAmount
field. The
country of the transaction and the use of coupons affect how to calculate the grand
total amount. For more information about how to calculate the grand total amount, see Calculating the Grand Total Amount in the Reference Information section.
Language Specification
To set the language for your Klarna checkout experience, include the
billTo_language
field in your request. By not including
this field, the Klarna checkout experience is set to English by default. For a list
of all possible values, see the ISO Standard Language Codes
guide. - Example: Language Specification
- <billTo> <language>es</language> </billTo>
Endpoints
Set the
apSessionsService_run
field to
true
, and send the request to one of these
endpoints:Production:
https://ics2ws.ic3.com/commerce/1.x/transactionProcessor
Test:
https://ics2wstest.ic3.com/commerce/1.x/transactionProcessor
Line Items
Klarna uses line items when you send a create session and update session requests.
Line items are used to include information about the goods that
your customers purchase, such as product name, quantity, and price.
Line items are represented as the
item_#_
fields,
starting with item_0_
, and increasing in numerical
order.For more information about how to properly format line items in your request, see
Using Line Items in the Reference Information section.
Response Status
The session service responds with one of these statuses as the
apSessionReply_status
field
value:- FAILED: The session request is not successful. Send a new session request.
- INITIATED: The session is initiated and the customer may now checkout. Send periodic check status requests until the status updates toCOMPLETED. For more information, see Check a Request Status.
The session service also responds with a reason code as the
apSessionReply_reasonCode
field value. For more
information about reason codes, see the Reason Codes for the Simple Order
API.When you send a check status request for an initiated session, you can receive one of
these statuses when the session updates:
- ABANDONED: The customer did not complete the payment using the redirect URL or widget.
- COMPLETED: The customer completed the checkout process. You can now authorize the funds.