Skip to main content
Registration is the entry point to the subscription flow. Submitting the form creates a Stripe customer record and sets a signed session cookie that carries the customer ID through the rest of the checkout process.

Overview

1

User enters their email address

The registration form collects an email address. The form action also accepts a name field, which is passed to Stripe when creating the customer record.
2

Stripe customer is created

On form submission, the server calls stripe.customers.create with the provided email and name. Stripe returns a customer object containing a unique customerId.
app/services/customer.ts
export async function createCustomer(email: string, name: string) {
  const customer = await stripe.customers.create({
    email: email,
    name: name,
  });
  return customer;
}
3

Session cookie is set

The customerId returned by Stripe is stored in a signed session cookie. This cookie is required by every subsequent step — plan selection and payment — to associate actions with the correct Stripe customer.
app/routes/register.tsx
const session = await getSession(request.headers.get("Cookie"));
session.set("customerId", createdCustomer.id);
return redirect("/prices", {
  headers: { "Set-Cookie": await commitSession(session) },
});
4

User is redirected to plan selection

After the session is committed, the user is automatically redirected to /prices to choose a subscription plan.

Form fields

FieldRequiredNotes
emailYesDisplayed in the UI; used as the Stripe customer email.
nameNoAccepted by the form action and passed to Stripe, but not rendered as a visible input in the current UI.
The name field is included in the route action and forwarded to Stripe, but there is no corresponding input in the registration form UI. If you want to collect a display name from users, add a name input to the form.

Session storage

The session is backed by a signed cookie. The cookie stores a single key:
KeyValuePurpose
customerIdStripe customer ID (e.g. cus_...)Identifies the customer in all downstream Stripe API calls
If the session cookie is missing or expired when the user reaches /prices or /subscribe, the server will not have a customerId and the subscription flow will fail. Users must complete registration before proceeding.

What happens in Stripe

A new customer record is created in your Stripe account. You can view it in the Stripe Dashboard under Customers. The customer will have no payment method or subscription attached at this point — those are added during the payment step.

Next step

After registration, users are sent to the plan selection page to choose a subscription.

Build docs developers (and LLMs) love