younifyd
Menu

Generate a customer token

Generate a customer token

POST/payments/v1/authorizations/{authorizationToken}/customer-token

Use it in a workflow

  1. Add a step and choose the Klarna connector.
  2. Pick the Generate a customer token action (under Payments).
  3. Fill in the fields below, then reference the result from later steps as {{generateACustomerToken.response.data}}.

Request

Path parameters

authorizationTokenstringrequired

Request body

Enter the body as JSON in the step's Body field.

billing_addressany

Once the customer has provided any data, updates to this object will be ignored (without generating an error).

customerany

Information about the liable customer of the order.

descriptionstringrequired

Description of the purpose of the token.

intended_usestringrequired

Intended use for the token.

One ofSUBSCRIPTION

localestringrequired

RFC 1766 customer's locale.

purchase_countrystringrequired

ISO 3166 alpha-2 purchase country.

purchase_currencystringrequired

ISO 4217 purchase currency.

json
{
  "description": "string",
  "intended_use": "SUBSCRIPTION",
  "locale": "en-US",
  "purchase_country": "US",
  "purchase_currency": "USD",
  "billing_address": null,
  "customer": null
}

Response

Returns 200 with an object. Read it in later steps with {{generateACustomerToken.response.data.<field>}}.

billing_addressany

Provide the billing address of the customer, if you have collected already. If not, then Klarna will collect the details inside the iFrame before authorization.

customerany

Object to provide the details of the customer making the payment.

payment_method_referencestring

Used to connect customers with payment method when it is present.

redirect_urlstring

URL to redirect the customer to after placing the order. This is a Klarna URL where Klarna will place a cookie in the customer’s 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 customer’s experience.

token_idstring

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.

json
{
  "token_id": "0b1d9815-165e-42e2-8867-35bc03789e00",
  "billing_address": null,
  "customer": null,
  "payment_method_reference": "0b1d9815-165e-42e2-8867-35bc03789e00",
  "redirect_url": "https://credit.klarna.com/v1/sessions/0b1d9815-165e-42e2-8867-35bc03789e00/redirect"
}

Need more? See the Klarna guide for connection setup and behaviour shared by every action.