<!-- canonical: https://docs.costplus.io/docs/guides/one-click-payments -->

> Enable customer-initiated one-click payments with card tokenization
One-click payments allow returning customers to pay with a single click using a previously stored card. This is a **Customer Initiated Transaction (CIT)** flow that uses tokenization.

## How It Works

The one-click flow has two phases:

1. **First payment** — The customer pays normally, and you request a token for future use
2. **Subsequent payments** — Use the stored token to charge the customer with one click

## Phase 1: First Payment (Tokenization)

Create an order with `one_click_type: "first"` in the transaction to request tokenization:

```json title="POST /v1/orders/"
{
  "merchant_order_id": "first-order",
  "currency": "EUR",
  "amount": 1295,
  "return_url": "https://www.example.com",
  "transactions": [
    {
      "payment_method": "credit-card",
      "one_click_type": "first"
    }
  ]
}
```

After a successful payment, the response will include a `vault_token` and `first_transaction_id` in the transaction object. **Store these values** — you'll need them for future one-click payments.

```json title="Response (transaction object)"
{
  "payment_method": "credit-card",
  "payment_method_details": {
    "vault_token": "abc123-stored-token",
    "first_authorised_transaction_id": "txn_def456"
  }
}
```

## Phase 2: One-Click Payment

Use the stored `vault_token` to create a one-click payment:

```json title="POST /v1/orders/"
{
  "merchant_order_id": "oneclick-order",
  "currency": "EUR",
  "amount": 995,
  "return_url": "https://www.example.com",
  "transactions": [
    {
      "payment_method": "credit-card",
      "one_click_type": "one-click",
      "vault_token": "{vault_token from phase 1}"
    }
  ]
}
```

> [!TIP]
> You can use either `vault_token` or `first_transaction_id` to reference the stored card. Both work interchangeably.

## CVC Handling

CVC is **optional** for one-click payments. If you want to collect CVC for additional security, include it in the transaction:

```json
{
  "payment_method": "credit-card",
  "one_click_type": "one-click",
  "vault_token": "{vault_token}",
  "cvc": "123"
}
```

> [!NOTE]
> One-click payments are customer-initiated (CIT). For merchant-initiated recurring charges (MIT), see [Recurring Payments](/docs/guides/recurring-payments).

## Related Endpoints

- [Create Order](/api-reference/orders/createOrder) — use `one_click_type` in the transaction to initiate tokenization or one-click payments
