Last updated

Distribute Session with Hosted Payment Page - API Details


This document details how to distribute a link to a Hosted Payment Page (HPP) to a consumer.

Creating an HPP Session

When a Hosted Payment Page (HPP) session has been created, you can send a link to the consumer via email using the Distribute Endpoint. The distribute_url field in the create session response contains the URL for this endpoint.

Distributing via Email

The email sent to the consumer will be localized based on the HPP session's language settings and will include a link. Clicking the link will direct the consumer to the specific HPP.

Kustom will use the provided phone number or email to pre-fill customer information if the consumer has previously used Klarna and consented to pre-filling.

Email Validation:

Kustom validates the email address. Incorrect email addresses will return a 4xx Bad Request error. Error handling for invalid inputs is recommended for UI elements.

Delivery:

Email delivery is asynchronous. It might take a few minutes for the consumer to receive the link. For testing purposes, a maximum of 100 emails per day is allowed.

Contact Information Field

ParametersTypeDescription
methodStringSet to email
contact_information.emailStringEmail address of the customer.

Example (JSON)

{
    "contact_information": {
        "email": "user@example.com"
    },
    "method": "email"
}

Distributing via Token

Contact Information Field

ParametersTypeDescription
methodStringSet to token
contact_information.access_idStringThe access identifier (from the QR code shown to the customer). This value should not be altered by the integrator. Ensure proper JSON escaping.

Example (JSON)

{
    "contact_information": {
        "access_id": "5a5e8e70-1a96-4651-b3b6-b774012a5bbb"
    },
    "method": "token"
}

Error Codes

StatusError CodeDescription
400UNKNOWNUndefined error; contact Kustom support.
400MISSING_CONTACT_DATAIncomplete email data.
404NOT_FOUNDPayment session no longer exists.
400CONSTRAINT_VIOLATIONInvalid request.
400UNSUPPORTED_COUNTRYPhone number of requested country invalid in current region.
400BLACKLIST_REFUSEDUser blacklisted.
429EMAIL_LIMIT_EXCEEDEDEmail limit exceeded for testing environment.
502BAD_GATEWAYSession distribution to a phone number not allowed in the playground environment.