> ## 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.

# Sign up customer

> Create a customer and subscribe them to a plan version.

Use `customers.signUp` to create a customer and provision their subscription, entitlements, billing
periods, and wallet from a published plan version.

<Frame>
  <img src="https://mintcdn.com/unprice/gxnfpu0DNH7T2Sdl/images/signup-flow.png?fit=max&auto=format&n=gxnfpu0DNH7T2Sdl&q=85&s=b05382b87a90dcb67c3ceb81a925ea8a" width="766" height="469" data-path="images/signup-flow.png" />
</Frame>

<RequestExample>
  ```ts theme={null}
  // Subscribe to the latest published version of the Pro plan.
  const { result, error } = await unprice.customers.signUp({
    name: "Acme Inc.",
    email: "buyer@example.com",
    planSlug: "pro",
    externalId: "acct_123",
    successUrl: "https://example.com/dashboard",
    cancelUrl: "https://example.com/login"
  });

  if (error) {
    // handle potential network or bad request error
    // a link to our docs will be in the `error.docs` field
    console.error(error.message);
    return;
  }

  console.log(result);
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "url": "https://example.com/dashboard",
    "customerId": "cus_1234567890"
  }
  ```
</ResponseExample>

## Request

<ParamField body="name" type="string" required>
  The name of the customer
</ParamField>

<ParamField body="email" type="string" required>
  The email of the customer
</ParamField>

<ParamField body="timezone" type="string">
  The timezone of the customer. If not provided, the system will use the project timezone
</ParamField>

<ParamField body="defaultCurrency" type="string">
  The default currency of the customer. If not provided, the system will use the project currency. Must be one of: "USD" or "EUR"
</ParamField>

<ParamField body="billingInterval" type="string">
  The billing interval for the customer's subscription. If plan version is provided, this will match the plan version. If plan slug is provided, this will be the default billing interval of the plan. Must be one of: "month", "year", "day", "minute", or "onetime"
</ParamField>

<ParamField body="planSlug" type="string">
  The plan slug to sign up for. If provided, Unprice uses the latest published version for that slug. Required if planVersionId is not provided
</ParamField>

<ParamField body="planVersionId" type="string">
  The specific plan version ID to sign up for. Required if planSlug is not provided
</ParamField>

<ParamField body="config" type="array">
  Configuration for subscription items. Required for quantity-based features when customer needs to set them. Leave empty to use plan defaults
</ParamField>

<ParamField body="config[].featurePlanId" type="string" required>
  The feature plan ID of the item
</ParamField>

<ParamField body="config[].featureSlug" type="string" required>
  The feature slug of the item
</ParamField>

<ParamField body="config[].isUsage" type="boolean">
  Whether the item is a usage-based feature
</ParamField>

<ParamField body="config[].units" type="number">
  The number of units the customer is subscribed to
</ParamField>

<ParamField body="config[].min" type="number">
  The minimum number of units for the feature
</ParamField>

<ParamField body="config[].limit" type="number">
  The maximum number of units for the feature
</ParamField>

<ParamField body="creditLinePolicy" type="string">
  Usage credit policy for the initial subscription phase. Use "uncapped" for postpaid usage, or "capped" to require a finite usage allowance.
</ParamField>

<ParamField body="creditLineAmountMinor" type="number">
  Optional capped usage credit amount in the currency's smallest unit, such as cents for USD/EUR. For example, pass 10000 for a 100.00 allowance.
</ParamField>

<ParamField body="externalId" type="string">
  An external ID to associate with the customer, such as an account ID from your database
</ParamField>

<ParamField body="successUrl" type="string" required>
  The URL to redirect to after successful signup (typically your dashboard)
</ParamField>

<ParamField body="cancelUrl" type="string" required>
  The URL to redirect to if the customer cancels signup (typically your login page)
</ParamField>

## Response

<ResponseField name="success" type="boolean" required>
  Whether the signup was successful
</ResponseField>

<ResponseField name="url" type="string" required>
  The URL to redirect the customer to (either success or cancel URL)
</ResponseField>

<ResponseField name="customerId" type="string" required>
  The Unprice customer ID generated for this customer
</ResponseField>
