Klarna
Klarna is a payment system allowing consumers to pay after receiving the goods.
After a consumer has chosen to pay with Klarna, CURO will create a Klarna transaction which is "Not Shipped".
After you ship the products to the consumer, the order needs to be Activated in the back-office so Klarna will start collecting from the consumer.
If there's something wrong with the order, it is also possible to Cancel the order in the back-office.
Klarna requires extra parameters specified below to initiate a transaction.
Note
- If you do not specify required fields, you will receive an
errororwarningcontainer in the response, depending on what is missing.- For a
warningyou will also receive aurlwhich will contain a URL to the standard Klarna FORM where the consumer can fill out the missing data.- If you collect all required data on your own website, you are required to show the Klarna Terms and Conditions and have the user agree to them via a checkbox. Klarna will also want to review your checkout procedure for approval — please contact your account manager for more details.
Klarna Payment
Entry point: /rest/v1/curo/payment/klarna/
EXTRA REST request elements
See the Klarna request parameters in the API reference for the general elements.
See Create Transaction for the general elements.
| Field name | Required | Description | |
|---|---|---|---|
[request] | container | required | General container for this resource. Includes the generic request items. |
[consumer] | container | required | Consumer information for this transaction (See the generic Consumer and Shipping elements for this transaction.) |
[cartitems] | container | required | The cart items of the webshop order. (See the generic CartItems elements.) |
Important
ssnis only required in the following countries: Sweden, Finland, Norway and Denmark.Klarna has pre-defined the content of the
ssnnumber, like so:SE:
YYMMDD-NNNN— it can be sent with or without dash "-" or with or without the two first numbers in the year.
FI:DDMMYY-NNNN— it can be sent with or without dash "-".
NO:DDMMYYNNNNN
DK:DDMMYYNNNN
REST response elements
| Field name | Description | |
|---|---|---|
[payment] | container | General container for this resource. |
transaction_id | Newly created transaction ID. | |
url | If there is no error, this URL depends on whether the information sent to Klarna was processed completely and successfully: incomplete → URL to the default CURO Klarna form (you will also have a warning container indicating which fields are missing); success → URL to url_pending (or url_failure if no pending URL is given); the URL will receive status=pending to indicate it was accepted but must be Activated for Klarna. It is your responsibility to redirect the consumer to the url address. |
Klarna Request samples
Below is a sample of an incomplete request for Klarna, missing some required variables. In this case you will receive a url to a FORM where the consumer can complete the data and submit it to Klarna.
JSON Request Example
POST /rest/v1/curo/payment/klarna/ HTTP/1.1
Content-Type: application/json
Accept: application/json{
"site_id": 1234,
"currency_id": "EUR",
"amount": 100,
"reference": "Reference 1",
"description": "Description 1",
"url_success": "http://www.example.com/success.html",
"url_pending": "http://www.example.com/pending.html",
"url_failure": "http://www.example.com/failed.html",
"url_callback": "http://www.example.com/control.html",
"country_id": "NL",
"language_id": "nl",
"ip": "1.2.3.4",
"consumer": {
"firstname": "John",
"lastname": "Doe",
"email": "[email protected]",
"address": "nowhereroad 12",
"city": "NonVille",
"zipcode": "12345",
"country_id": "NL",
"phone": "0612345678",
"dob": "10-07-1970",
"gender": "m",
"initials": "JD"
},
"cartitems": [
{
"quantity": 1,
"sku": "hamer_01",
"name": "Hamer",
"price": 150,
"vat": 21,
"vat_inc": 1,
"type": 1
},
{
"quantity": 1,
"sku": "Discount",
"name": "Discount total",
"price": -50,
"vat": 21,
"vat_inc": 1,
"type": 4
}
]
}Response for correct request:
HTTP/1.1 200 OK
Content-Type: application/json{
"payment": {
"action": "redirect",
"external": true,
"url": "http://www.example.com/pending.html?status=pending&transaction=T1234567890&code=701&reference=Reference+1",
"transaction_id": "T1234567890",
"testmode": 1
},
"success": true
}Response for wrong request:
HTTP/1.1 200 OK
Content-Type: application/json{
"payment": {
"action": "redirect",
"external": false,
"url": "https://secure.curopayments.net/v1/payment/klarna.app?transaction=T1234567890",
"transaction_id": "T1234567890",
"testmode": 1
},
"success": true,
"warning": "missing consumer data: dob"
}Klarna Refund
The Refund operation must be done using the Transaction ID of a successfully completed transaction.
The Refund operation, as its name states, consists of returning the money already collected by a Payment or a Capture transaction. The amount collected can be refunded in total or partially. You cannot refund amounts bigger than the one sent in the original transaction.
Note
- You can perform multiple refunds until you reach the total amount of the original Payment and your balance in the system is sufficient.
- A refund will be done via a SEPA Credit Transfer to the account information provided by the issuing bank. It is not possible to refund to other accounts.
- Refunds can be bounced by the receiving bank in case of restrictions on the receiving account (i.e. Depot or Savings accounts).
- Created refunds will be "Pending" (
code=0) until they are collected and processed at 05:30 (Europe/Amsterdam); before that time a refund can still be cancelled.
Entry point: /rest/v1/curo/refund/
REST request elements
| Field name | Required | Description | |
|---|---|---|---|
[refund] | container | required | General container for this resource (XML only). |
transaction_id | required | Transaction ID that needs to be refunded. | |
amount | required | The amount payable in cents (with no decimal separator). Required unless auto_amount flag is given. | |
vat | required | VAT percentage for the refund. | |
vat_inc | required | Flag to indicate VAT is included in the refund amount. | |
auto_amount | optional | Flag (1/Yes) to indicate the full/remaining amount can be refunded for the transaction. | |
description | optional | Reason why the transaction is being refunded. |
REST response elements
| Field name | Description | |
|---|---|---|
[refund] | container | General container for this resource. |
transaction_id | Transaction ID. |
JSON Example Request
POST /rest/v1/curo/refund/ HTTP/1.1
Authorization: Basic dXNlcm5hbWU6YXBpa2V5
Host: secure.curopayments.net
Content-type: application/json
Accept: application/json{
"site_id": 1234,
"transaction_id": "T1234567890",
"amount": 100,
"description": "Double paid"
}Response:
HTTP/1.1 200 OK
Content-Type: application/json{
"refund": {
"transaction": "T1234567890",
"payment_type_id": "18",
"transaction_id": "T1234567890"
}
}Klarna Capture
A previously authorized transaction can be captured by using this entry point if the action is supported by the payment method.
Entry point: /rest/v1/curo/capture/
REST request elements
| Field name | Required | Description | |
|---|---|---|---|
transaction_id | required | Transaction id to be captured. | |
description | Optional description for the capture. NB This is not processed or used by a payment method, just for the back-office. |
Klarna Cancel
A transaction can be cancelled in the back-office, or by using this entry point.
Entry point: /rest/v1/curo/cancel/
REST request elements
| Field name | Required | Description | |
|---|---|---|---|
transaction_id | required | Transaction id to be cancelled. | |
description | Optional description for the cancellation. NB This is not processed or used by a payment method, just for the back-office. |
Updated about 2 months ago