v1
latestOpenAPI 3.0.02026-07-1462248.4 KBorders
Generate a consumer token
Use this API call to create a Klarna Customer Token.<br/>After having obtained an authorization_token for a successful authorization, this can be used to create a purchase token instead of placing the order. Creating a Klarna Customer Token results in Klarna storing customer and payment method details. Read more on Generate a consumer token.
post/payments/v1/authorizations/{authorizationToken}/customer-token
Path parameters
authorizationTokenstring required
Request body
Example request
{
"billing_address": {
"attention": "Attn",
"city": "London",
"country": "GB",
"email": "test.sam@test.com",
"family_name": "Andersson",
"given_name": "Adam",
"phone": "+44795465131",
"postal_code": "W1G 0PW",
"region": "OH",
"street_address": "33 Cavendish Square",
"street_address2": "Floor 22 / Flat 2",
"title": "Mr."
},
"customer": {
"date_of_birth": "1978-12-31",
"gender": "male",
"title": "Mr.",
"type": "organization"
},
"locale": "en-GB",
"purchase_country": "GB",
"purchase_currency": "GBP"
}Response
Token was successfully created.
Example response
{
"billing_address": {
"attention": "Attn",
"city": "London",
"country": "GB",
"email": "test.sam@test.com",
"family_name": "Andersson",
"given_name": "Adam",
"phone": "+44795465131",
"postal_code": "W1G 0PW",
"region": "OH",
"street_address": "33 Cavendish Square",
"street_address2": "Floor 22 / Flat 2",
"title": "Mr."
},
"customer": {
"date_of_birth": "1978-12-31",
"gender": "male"
},
"payment_method_reference": "0b1d9815-165e-42e2-8867-35bc03789e00",
"redirect_url": "https://credit.klarna.com/v1/sessions/0b1d9815-165e-42e2-8867-35bc03789e00/redirect",
"token_id": "0b1d9815-165e-42e2-8867-35bc03789e00"
}