Download OpenAPI specification:Download
The Customer Token API is used to charge customers with a tokenized Klarna payment method and can be used for recurring purchases, subscriptions and for storing a customer's payment method. Tokens are created using the generate a customer token
call in the payments API.
Read more on Klarna payments.
Use this API request to retrieve the content of a Klarna customer token. The request will return the status of the token as well as payment method details. To learn more, refer to the Read customer tokens details article.
Token was successfully read.
You were not authorized to execute this operation.
The token does not exist.
{- "card": {
- "brand": "VISA",
- "expiry_date": "12/2020",
- "masked_number": "************1234"
}, - "direct_debit": {
- "masked_number": "**********124"
}, - "payment_method_type": "INVOICE",
- "status": "ACTIVE"
}
Use this API call to create an order using a Klarna Customer Token. Make sure you use the correct token ID when placing an order, to ensure that the right consumer gets billed. Read more on Create a new order using the customer token.
Order was successfully created.
We were unable to create an order with the provided data. Some field constraint was violated.
You were not authorized to execute this operation.
The token does not exist.
The data in the request does not match the session.
{- "attachment": {
- "body": "{\"customer_account_info\":[{\"unique_account_identifier\":\"test@gmail.com\",\"account_registration_date\":\"2017-02-13T10:49:20Z\",\"account_last_modified\":\"2019-03-13T11:45:27Z\"}]}",
- "content_type": "application/vnd.klarna.internal.emd-v2+json"
}, - "auto_capture": false,
- "merchant_data": "{\"order_specific\":[{\"substore\":\"Women's Fashion\",\"product_name\":\"Women Sweatshirt\"}]}",
- "merchant_reference1": "ON4711",
- "merchant_reference2": "ON4711",
- "merchant_urls": {
- "confirmation": "string",
- "push": "string"
}, - "order_amount": 1,
- "order_lines": [
- {
- "merchant_data": "{\"customer_account_info\":[{\"unique_account_identifier\":\"test@gmail.com\",\"account_registration_date\":\"2017-02-13T10:49:20Z\",\"account_last_modified\":\"2019-03-13T11:45:27Z\"}]}",
- "name": "Running shoe",
- "product_identifiers": {
- "brand": "shoe-brand",
- "category_path": "Shoes > Running",
- "global_trade_item_number": "4912345678904",
- "manufacturer_part_number": "AD6654412-334.22",
- "color": "white",
- "size": "small"
}, - "quantity": 1,
- "quantity_unit": "pcs",
- "reference": "AD6654412",
- "tax_rate": 1900,
- "total_amount": 2500,
- "total_discount_amount": 500,
- "total_tax_amount": 475,
- "type": "physical",
- "unit_price": 2500,
- "subscription": {
- "name": "string",
- "interval": "DAY",
- "interval_count": 1
}
}
], - "order_tax_amount": 0,
- "purchase_currency": "GBP",
- "shipping_address": {
- "attention": "Attn",
- "city": "London",
- "country": "GB",
- "email": "test.sam@test.com",
- "family_name": "Andersson",
- "given_name": "Adam",
- "organization_name": "string",
- "phone": "+44795465131",
- "postal_code": "W1G 0PW",
- "region": "OH",
- "street_address": "33 Cavendish Square",
- "street_address2": "Floor 22 / Flat 2",
- "title": "Mr."
}
}
{- "authorized_payment_method": {
- "number_of_days": 0,
- "number_of_installments": 0,
- "type": "invoice"
}, - "fraud_status": "string",
- "order_id": "string",
}
Use this API call to update the status of a Klarna Customer Token. This should be used if you want to cancel a specific customer token. Read more on Update the status of a customer token.
Token patch request has been accepted and is being processed.
Unable to patch the token with the provided data. Some field constraint was violated.
You were not authorized to execute this operation.
The token does not exist.
{- "status": "CANCELLED"
}