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

# Checkouts

> Monitor checkout sessions and conversion in the moneydevkit dashboard

Checkouts are payment sessions created when customers initiate a purchase. The checkouts page gives you visibility into your checkout flow and helps identify where customers may be dropping off.

## What are Checkouts?

A checkout is created when a customer starts the payment process. Checkouts track the entire payment journey from initiation to completion (or abandonment).

## Checkouts Dashboard

The checkouts page in your [moneydevkit dashboard](https://moneydevkit.com/dashboard/checkouts) displays all checkout sessions with:

* **Checkout ID** - Unique identifier for the session
* **Status** - Current state of the checkout (pending, completed, expired)
* **Amount** - The checkout amount and currency
* **Created Date** - When the checkout was initiated
* **Customer** - Associated customer information (if provided)
* **Invoice** - Bitcoin invoice details

## Checkout Statuses

| Status        | Description                                  |
| ------------- | -------------------------------------------- |
| **Pending**   | Checkout created, awaiting payment           |
| **Completed** | Payment received and confirmed               |
| **Expired**   | Checkout expired before payment was received |

## Analyzing Your Checkout Flow

Checkouts help you understand:

* **Conversion rate** - Compare total checkouts to completed orders
* **Drop-off points** - Identify where customers abandon the payment process
* **Payment timing** - See how long customers take to complete payments

<Tip>
  High numbers of pending or expired checkouts may indicate friction in your checkout experience. Consider simplifying your checkout flow or providing clearer payment instructions.
</Tip>

## Creating Checkouts

Checkouts are created programmatically using the moneydevkit SDK:

```tsx theme={null}
import { useCheckout } from '@moneydevkit/nextjs'

const { createCheckout, isLoading } = useCheckout()

// Create a checkout
const result = await createCheckout({
  type: 'AMOUNT',
  title: 'Product Name',
  description: 'Product description',
  amount: 500, // Amount in cents (USD) or sats (SAT)
  currency: 'USD',
  successUrl: '/checkout/success',
  metadata: {
    orderId: 'order-123'
  }
})

if (result.error) {
  console.error(result.error.message)
  return
}

window.location.href = result.data.checkoutUrl
```

### Requiring Customer Information

Use `requireCustomerData` to collect customer information during checkout. The checkout will display a form for customers to enter the specified fields:

```tsx theme={null}
const result = await createCheckout({
  type: 'AMOUNT',
  title: 'Product Name',
  amount: 500,
  currency: 'USD',
  successUrl: '/checkout/success',
  requireCustomerData: ['email', 'name']
})
```

See the [Customers documentation](/dashboard/customers) for more details on collecting customer data.

See the [Replit integration guide](/replit) or [Next.js integration guide](/nextjs) for complete setup instructions.
