> For the complete documentation index, see [llms.txt](https://docs.younium.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.younium.com/sales-and-product-led-growth/paywall.md).

# Paywall

## Overview

Younium Paywall enables product-led growth by letting prospects purchase subscriptions directly from a branded checkout page embedded on your website. A customer selects a product and charge plan, completes checkout through Stripe, and receives an activated subscription with a posted invoice — all without manual sales intervention.

Paywall is a standalone purchase service that orchestrates the full workflow from account and order creation through payment processing, subscription activation, invoicing, and payment recording. It connects to the Younium platform for all billing operations and to Stripe for payment collection. Real-time status updates are delivered to the checkout page during the purchase flow.

Paywall complements [Self Service](/sales-and-product-led-growth/self-service.md) (ongoing customer self-service for existing accounts) and [CPQ](/sales-and-product-led-growth/cpq.md) (sales-led quoting). CRM integrations such as [HubSpot](/crm-integrations/hubspot.md) and [Salesforce](/crm-integrations/salesforce.md) can feed leads into Younium before or after a Paywall purchase.

***

## Core Concepts

### Paywall configuration

A paywall is a configured checkout experience tied to a single product. Each paywall defines which charge plans and billing periods are available, which currencies are supported, branding and styling, checkout field requirements, terms and conditions, and post-purchase thank-you behaviour. Paywalls are scoped to a legal entity.

| What you configure                  | Description                                                                                                 |
| ----------------------------------- | ----------------------------------------------------------------------------------------------------------- |
| Name                                | How the paywall is identified in Younium                                                                    |
| Status                              | **Active**, **Inactive**, **Draft** or **Deleted**                                                          |
| Product                             | The Younium product offered for purchase                                                                    |
| Currencies                          | The currencies a buyer can check out in                                                                     |
| Billing periods                     | The billing intervals offered, such as monthly or annual                                                    |
| Allowed domains                     | The domains permitted to embed or link to this paywall, so it cannot be used from a site you do not control |
| Charge plan presentation            | How each charge plan is presented — its subtitle and what it includes                                       |
| Styling                             | Colours, fonts, corner radius and shadow for the checkout                                                   |
| Checkout fields                     | Whether organisation number and VAT number are asked for                                                    |
| Custom fields collected at checkout | Account and order custom fields to capture from the buyer                                                   |
| Terms and conditions                | The link and link text a buyer accepts                                                                      |
| Thank-you message                   | What the buyer sees after purchase, and an optional redirect                                                |
| Discount                            | An optional discount applied at checkout                                                                    |

Only paywalls with status **Active** accept purchases.

### Purchase session

Each purchase attempt creates a session with its own identifier, which tracks the buyer's progress from the draft order through to the activated subscription. The checkout page updates itself as that progresses: it receives the Stripe payment link as soon as it is ready, and is told when the purchase completes or fails, so the buyer never has to refresh or wait on a page that has stopped telling them anything.

### Purchase workflow

Paywall executes the purchase as a coordinated multi-step workflow. Steps before payment run when the customer initiates checkout. Steps after payment run when Stripe confirms successful payment.

**Pre-payment steps:**

| Step | Action                                                           |
| ---- | ---------------------------------------------------------------- |
| 1    | Purchase started — session created                               |
| 2    | Draft order created — account and draft order created in Younium |
| 3    | Stripe payment initiated — Stripe Checkout session created       |

**Post-payment steps:**

| Step | Action                                                         |
| ---- | -------------------------------------------------------------- |
| 4    | Stripe payment finalised — payment confirmed with Stripe       |
| 5    | Order activated — subscription activated in Younium            |
| 6    | Invoice generated — invoice created for the purchase           |
| 7    | Invoice posted — invoice posted in Younium                     |
| 8    | Invoice email sent — invoice delivered to customer             |
| 9    | Payment recorded — single payment posted in Younium            |
| 10   | Purchase completed — integration events and webhooks triggered |

If any post-payment step fails, the workflow records the failure and notifies the checkout page. Pre-payment failures prevent the customer from reaching Stripe checkout.

***

## Behaviour and Rules

### Domain validation

Paywall validates that the referring domain is on the paywall's whitelist before accepting a purchase request. Requests from unlisted domains are rejected. This prevents unauthorised embedding of checkout pages.

### Checkout data collection

The purchase request collects customer and order information required to create the account and subscription in Younium:

| Field                                | Required                        |
| ------------------------------------ | ------------------------------- |
| Email                                | Yes                             |
| Company name                         | Yes                             |
| Currency code                        | Yes                             |
| Product ID and charge plan ID        | Yes                             |
| Billing period                       | Yes                             |
| Address (street, city, zip, country) | Yes                             |
| Organisation number                  | When enabled in checkout fields |
| Tax registration number (VAT)        | When enabled in checkout fields |
| Account custom fields                | When configured on the paywall  |
| Order custom fields                  | When configured on the paywall  |

### Payment processing

Paywall uses Stripe Checkout for payment collection. After the customer completes payment on Stripe, the checkout page notifies Paywall to finalise the payment and continue the post-payment workflow. Payment cancellation on Stripe triggers a cancel notification that ends the session without creating an active subscription.

### Real-time updates

The checkout page receives real-time events during the purchase:

| Event               | Meaning                                                     |
| ------------------- | ----------------------------------------------------------- |
| Payment initialized | Stripe checkout URL is ready; customer should be redirected |
| Paywall failure     | A critical error occurred; purchase cannot continue         |

### Idempotency

Complete-payment requests are idempotent — if payment was already finalised for a session, duplicate completion requests are ignored. Message processing uses outbox and inbox patterns to prevent duplicate delivery of integration events.

### Integration events and webhooks

When a purchase completes successfully, Paywall triggers integration events for account creation, subscription activation, invoice posting, and payment posting. These events can drive webhooks to external systems configured in Younium.

### Multi-tenancy

Every paywall request is scoped to a tenant and legal entity. Tenant and legal entity identifiers are required on all requests and propagate through the entire purchase workflow.

***

## Configuration and Settings

Paywall configuration is managed in Younium under **Sales → Paywall**. Operators create and edit paywall records, assign products and charge plans, configure styling, and set domain whitelists.

### Paywall status

| Status   | Behaviour                                       |
| -------- | ----------------------------------------------- |
| Active   | Accepts purchases                               |
| Inactive | Not available for checkout                      |
| Draft    | Under configuration; not available for checkout |
| Deleted  | Removed; not available for checkout             |

### Styling

Each paywall supports custom styling applied to the checkout UI:

| Setting           | Description                               |
| ----------------- | ----------------------------------------- |
| Primary colour    | The main brand colour across the checkout |
| Accent colour     | Used for buttons and highlights           |
| Background colour | The page background                       |
| Font              | The font family used throughout           |
| Corner radius     | How rounded the checkout's elements are   |
| Shadow            | The shadow applied to cards               |

### Thank-you page

After a successful purchase the buyer sees a thank-you message you configure. You can instead redirect them to a URL of your own — to an onboarding flow or a getting-started page — rather than leaving them on the default confirmation page.

### Charge plan presentation

Each charge plan on the paywall can have a subtitle, an includes title, and a list of included items displayed on the checkout page to help customers compare plans.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.younium.com/sales-and-product-led-growth/paywall.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
