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

# Checkout session

> The resource that connects the customer to the payment and loads the available methods.

A **checkout session** connects the customer to the payment, stores the charge details, and loads the available methods (today **PIX**; card coming soon). You create a session for each charge when you use the **hosted checkout** or the **Checkout SDK**.

<Note>
  Server-to-server integrations that use **PIX directly via the API** can skip the session and create the transaction directly.
</Note>

## What the session contains

You define the charge when creating the session:

| Field                           | Description                                                                                                    |
| ------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| `amountCents`                   | Amount charged, always in cents. It is the final charge amount.                                                |
| `paymentMethods`                | Methods shown to the buyer. Today `['pix']` (the default); `credit_card` will be added when the card launches. |
| `items`                         | Display metadata for the order — does not change the amount charged.                                           |
| `successUrl`                    | Where the buyer returns after paying.                                                                          |
| `webhookUrl` / `webhookVersion` | Endpoint that receives the signed confirmation.                                                                |

In response, Bob returns the `checkoutToken`, the `checkoutUrl`, and — if you sent `webhookUrl` — the `webhookSecret` to verify signatures. **The secret appears only in this response**; store it.

## Lifecycle

<Steps>
  <Step title="Created">
    The session is born with status `PENDING` and a `checkoutUrl` ready for the buyer.
  </Step>

  <Step title="In payment">
    The buyer chooses a method and completes the payment through the `checkoutUrl` or the SDK.
  </Step>

  <Step title="Completed or expired">
    On payment, the session generates a **transaction** and triggers the webhook. The session link lasts 24h by default (`expiresAt`) — the PIX generated within it follows the expiration configured in the project.
  </Step>
</Steps>

## Session and transaction

The **session** is the resource that presents the payment to the buyer; the **transaction** is the record of what happened. A paid session results in a transaction with the final outcome (`paid`, `expired`, …).

## Next steps

<CardGroup cols={2}>
  <Card title="Create checkout session" icon="code" href="/en/pages/checkout/create">
    All creation fields, with an interactive playground.
  </Card>

  <Card title="Hosted checkout" icon="cart-shopping" href="/en/pages/checkout/overview">
    The complete end-to-end flow.
  </Card>

  <Card title="Transactions" icon="arrow-right-arrow-left" href="/en/pages/concepts/transactions">
    The resource that records each payment attempt.
  </Card>

  <Card title="Check session status" icon="magnifying-glass" href="/en/pages/checkout/status">
    Poll the session state as a complement to the webhook.
  </Card>
</CardGroup>
