> ## Documentation Index
> Fetch the complete documentation index at: https://docs.unprice.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# First customer

> Subscribe one customer to a published plan version.

Create or map one customer before you enforce a paid action. The customer is the economic actor in
Unprice: subscriptions, entitlements, budgets, wallets, usage, and invoices are tied to this ID.

## When to use `customers.signUp`

Use `customers.signUp` when Unprice should provision the customer money path from a plan version:

* customer record
* subscription and active phase
* entitlements from the published plan version
* billing periods
* wallet and initial credit policy when configured
* checkout redirect when the plan needs payment-provider setup

## Install the SDK

<CodeGroup>
  ```bash npm theme={null}
  npm install @unprice/api
  ```

  ```bash pnpm theme={null}
  pnpm add @unprice/api
  ```
</CodeGroup>

```ts theme={null}
import { Unprice } from "@unprice/api";

const unprice = new Unprice({
  token: process.env.UNPRICE_TOKEN
});
```

## Sign up the customer

```ts theme={null}
const { result, error } = await unprice.customers.signUp({
  name: "Acme Inc.",
  email: "buyer@example.com",
  planSlug: "pro",
  externalId: "acct_123",
  successUrl: "https://yourapp.com/billing/success",
  cancelUrl: "https://yourapp.com/billing/cancel"
});

if (error) {
  throw new Error(error.message);
}

await db.accounts.update({
  where: { id: "acct_123" },
  data: {
    unpriceCustomerId: result.customerId
  }
});
```

Use `planSlug` to sign up for the latest published version of a plan, or `planVersionId` to pin the
customer to a specific published version.

<Frame caption="Customer signup flow">
  <img src="https://mintcdn.com/unprice/gxnfpu0DNH7T2Sdl/images/signup-flow.png?fit=max&auto=format&n=gxnfpu0DNH7T2Sdl&q=85&s=b05382b87a90dcb67c3ceb81a925ea8a" alt="Your app calls Unprice signUp, Unprice validates data, redirects to a payment provider when needed, then returns the Unprice customer ID." width="766" height="469" data-path="images/signup-flow.png" />
</Frame>

## After signup

Use the returned `customerId` in runtime calls:

```ts theme={null}
const { result, error } = await unprice.access.check({
  customerId: account.unpriceCustomerId,
  featureSlug: "ai-generations"
});
```

## Next steps

<CardGroup cols={2}>
  <Card title="One paid action" icon="bolt-lightning" href="/quickstart/onboarding-plan">
    Put the first paid action on the money path.
  </Card>

  <Card title="Customer signup SDK" icon="user-plus" href="/libraries/ts/sdk/customers/signup">
    See the full `customers.signUp` request and response shape.
  </Card>
</CardGroup>
