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

# Checkout por Listing

> Crea checkout sessions para Listings y Variants.

Si vendes productos o servicios creados en Onflay, usa `listingId` y opcionalmente `variantId`.

## Listing simple

```ts theme={"dark"}
const session = await onflay.checkoutSessions.create(
  {
    listingId: 'lst_...',
    customerEmail: 'comprador@ejemplo.com',
    successUrl: 'https://tu-app.com/gracias',
    cancelUrl: 'https://tu-app.com/cancelado',
  },
  { idempotencyKey: 'checkout:lst_123:buyer_456' }
);
```

## Variante

```ts theme={"dark"}
const session = await onflay.checkoutSessions.create({
  listingId: 'lst_...',
  variantId: 'var_...',
  customerEmail: 'comprador@ejemplo.com',
  successUrl: 'https://tu-app.com/gracias',
  cancelUrl: 'https://tu-app.com/cancelado',
});
```

## Cuándo usar `variantId`

* Básico / Pro / Premium;
* archivo individual / bundle completo;
* sesión de 30 min / 60 min;
* entrada general / VIP;
* diferentes entregables o duraciones.

<Note>
  La disponibilidad y los campos requeridos dependen del tipo de listing y de cómo esté configurado en Onflay.
</Note>
