Skip to main content
A ConfirmationToken lets you collect a card before you are ready to charge it. Blocks returns a ct_... ID and basic card details. Your server can then check the order, apply any price adjustments, and show the final total to the customer. When they accept, use that token ID to confirm the payment. The token identifies the card. The PaymentIntent sets the amount. Creating a token does not charge the card or place a hold. For example: a customer enters their card for a $100 order. Your server applies a $10 discount and shows the new $90 total. After acceptance, you create a PaymentIntent for 9000 cents and confirm it with the card already collected. This optional flow requires platform access enabled for your test or live mode. It supports one-time card payments with automatic capture. For payment without a separate review step, use the standard Blocks integration.

1. Set up the card fields

On your server, create the Blocks review session. Ionic-Account is the connected merchant that will receive the payment. Register your checkout origin as a platform payment domain.
Send the complete session response to your page. Add a mount target:
Mount Blocks with your platform publishable key and the same connected account:
You do not need a PaymentIntent yet. The session is for displaying the secure fields; it contains no card.

2. Collect the card and get its token ID

When the customer selects Review payment, call this with their billing details:
Send confirmationToken.id to your server. This is the Ionic ct_... ID you will use for payment. The underlying card token stays private; the card number and CVC are not returned to your page. No payment has happened yet. The fields stay mounted and stop accepting edits during review. To let the customer change the card, call blocks.resumeCollection(), then collect a new token and repeat the review.

3. Check the card and finalize the price

Retrieve the token on your server using the same platform, account, and test/live mode:
The response includes status, expires_at, and payment_method_preview.card. The card summary contains its brand, last four digits, funding type when known, and how that information was obtained. See the object reference for the full response. funding: "unknown" means the card type is unavailable; it does not mean the card was declined.
Server-verified funding is currently limited to supported test configurations. Live tokens may return unverified card-field data or unknown funding. This limitation concerns the funding information, not the token’s role in payment.
Calculate the final total on your server, including any changes to discounts, delivery, or other order items. In our example: Save the token ID, order version, final amount, currency, and expiry together on your server. This is your application’s review record, not an Ionic object. Show the total and ask the customer to accept it. If it changes, show the new total and get their acceptance again. Changing the price does not require a new token, as long as the card, billing details, account, currency, and mode are unchanged and the token is still ready and unexpired. The token contains no amount.

4. Create the payment at the final amount

After acceptance, check that the order is still unpaid, the review is current, and the token is ready and unexpired. Prevent concurrent payment attempts for the same order, including double-clicks or a second browser tab. Create a PaymentIntent for the accepted $90 total. Amounts are in minor units, so the request uses 9000:
This creates the payment record; it does not charge the card. Save the returned pi_... ID against the order before confirming. Reuse the creation key if you need to retry this exact request. Do not include confirmation_token on creation. Then confirm the intent with the same ct_... ID you retrieved in step 3:
The example IDs stand for the intent just created and the token from step 2. Confirmation attempts the $90 charge. Its response is a PaymentIntent; succeeded means payment succeeded, and processing means the result is still pending. See Confirm a payment intent for response examples. Verify the outcome before fulfilling the order. Keep the intent’s client secret on your server when the price depends on the reviewed card, so the browser cannot substitute another card at that price. For retries after a lost response, reuse the same intent, token, and confirmation key. See Blocks reference for the alternative browser confirmation call.
Confirm only an intent whose amount matches the newly accepted total. In this flow, create the intent after pricing is final. If an unused intent has the wrong amount, cancel or replace it under your order’s payment guard and save the replacement ID. Use a new creation key for a new create request.If confirmation has already started, check that payment’s outcome first. Do not create a replacement while the original result is unknown.

Save the card for future payments

The customer can agree to save the card while they enter it. The same payment then saves it to the customer, so you can charge it later, including when the customer is not present. Offer saving when you create the session:
Blocks then shows a save checkbox below the card fields. Creating the token locks the customer’s choice with the card; blocks.resumeCollection() unlocks both. To draw your own checkbox, create the Block with saveConsent: "external" and pass the customer’s choice:
When the customer agreed, the retrieved token has setup_future_usage: "off_session". Without their agreement the field is absent and the payment does not save the card. To save the card, create the PaymentIntent with the customer and the same setup_future_usage, then confirm with the token as in step 4:
The confirmation response adds saved_payment_method: the card the customer paid with, now saved to the customer. It is null when the payment succeeded but the card could not be saved.
If the token carries the customer’s agreement but the intent has no customer or setup_future_usage, confirmation returns 409 CONFIRMATION_TOKEN_SETUP_FUTURE_USAGE_MISMATCH before charging. Create a matching intent and confirm it with the same token. To charge the saved card later, see Save cards.

Token states and retries

A token lasts up to 10 minutes, capped by its field session’s remaining lifetime. The field session lasts 30 minutes. Once Ionic accepts the token for a payment attempt, it becomes consumed. Consumed means used, not paid. It stays consumed after a decline or an unknown result, and cannot start another attempt. Resuming preserves the fields while the session is usable; a page reload loses the entered card. Store order and payment IDs on your server so a reload can recover an existing payment. Access being turned off or a token expiring does not prevent authorized recovery of a payment already started. See the error reference for exact codes. This flow does not support wallets or merchant-initiated payments, or complete authentication challenges.