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

# coupons.list

> Cupons de marketing ativos na vitrine.

# storefront.coupons.list(options)

Lista cupons **ativos** disponíveis para o cliente.

***

## Parâmetros

| Campo | Tipo | Descrição |
| - | - | - |
| `productIds` | `string[]` | IDs no carrinho (upsells/targeting) |
| `cep` | `string` | CEP do cliente |
| `state` | `string` | UF |
| `subtotal` | `number` | Subtotal do carrinho |

***

## Retorno

```ts theme={"theme":{"light":"github-light","dark":"github-dark"}}
Connection<Coupon>
```

***

## Exemplo

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
export const data = defineSectionData(async ({ storefront, cart }) => ({
  coupons: await storefront.coupons.list({
    subtotal: cart?.subtotalPrice ?? 0,
    productIds: cart?.items?.map((item) => item.productId),
  }),
}));
```

***

## Hook

```jsx theme={"theme":{"light":"github-light","dark":"github-dark"}}
const { data: coupons } = useCorvexData('coupons', { subtotal: 199.9 });
```

***

## Declaração schema.data

```js theme={"theme":{"light":"github-light","dark":"github-dark"}}
data: ['coupons']
```

Validação antes do checkout: [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.