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

# DiscountRange

> Faixas de desconto progressivo ativas na loja.

Representa uma **faixa de desconto ativa** (por valor ou quantidade do carrinho).

## Disponível em

* ✅ `storefront.discountRanges.list()`
* ✅ `data: ['discount_ranges']` em sections de header/carrinho

## Campos

| Campo | Tipo | Descrição |
| - | - | - |
| `id` | `string` | UUID |
| `name` | `string` | Nome da campanha |
| `ruleType` | `'CART_VALUE' \| 'QUANTITY'` | Regra de aplicação |
| `appliesToAllProducts` | `boolean` | Vale para todo o catálogo |
| `applyDiscountTo` | `string` | Ex.: `ENTIRE_CART` |
| `priority` | `number` | Ordem de aplicação |
| `startAt` / `endAt` | `string \| null` | Vigência |
| `productIds` | `string[]` | Produtos elegíveis |
| `tiers` | `DiscountRangeTier[]` | Degraus do desconto |

## DiscountRangeTier

| Campo | Descrição |
| - | - |
| `minValue` / `maxValue` | Faixa de valor (R\$) |
| `minQuantity` / `maxQuantity` | Faixa de quantidade |
| `discountType` | `PERCENT` ou `CURRENCY` |
| `discountAmount` | Valor do desconto |
| `position` | Ordem do tier |

`storefront.discountRanges.list()` não envia filtro. A rota devolve as faixas que o backend considerar ativas. O retorno é `Connection`.

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

discount_ranges.map((range) => (
  <div key={range.id}>
    <strong>{range.name}</strong>
    {range.tiers.map((tier) => (
      <span key={tier.position}>
        {tier.discountAmount}
        {tier.discountType === 'PERCENT' ? '%' : ''}
      </span>
    ))}
  </div>
));
```

Veja [discountRanges.list](https://docs-loja.usecorvex.com.br/data/queries/discount-ranges-list.md).


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