# 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 Kustom 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 | Parameters | Type | Description | | --- | --- | --- | | `method` | String | Set to `email` | | `contact_information.email` | String | Email address of the customer. | ### Example (JSON) ```json { "contact_information": { "email": "user@example.com" }, "method": "email" } ``` ## Distributing via Token ### Contact Information Field | Parameters | Type | Description | | --- | --- | --- | | `method` | String | Set to `token` | | `contact_information.access_id` | String | The 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) ```json { "contact_information": { "access_id": "5a5e8e70-1a96-4651-b3b6-b774012a5bbb" }, "method": "token" } ``` ## Error Codes | Status | Error Code | Description | | --- | --- | --- | | 400 | UNKNOWN | Undefined error; contact Kustom support. | | 400 | MISSING_CONTACT_DATA | Incomplete email data. | | 404 | NOT_FOUND | Payment session no longer exists. | | 400 | CONSTRAINT_VIOLATION | Invalid request. | | 400 | UNSUPPORTED_COUNTRY | Phone number of requested country invalid in current region. | | 400 | BLACKLIST_REFUSED | User blacklisted. | | 429 | EMAIL_LIMIT_EXCEEDED | Email limit exceeded for testing environment. | | 502 | BAD_GATEWAY | Session distribution to a phone number not allowed in the playground environment. |