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

# Send imported rows to Stripe

> Create Stripe customers, products, prices and other objects from each row of an import by connecting a Stripe secret key and mapping columns to API fields.

The Stripe destination sends each row of an import to a Stripe API endpoint that you choose, such as creating a customer or a product. CSVbox loads the list of endpoints from Stripe's published API specification and lets you map your sheet columns to the fields each endpoint expects.

It works like the [OpenAPI](https://help.csvbox.io/destinations/openapi.md) destination, with Stripe's specification and authentication already set up.

## Before you start

You need a Stripe API key: a secret key (`sk_test_...` or `sk_live_...`) or a restricted key (`rk_...`). Find it in the Stripe Dashboard under **Developers > API keys**.

> [!TIP]
>
> Use a **restricted key** that only allows what the import needs. CSVbox checks the key by reading your Stripe account, so give the key **read** access to account information, plus **write** access to the resources you'll create, for example Customers or Products.

The key's mode decides where data goes. A test-mode key creates objects in your Stripe test environment; a live-mode key creates real objects. Test with a test-mode key first.

## Set up the destination

**1. Select Stripe as the destination**

Open your importer, go to the **Destination** tab and choose **Stripe**.

**2. Enter and test your key**

Paste your key into **Stripe Secret Key** and click **Test Connection**. A green check means Stripe accepted the key.

You can't save the destination until the test succeeds. If you change the key, test it again.

**3. Choose the endpoint**

When the key is entered, CSVbox loads Stripe's endpoints. Choose one under **Stripe API Endpoint**, for example `POST /v1/customers`. Only endpoints that create or update data (`POST`) are listed. Click **Reload Specification** to load the list again.

**4. Map columns**

Click **Map Columns**. For each sheet column and virtual column, choose the Stripe field it fills, or leave it as **(empty)**. Required fields are listed first and marked with `*`. Columns whose names match a Stripe field are mapped for you.

Click **Save** in the dialog.

**5. Save**

Save the destination. Every required field of the endpoint must be mapped.

## How rows are sent

* CSVbox sends **one request per row**, one row at a time.
* Nested Stripe fields are listed with dot and bracket notation, for example `address.city` or `metadata.order_id`, so you can map a column to each.
* Values are converted to the type Stripe expects. For true/false fields, `true`, `1`, `yes` and `on` mean true, and `false`, `0`, `no` and `off` mean false. For list fields, separate values with commas.
* Requests that Stripe rate-limits or that fail because of a temporary error are retried up to 3 times.

> [!WARNING]
>
> Importing the same file again sends the rows again. For endpoints that create objects, this creates duplicates in Stripe.

## Results and errors

When every row succeeds, the import is marked **Success**. If some rows fail, it's **Partial**; if none succeed, it's **Failed**.

Open the import on the [Imports](https://help.csvbox.io/dashboard-settings/imports.md) page and click the row count to see the error log. Each failed row shows its row number and Stripe's response, for example `HTTP 400: {"error": {...}}`.

### Setup messages

| Message | What to do |
| - | - |
| `Invalid Stripe Secret Key. Please check your key and try again.` | Check that you copied the whole key, and that it hasn't been deleted or rolled. |
| `Access denied. Please check your Stripe API key permissions.` | The restricted key can't read your account. Give it read access to account information. |
| `Please test your Stripe Secret Key before saving.` | Click **Test Connection** and wait for the green check. |
| `Please select a Stripe API endpoint before saving.` | Choose an endpoint under **Stripe API Endpoint**. |
| `Required fields not mapped: ...` | Map the listed Stripe fields in **Map Columns**. |
| `Unable to reach Stripe. Please check your network connection and try again.` | Try again in a moment. |

## Using environment variables

The key can use a `{{variable}}` placeholder filled from the importer's [environment variables](https://help.csvbox.io/advanced-installation/environment-variables.md), for example to use a different Stripe account per customer.

> [!NOTE]
>
> The key is stored encrypted. Copying an importer copies its Stripe destination, including the key.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.