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

# Update a Setup Intent

> Atualiza um setup intent.

Atualiza campos mutáveis de um `setup_intent`. Use esta chamada para definir ou
trocar o `payment_method` antes da confirmação, ou para atualizar `metadata`.

<ParamField path="id" type="string" required>
  ID do setup intent (`seti_*`).
</ParamField>

<ParamField body="customer" type="string">
  Customer que receberá o método salvo. Não pode ser alterado após estados
  terminais.
</ParamField>

<ParamField body="payment_method" type="string | null">
  Payment method salvo (`pm_*`) a preparar. Envie `null` para remover o método
  pendente e voltar para `requires_payment_method`.
</ParamField>

<ParamField body="metadata" type="object">
  Metadata livre. Envie `{}` para limpar.
</ParamField>

<RequestExample>
  ```bash cURL theme={}
  curl -X POST "https://api.chargefy.io/v1/setup-intents/seti_123" \
    -H "Authorization: Bearer {{API_KEY}}" \
    -H "Content-Type: application/json" \
    -d '{
      "metadata": {
        "order_id": "6735"
      },
      "payment_method": "pm_123"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={}
  {
    "id": "seti_123",
    "object": "setup_intent",
    "canceled_at": null,
    "cancellation_reason": null,
    "client_secret": "seti_123_secret_abc",
    "created_at": "2026-05-16T18:30:00Z",
    "customer": "cus_123",
    "last_setup_error": null,
    "livemode": true,
    "metadata": {
      "order_id": "6735"
    },
    "next_action": null,
    "payment_method": "pm_123",
    "payment_method_types": [
      "credit_card"
    ],
    "status": "requires_confirmation",
    "updated_at": "2026-05-16T18:31:00Z",
    "usage": "off_session"
  }
  ```
</ResponseExample>
