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

# Importing customers

## Using the CLI

1. Create a file named `customers.json` containing all customers you plan to import into the target environment. The file must follow this schema:

<CodeGroup>
  ```json JSON theme={null}
  {
    "customers": [
      {
        "customerId": "lorem-ipsum",
        "email": "john@example.com", // optional
        "name": "Lorem-ipsum", // optional
        "billingId": "cus_MvdQq1bVD1BQHe", // optional - if an existing customer in Stripe
        "paymentMethodId": "pm_1N04AHEdaKWoSZ0OgP78RflV", // required for paid customers
        "updatedAt": "2022-01-01T00:00:00.000Z", // optional - indicates the last update of the customer. In case there's already existing customer that was updated after that date, it will skip import this customer
        "metadata": { // optional - set metadata for the customer
          "isTest": "true",
        },
      },
      // ...
    ],
  }
  ```
</CodeGroup>

2. Initiate the bulk import process:

<CodeGroup>
  ```shell shell theme={null}
  npx @stigg/bulk-import --customers-file customers.json
  ```
</CodeGroup>

### Using the API and SDKs

Use the `importCustomerBulk` endpoint.

<Note>
  The `importCustomerBulk` endpoint supports up to **1,000 customers per request** and has a rate limit of **250 requests per minute**.
</Note>
