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

# Creating Customers

> Learn how to create customers using our API.

If you have [custom products](/custom-products) that you need to assign to customers that don't exist in Stripe, you'll need to create those customers manually using our API.

<Note>There is no need to create customers that already exist in Stripe customers, but you will need to [link them with your own internal ID](/linking-stripe-customers).</Note>

***

## Create a customer

You can create a customer with just a customer ID.

<CodeGroup>
  ```ts TypeScript theme={null}
  const customer = await priceos.customers.create({
    customerId: "customer_123", // Your own internal customer/user ID
  });
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.priceos.com/v1/customers" \
    -H "x-api-key: PRICEOS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "customerId": "customer_123"
    }'
  ```
</CodeGroup>

<Tip>Customers will also be created anytime you try to [evaluate feature access](/api-reference/endpoint/feature-access) or [track usage](/api-reference/endpoint/usage) with a new customer ID.</Tip>

***

## Create a customer with name and email

<CodeGroup>
  ```ts TypeScript theme={null}
  const customer = await priceos.customers.create({
    customerId: "customer_123",
    name: "Alex Johnson",
    email: "alex@acme.com",
  });
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.priceos.com/v1/customers" \
    -H "x-api-key: PRICEOS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "customerId": "customer_123",
      "name": "Alex Johnson",
      "email": "alex@acme.com"
    }'
  ```
</CodeGroup>

<Tip>You can update the customer at any time using [update customer](/api-reference/endpoint/update).</Tip>

***

## Create a customer with usage start date

The `usageStartedAt` is only needed if you have a limit feature that resets based on billing period and you use PriceOS to track usage for it.

In that case, the `usageStartedAt` is the anchor we use to determine when usage will be reset for this user.

<CodeGroup>
  ```ts TypeScript theme={null}
  const customer = await priceos.customers.create({
    customerId: "customer_123",
    usageStartedAt: Date.parse("2024-01-01T00:00:00.000Z"),
  });
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.priceos.com/v1/customers" \
    -H "x-api-key: PRICEOS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "customerId": "customer_123",
      "usageStartedAt": 1704067200000
    }'
  ```
</CodeGroup>

<Note>If no `usageStartedAt` is provided, we'll just use the date the customer was created in our system.</Note>

***

## Create a customer and assign custom products

<CodeGroup>
  ```ts TypeScript theme={null}
  const customer = await priceos.customers.create({
    customerId: "customer_123",
    customProductKeys: ["custom_basic", "custom_addon"],
  });
  ```

  ```bash cURL theme={null}
  curl -X POST "https://api.priceos.com/v1/customers" \
    -H "x-api-key: PRICEOS_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "customerId": "customer_123",
      "customProductKeys": ["custom_basic", "custom_addon"]
    }'
  ```
</CodeGroup>

<Tip>
  To [remove custom products](/managing-customers#remove-custom-products) update the customer with the remaining `customProductKeys` (or an empty list).
</Tip>

<Warning>
  [Stripe products](/stripe-products) and [default products](/custom-products#default-custom-products) cannot be manually assigned.
</Warning>
