# Open a SetupIntent so the customer can save a payment method

`POST /api/v1/customers/{id}/setup-intent`

Returns a single-use client secret for Stripe Elements. The card is stored only once the setup_intent.succeeded webhook is processed — do not treat a 201 here as a saved card.

Needs the `customers:write` scope, or a full-access key.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | required |  |

## Headers

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `Idempotency-Key` | string | optional | A unique value for this operation, chosen by you. A retry with the same key and the same body returns the first response instead of running again. The same key with a different body answers 409 `idempotency_key_reused`; a key whose first request is still running answers 409 `idempotency_in_progress`. |

## Responses

### 201

SetupIntent opened.

JSON Schema:

```json
{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "properties": {
        "client_secret": {
          "type": [
            "string",
            "null"
          ],
          "description": "Bearer credential for this intent. Never log it."
        },
        "setup_intent_id": {
          "type": "string"
        },
        "publishable_key": {
          "type": [
            "string",
            "null"
          ]
        }
      },
      "required": [
        "client_secret",
        "setup_intent_id",
        "publishable_key"
      ]
    },
    "_agent": {
      "type": "object",
      "properties": {
        "summary": {
          "type": "string"
        },
        "status": {
          "type": "string",
          "enum": [
            "ok"
          ]
        },
        "next_actions": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "warnings": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      },
      "required": [
        "summary",
        "status",
        "next_actions",
        "warnings"
      ]
    },
    "api_version": {
      "type": "string",
      "example": "2026-07-01"
    }
  },
  "required": [
    "data",
    "_agent",
    "api_version"
  ]
}
```
