Authorize a Payment
Authorizing a purchase requires the Klarna generated token from a completed session
creation. Set the
apAuthService_preapprovalToken
request field value to the token value.
Where you retrieve the token is dependent on whether you created a HOP session or inline
session. If you created a HOP session, the token is appended to the success URL the
customer is redirected to after completing the checkout using their Klarna account. If
you created an inline session, the token is generated by the Klarna widget when the
customer completes the checkout. After authorizing a payment, you can capture the authorization for up to 28 days.
Merchant-Defined Data
Merchant-defined data is included in the
merchantDefinedData_mddField_5
field. This field has replaced the
merchantDefinedData_field5
field. If you
submit a request with the
merchantDefinedData_field5
field, Cybersource
automatically replaces the field with
merchantDefinedData_mddField_5
.You are prohibited from including personally
identifying information (PII) in the
merchantDefinedData
fields for the purposes
of capturing, obtaining, and/or transmitting any PII. PII includes,
but is not limited to, address, credit card number, social security
number, driver's license, state-issued identification number,
passport number, and card verification number (CVV, CVC2, CVV2, CID,
CVN). In the event Cybersource
discovers you are
capturing and/or transmitting PII in the
merchantDefinedData
fields, whether or not
intentionally, Cybersource
immediately suspends your
merchant account, which results in a rejection of any and all
transaction requests submitted by the merchant account after the
point of suspension.Endpoints
Set the
apAuthService_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
Response Status
The authorization service responds with one of these statuses as the
apAuthReply_status
field value:- FAILED: The authorization request is not successful. Send a new authorization request. A failed request can be due to either Klarna rejecting the transaction or a technical error.
- PENDING: The authorization request is accepted but is not authorized. Request the check status service to retrieve status updates. For more information, see Check Status.
The authorization service also responds with a reason code as the
apAuthReply_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 a pending authorization, you can receive
this status when the authorization updates: