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

# The ConfirmationToken object

> Card details and the token ID you use to confirm payment.

```json Verified credit card (illustrative) theme={null}
{
  "id": "ct_AAAAAAAAAAAAAAAAAAAAAAAA",
  "object": "confirmation_token",
  "status": "ready",
  "livemode": false,
  "currency": "usd",
  "expires_at": 1800000600,
  "payment_intent": null,
  "payment_method_preview": {
    "type": "card",
    "card": {
      "brand": "visa",
      "last4": "1111",
      "funding": "credit",
      "funding_evidence": "token_verified"
    }
  }
}
```

A ConfirmationToken is a temporary reference to a card collected with Blocks.
It lets you read the card's details and finish pricing the order before payment.
When the customer accepts the final total, create a PaymentIntent for that
amount and confirm it using the token's `ct_...` ID.

**The token supplies the card; the PaymentIntent supplies the amount.** Creating
or retrieving a token does not charge the card. Ionic generates the `ct_...` ID;
it is not the underlying card token or an API authentication key.

Create it with `ionic.createConfirmationToken({ blocks, billingDetails })`,
which returns `{ confirmationToken?, error? }`. Read it on your server with
[Retrieve a confirmation token](https://docs.ionicfi.com/api-reference/confirmation-tokens/retrieve-a-confirmation-token.md).
There is no public create, list, or delete endpoint. See the
[guide](https://docs.ionicfi.com/guides/confirmation-tokens.md) for the complete checkout example.

The example values are illustrative. Your platform needs access enabled for
the selected test/live mode, and calls must use the same connected merchant.

## Attributes

**id** `string`

The `ct_...` ID to send as `confirmation_token` when confirming a PaymentIntent. The ID does not contain readable card details.

**object** `string`

Always `confirmation_token`.

**status** `string`

Whether the token can still start a payment. `ready` means unused, `consumed` means assigned to one attempt, `invalidated` means canceled by resuming card editing, and `expired` means it was not used in time. A consumed token does not tell you whether the payment succeeded.

**livemode** `boolean`

`false` for a test token; `true` for a live token. The PaymentIntent must use the same mode.

**currency** `string`

The currency selected when creating the card-field session: `usd`, `eur`, or `gbp`. The PaymentIntent must use this currency.

**expires\_at** `integer`

The last time this unused token can start a payment, as Unix seconds. Tokens last up to 10 minutes and cannot outlive their field session. You can still check a payment already started after this time. An unexpired token does not guarantee the card will be approved.

**payment\_intent** `string | null`

The `pi_...` ID of the PaymentIntent this token was used to confirm, or `null` if it has not been used. The ID remains set if the payment is pending, declines, or fails. Check the PaymentIntent's status for the payment outcome.

**payment\_method\_preview** `object`

The card summary returned to your application: `type: "card"` and a `card` object. It excludes the card number, CVC, underlying card token, BIN, and billing details.

**payment\_method\_preview\.card.brand** `string`

The card brand, such as `visa` or `mastercard`. `unknown` means the brand is unavailable.

**payment\_method\_preview\.card.last4** `string`

The final four card digits. Omitted when unavailable.

**payment\_method\_preview\.card.funding** `string`

The card type: `credit`, `debit`, `prepaid`, or `unknown`. Unknown means the type could not be determined, not that the card was declined.

**payment\_method\_preview\.card.funding\_evidence** `string`

How Ionic obtained the card data. `token_verified`: checked against the tokenized card. `tokenization_callback`: reported by the card fields without an independent check. `unavailable`: no usable card data was available. Read this together with `funding`.

**setup\_future\_usage** `string`

`off_session` when the buyer agreed to save the card for future payments. Omitted otherwise. To save it, confirm with a PaymentIntent that has a `customer` and `setup_future_usage: "off_session"`; the same sale saves the card and the confirmation returns `saved_payment_method`. Only a session created with `setup_future_usage: "off_session"` can ask the buyer.

## Read the funding fields together

| `funding` | `funding_evidence` | Meaning |
| - | - | - |
| `credit` | `token_verified` | The lookup identified a credit card. |
| `credit` | `tokenization_callback` | The fields reported credit; Ionic has not independently verified that result. |
| `unknown` | `token_verified` | The lookup found the card but did not identify its funding type. |
| `unknown` | `unavailable` | No usable card data was available to determine the funding type. |

These examples describe card data, not payment approval. Unknown funding does
not prevent an otherwise valid token from being used for payment.

Server-side funding verification is currently limited to supported test
configurations. Live tokens may contain unverified card-field data or unknown
funding. The [retrieve endpoint](https://docs.ionicfi.com/api-reference/confirmation-tokens/retrieve-a-confirmation-token.md)
includes both a verified-credit example and an unknown-data example.

## Confirm

Once your server has finalized the price and the customer has accepted it,
create a PaymentIntent for that amount with `capture_method: "automatic"`.
Then send the same token ID you reviewed to
`POST /v1/payment_intents/{id}/confirm`:

```json theme={null}
{ "confirmation_token": "ct_AAAAAAAAAAAAAAAAAAAAAAAA" }
```

Use your platform secret key, the matching `Ionic-Account`, `payments:write`,
and an `Idempotency-Key` that you reuse for retries. Send the token on confirmation,
not on PaymentIntent creation. It supplies the card to charge; the intent
supplies the amount and currency. Changing the price before payment does not
require a new token if its card, billing details, account, currency, and mode
are unchanged and it is still ready and unexpired.

Do not include another card token, a saved payment method, new billing details,
card-saving options, a mandate, or wallet fields. This flow supports one-time,
customer-initiated card payments only. Ionic rejects incompatible inputs.

Ionic assigns the token to one PaymentIntent and attempt before sending the
charge. Its status becomes `consumed` even if the card later declines. Retrying
with the same token recovers that attempt; a different request key does not
make the token reusable. Your server must also stop two different tokens from
paying the same order.

## Errors and retries

Read `error.code` and the original payment's status to decide what to do.
Authentication, rate-limit, and idempotency errors also apply as usual.

| HTTP | Code | What to do |
| - | - | - |
| `400` | `INVALID_REQUEST` | Check the token ID and remove incompatible payment inputs. |
| `403` | `FORBIDDEN` | Check the platform key, connected-account permissions, test/live mode, and feature access. |
| `404` | `CONFIRMATION_TOKEN_NOT_FOUND` | Check the ID and use the same platform, connected account, and mode that created it. |
| `409` | `CONFIRMATION_TOKEN_CONSUMED` | Check or recover the payment already associated with this token. Do not use it for a new attempt. |
| `409` | `CONFIRMATION_TOKEN_EXPIRED` | Create a new token and ask the customer to accept a new review before another attempt. |
| `409` | `CONFIRMATION_TOKEN_SETUP_FUTURE_USAGE_MISMATCH` | The buyer agreed to save the card. Create the PaymentIntent with a `customer` and `setup_future_usage: "off_session"`, then confirm with the same token. |
| `409` | `CONFIRMATION_TOKEN_CONFLICT` | Check the existing token and payment. The request may refer to a token canceled by editing or may conflict with its original use. |
| `409` | `CONFIRMATION_TOKEN_CONFIGURATION_CHANGED` | After resolving any payment already started, create a new token using a current session. |
| `503` | `CONFIRMATION_TOKENS_UNAVAILABLE` | Keep the same token, intent, and request key. Retry or check the existing payment's result. |

For example, confirming an unused token after its deadline returns `409`:

```json theme={null}
{
  "error": {
    "code": "CONFIRMATION_TOKEN_EXPIRED",
    "message": "preparation has expired"
  }
}
```

A definitive `402 PAYMENT_DECLINED` includes the current PaymentIntent and
leaves the token consumed. A `402 PAYMENT_FAILED`, timeout, or uncertain Charge
requires checking the original payment before another attempt. HTTP status
alone does not tell you whether it is safe to try another card.
See [editing and recovery](https://docs.ionicfi.com/guides/confirmation-tokens.md#token-states-and-retries).


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