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

# Coupon

> Cupons de marketing ativos na vitrine.

Cupom **ativo** retornado pelo checkout marketing da loja.

## Disponível em

* ✅ `storefront.coupons.list()`
* ✅ `storefront.coupons.validate()` (action)
* ✅ `data: ['coupons']` em cart-details / header-pro

## Campos

| Campo | Tipo | Descrição |
| - | - | - |
| `id` | `string` | UUID |
| `name` | `string` | Nome exibido |
| `code` | `string` | Código para aplicar |
| `discountType` | `'PERCENT' \| 'CURRENCY'` | Tipo |
| `amount` | `number` | Valor (% ou R\$) |
| `totalAvailable` | `number` | `0` = ilimitado |
| `usedCount` | `number` | Usos já consumidos |
| `singleUsePerCustomer` | `boolean` | Uso único por CPF |
| `automaticApply` | `boolean` | Aplica automaticamente |
| `startAt` / `endAt` | `string \| null` | Vigência |

## Exemplo — listagem

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
const { nodes: coupons } = await storefront.coupons.list({ subtotal: cartSubtotal });

coupons.map((coupon) => (
  <button key={coupon.id} type="button">
    {coupon.code} — {coupon.amount}
    {coupon.discountType === 'PERCENT' ? '%' : ''}
  </button>
));
```

Veja [coupons.list](https://docs-loja.usecorvex.com.br/data/queries/coupons-list.md) e [coupons.validate](https://docs-loja.usecorvex.com.br/data/actions/coupon-validate.md).


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