{ "$schema": "https://json-schema.org/draft/2020-12/schema", "$id": "https://raw.githubusercontent.com/api-evangelist/klarna/main/json-schema/klarna-customer-token-creation-response-schema.json", "title": "customer_token_creation_response", "x-generated": "2026-10-12", "x-method": "derived", "x-generator": "derive-json-schema.py", "x-source": "openapi/klarna-payments-api-openapi.yml#/components/schemas/customer_token_creation_response", "type": "object", "required": [ "token_id" ], "properties": { "billing_address": { "$ref": "#/$defs/address" }, "customer": { "$ref": "#/$defs/customer_read_create_token" }, "payment_method_reference": { "type": "string", "description": "Used to connect customers with payment method when it is present." }, "redirect_url": { "type": "string", "description": "URL to redirect the customer to after placing the order. This is a Klarna URL where Klarna will place a cookie in the customers browser (if redirected) and redirect the customer back to the confirmation URL provided by the merchant. This is not a mandatory step but a recommended one to improve the returning customers experience." }, "token_id": { "type": "string", "description": "Generated customer token. This token will be used to create a new order for the subscription using the Create a New order using token API." } }, "$defs": { "address": { "type": "object", "properties": { "attention": { "type": "string", "description": "Attn. (if applicable). Only applicable for B2B customers.", "minLength": 0, "maxLength": 99 }, "city": { "type": "string", "description": "Customers city.", "minLength": 0, "maxLength": 99 }, "country": { "type": "string", "description": "Customers country. This value overrides the purchase country if they are different. Should follow the standard of ISO 3166 alpha-2. E.g. GB, US, DE, SE.", "pattern": "^[A-Za-z]{2,2}$" }, "email": { "type": "string", "description": "Customers email address.", "minLength": 0, "maxLength": 99 }, "family_name": { "type": "string", "description": "Customers family name in UTF-8 encoding.\nCannot be only numbers, must be more than 1 character.\nAllowed special characters: -'.\nMore information can be found [in this link](https://docs.klarna.com/klarna-payments/in-depth-knowledge/customer-data-requirements/#details-needed-per-market)", "minLength": 0, "maxLength": 99 }, "given_name": { "type": "string", "description": "Customers given name in UTF-8 encoding.\nCannot be only numbers, must be more than 1 character.\nAllowed special characters: -'.\nMore information can be found [in this link](https://docs.klarna.com/klarna-payments/in-depth-knowledge/customer-data-requirements/#details-needed-per-market)", "minLength": 0, "maxLength": 99 }, "organization_name": { "type": "string", "description": "Organization name (if applicable). Only applicable for B2B customers.", "minLength": 0, "maxLength": 99 }, "phone": { "type": "string", "description": "Phone number. Preferably a mobile phone number.", "minLength": 0, "maxLength": 99 }, "postal_code": { "type": "string", "description": "Customers postal code. Validation according to [Universal Postal Union addressing system](https://www.upu.int/en/activities/addressing/postal-addressing-systems-in-member-countries.html).\nE.g. 12345, W1G OPW.", "minLength": 0, "maxLength": 10 }, "region": { "type": "string", "description": "Customers region or state - Mandatory for US and AU market. Validations according to ISO 3166-2 format, e.g. OH, NJ, etc.", "minLength": 0, "maxLength": 99 }, "street_address": { "type": "string", "description": "Customers street address. Validation according to [Universal Postal Union addressing system](https://www.upu.int/en/activities/addressing/postal-addressing-systems-in-member-countries.html). Regional formatting is required, as follows:\nUK/US/FR: 33 Cavendish Square\nRest of EU: De Ruijterkade 7", "minLength": 0, "maxLength": 99 }, "street_address2": { "type": "string", "description": "Customers street address. Second Line. ", "minLength": 0, "maxLength": 99 }, "title": { "type": "string", "description": "Customers Title. Allowed values per country:\nUK - \"Mr\", \"Ms\"\nDE - \"Herr\", \"Frau\"\nAT: \"Herr, \"Frau\"\nCH: de-CH: \"Herr, \"Frau\" it-CH: \"Sig.\", \"Sig.ra\" fr-CH: \"M\", \"Mme\" \nBE: \"Dhr.\", \"Mevr.\"\nNL: \"Dhr.\", \"Mevr.\"", "minLength": 0, "maxLength": 20 } } }, "customer_read_create_token": { "type": "object", "properties": { "date_of_birth": { "type": "string", "description": "Customers date of birth. The format is yyyy-mm-dd" }, "gender": { "type": "string", "description": "Customers gender - male or female" } } } } }