> ## 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.

# Checkout

> Get paid without building a payment page. Redirect to Ionic-hosted checkout, embed it on your site, or share it as a link.

Checkout gets you paid without building a payment page. Your server describes
the purchase, and Ionic hosts the payment page: the card form, Apple Pay, and
decline handling that lets the buyer try another card. Card details stay off
your servers, and one webhook tells you when to fulfill.

Hosted Checkout, embedded checkout, and payment links run the same hosted
payment page, and each creates a checkout session.

<CardGroup cols={3}>
  <Card title="Hosted Checkout" icon="arrow-up-right-from-square" href="/guides/checkout">
    Create a session from your server and redirect the buyer to its URL.
  </Card>

  <Card title="Embedded checkout" icon="window-maximize" href="/guides/embedded-checkout">
    Create the session in embedded mode and mount it inside your page, so
    buyers stay on your site.
  </Card>

  <Card title="Payment links" icon="link" href="/guides/payment-links">
    Publish a reusable URL that opens a fresh checkout for every buyer.
  </Card>
</CardGroup>

## When to use Checkout

| Situation | Use |
| - | - |
| Your app has a cart, order, or plan, and a redirect is acceptable | [Hosted Checkout](/guides/checkout) |
| Buyers should complete the purchase without leaving your website | [Embedded checkout](/guides/embedded-checkout) |
| A sales team, QR code, or campaign shares the same offer many times | [Payment links](/guides/payment-links) |
| Your platform takes a payment for a connected account | [Hosted checkout for connected accounts](/guides/connect-checkout) |
| You design the payment form and own the Pay button | [Ionic Blocks](/blocks/overview) |
| The buyer presents a card at the counter | [In-person payments](/in-person/overview) |

Start with Hosted Checkout. It is the smallest
integration, and embedded checkout uses the same session fields, webhooks, and
fulfillment when you want buyers to stay on your site.

## What you can do

| Capability | How it works |
| - | - |
| One-time payments | Create a session with `mode: "payment"` from inline line items or catalog prices. |
| Subscription signup | Create a session with `mode: "subscription"` from recurring catalog prices. Checkout collects the first payment and activates the subscription. |
| Add-ons and quantities | `optional_items` offers add-ons, and `adjustable_quantity` lets the buyer change a line item's count. |
| Buyer details | `collect_config` requires contact, billing, or shipping fields. Payment links also accept `custom_fields`. |
| Apple Pay | Offered on the hosted page and on payment links once Apple Pay is enabled on your account. |
| Google Pay | Offered on the hosted page and on payment links for one-time payments. |
| Known customers | Pass `customer` to link the session to an existing customer record. |
| Fulfillment | A verified `checkout.session.completed` event tells your server the payment completed. |

## Start here

<CardGroup cols={2}>
  <Card title="Quickstart" icon="play" href="/quickstart">
    Create a hosted checkout session and complete a test payment.
  </Card>

  <Card title="Accept a payment with Hosted Checkout" icon="shopping-cart" href="/guides/checkout">
    Create a session, redirect the buyer, and fulfill from the webhook.
  </Card>
</CardGroup>

## Availability

* Apple Pay is enabled per account. Hosted Checkout and payment links show it
  with no domain setup. Embedded checkout shows it after you register your
  domain and serve Apple's association file. See [Apple Pay](/guides/apple-pay).
* Google Pay appears on Hosted Checkout and payment links for one-time
  payments, with no domain setup. Google Pay requires payment processing that supports it; ask Ionic support to confirm it for your account. See [Google Pay](/guides/google-pay).
* Subscription mode uses recurring catalog prices that share one currency and
  billing cadence.
* Payment links use catalog prices. Create the products and prices first.
* To save a card without a purchase, use a SetupIntent with
  [Ionic Blocks](/guides/save-cards).

## Guides

| Guide | Use it to |
| - | - |
| [Quickstart](/quickstart) | Complete one hosted checkout payment end to end. |
| [Accept a payment with Hosted Checkout](/guides/checkout) | Create sessions, redirect buyers, and fulfill orders. |
| [Embedded checkout](/guides/embedded-checkout) | Register your domain and mount checkout on your page. |
| [Payment links](/guides/payment-links) | Create, update, activate, and deactivate reusable links. |
| [Apple Pay](/guides/apple-pay) | Offer Apple Pay on each checkout surface. |
| [Google Pay](/guides/google-pay) | Offer Google Pay on hosted checkout and payment links. |
| [Catalog](/guides/catalog) | Create the products and prices that checkout and links reference. |
| [Test cards](/guides/test-cards) | Simulate approvals and declines in test mode. |

Server code uses [`@ionicfi/sdk`](/sdks/server). Embedded checkout mounts with
[`@ionicfi/js`](/sdks/browser) or the React
[`<CheckoutEmbed>`](/sdks/react) component.

## API reference

| Resource | Endpoints |
| - | - |
| [Checkout sessions](/api-reference/checkout-sessions) | [Create](/api-reference/checkout-sessions/create-a-checkout-session), [list](/api-reference/checkout-sessions/list-checkout-sessions), [retrieve](/api-reference/checkout-sessions/retrieve-a-checkout-session), [confirm](/api-reference/checkout-sessions/confirm-a-checkout-session), [adjust a line item quantity](/api-reference/checkout-sessions/adjust-a-line-item-quantity), [select an optional item](/api-reference/checkout-sessions/select-an-optional-item), [deselect an optional item](/api-reference/checkout-sessions/deselect-an-optional-item) |
| [Payment links](/api-reference/payment-links) | [Create](/api-reference/payment-links/create-a-payment-link), [list](/api-reference/payment-links/list-payment-links), [retrieve](/api-reference/payment-links/retrieve-a-payment-link), [update](/api-reference/payment-links/update-a-payment-link), [deactivate](/api-reference/payment-links/deactivate-a-payment-link), [activate](/api-reference/payment-links/activate-a-payment-link) |
| [Products and prices](/api-reference/catalog) | [Create a product](/api-reference/products/create-a-product), [create a price](/api-reference/prices/create-a-price), and the rest of the [catalog endpoints](/api-reference/catalog) |
| Web domains | [Add](/api-reference/web-domains/add-a-web-domain), [list](/api-reference/web-domains/list-web-domains), [delete](/api-reference/web-domains/delete-a-web-domain), [register for Apple Pay](/api-reference/apple-pay-domains/register-a-domain-for-apple-pay) |

Ionic sends `checkout.session.created`, `checkout.session.completed`, and
`checkout.session.expired`. See their payloads in the
[event catalog](/webhooks/events#checkout-sessions).


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