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

# Save a Payment Method

Vaultera Switch supports multiple ways to save a customer's payment method, especially useful for recurring or future payments:

* **On-session payments (COF-CIT)**
* **Off-session payments (MIT)**

***

## ✅ Save for Future On-Session Payments (COF-CIT)

This is used when the **customer is present during the transaction** and can authenticate the payment (e.g., enter CVV or perform 3DS). This is common in **card-on-file, customer-initiated transactions**.

### ➤ How to Save:

1. **Include in `/payments` create request:**

```json theme={"system"}
"setup_future_usage": "on_session"
```

2. **Include customer consent in `/payments/:id/confirm` request:**

```json theme={"system"}
"customer_acceptance": {
  "acceptance_type": "online",
  "accepted_at": "1963-05-03T04:07:52.723Z",
  "online": {
    "ip_address": "127.0.0.1",
    "user_agent": "Mozilla/5.0"
  }
}
```

3. **If using Vaultera Switch SDK:**

   * Consent is sent automatically based on the **"Save Card"** checkbox.
   * Enable via `displaySavedPaymentMethodsCheckbox` property.

***

## 💾 Save for Future Off-Session Payments (MIT)

This is used when the **customer is not present** (off-session) during payment. Common in subscription or invoice scenarios.

### ➤ How to Save:

1. **Include in `/payments` create request:**

```json theme={"system"}
"setup_future_usage": "off_session"
```

2. **Include customer consent in `/payments/:id/confirm`:**

```json theme={"system"}
"customer_acceptance": {
  "acceptance_type": "online",
  "accepted_at": "1963-05-03T04:07:52.723Z",
  "online": {
    "ip_address": "127.0.0.1",
    "user_agent": "Mozilla/5.0"
  }
}
```

3. **Retrieve and store the `payment_method_id`:**

```bash theme={"system"}
curl --location 'https://api.test.switch.vaultera.co/payments/{payment_id}' \
--header 'Accept: application/json' \
--header 'api-key: <your-api-key>'
```

***

## 💸 Use a Saved Payment Method for MIT

To charge a customer later using a previously saved payment method:

### ➤ In `/payments` create request:

```json theme={"system"}
"off_session": true,
"recurring_details": {
  "type": "payment_method_id",
  "data": "pm_lmTnIO5EdCiiMgRPrV9x"
}
```

> Use the `payment_method_id` retrieved from the previous successful save.

***

## 📋 List Saved Payment Methods

```bash theme={"system"}
curl --request GET \
  --url https://api.test.switch.vaultera.co/customers/{customer_id}/payment_methods \
  --header 'api-key: <your-api-key>'
```

***

## 🔓 Process MIT Payments Without Saving

If you're **PCI-compliant** and already have the customer's card details:

### ➤ Use the card + network transaction ID:

```json theme={"system"}
"off_session": true,
"recurring_details": {
  "type": "network_transaction_id_and_card_details",
  "data": {
    "card_number": "4242424242424242",
    "card_exp_month": "10",
    "card_exp_year": "25",
    "card_holder_name": "Joseph Doe",
    "network_transaction_id": "MCC5ZRGMI0925"
  }
}
```

### ➤ Use routing with supported connectors:

```json theme={"system"}
"routing": {
  "type": "single",
  "data": {
    "connector": "cybersource",
    "merchant_connector_id": "mca_VRmwU23zUmlmgAPrJ8rF"
  }
}
```

> Currently supported by **Stripe**, **Adyen**, and **Cybersource**.
> For additional connector support, submit a feature request.

***

## ❓ FAQ

### Q: How can I vault a payment method without charging the customer?

You can use **Zero Amount Authorization** to authenticate and store a card without charging it. Ideal for onboarding flows.

> 🔗 Refer to [Zero Amount Authorization](#) for implementation details.
