Skip to main content

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:
{
  "customers": [
    {
      "customerId": "lorem-ipsum",
      "email": "[email protected]", // 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",
      },
    },
    // ...
  ],
}
  1. Initiate the bulk import process:
npx @stigg/bulk-import --customers-file customers.json

Using the API and SDKs

Use the importCustomerBulk endpoint.