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

# Criar Oferta

> Cria uma oferta no produto: única (um preço) ou recorrente (assinatura com régua de preços). Devolve o checkout_url pronto.

A oferta é o que o cliente compra. Ela nasce com um `checkout_url` pronto para compartilhar. Uma oferta é de um dos dois tipos:

* **`one_time`**: cobrança única. Só precisa de `name` e `amount`.
* **`recurring`**: assinatura. Precisa de `interval` e da **régua de ciclos** (`cycles`).

<ParamField path="id" type="string" required>
  O `id` (uuid) do produto que recebe a oferta.
</ParamField>

## Parâmetros da Requisição

<ParamField body="type" type="string" required>
  Tipo da oferta. **Valores:** `one_time`, `recurring`.
</ParamField>

<ParamField body="name" type="string" required>
  Nome da oferta (ex.: "Mensal", "Anual", "Vitalício"). **Máximo:** 80 caracteres.
</ParamField>

<ParamField body="amount" type="integer">
  Valor em centavos. **Obrigatório para `one_time`.** Mínimo: `100` (R\$ 1,00).

  **Exemplo:** `39900` = R\$ 399,00
</ParamField>

<ParamField body="interval" type="string">
  Cadência da assinatura. **Obrigatório para `recurring`.**

  **Valores:** `monthly`, `quarterly`, `half-yearly`, `yearly`.
</ParamField>

<ParamField body="trial_days" type="integer">
  Dias de teste grátis antes da primeira cobrança. **Mínimo:** `1` | **Máximo:** `365`.
</ParamField>

<ParamField body="cycles" type="array">
  A **régua de preços**. **Obrigatória para `recurring`.** Uma lista de faixas, de 1 a 50, contígua a partir do ciclo 1.

  <Expandable title="Faixa de ciclo">
    <ParamField body="cycles[].start" type="integer" required>
      Primeiro ciclo da faixa (mínimo `1`).
    </ParamField>

    <ParamField body="cycles[].end" type="integer">
      Último ciclo da faixa. `null` na **última** faixa significa "em diante".
    </ParamField>

    <ParamField body="cycles[].amount" type="integer" required>
      Valor cobrado nessa faixa, em centavos (mínimo `0`).
    </ParamField>
  </Expandable>
</ParamField>

<Warning>
  A régua tem que ser uma escada válida, senão a resposta é **422**:

  * começa no **ciclo 1**;
  * é **contígua** (cada faixa começa em `end + 1` da anterior);
  * **não se sobrepõe**, e cada faixa tem `start <= end`;
  * só a **última** faixa pode ter `end: null`.
</Warning>

## Resposta

<ResponseField name="id" type="string">UUID da oferta.</ResponseField>
<ResponseField name="hash" type="string">Hash público da oferta (base do `checkout_url`).</ResponseField>
<ResponseField name="type" type="string">`one_time` ou `recurring`.</ResponseField>
<ResponseField name="name" type="string">Nome da oferta.</ResponseField>
<ResponseField name="is_active" type="boolean">Se a oferta está ativa (ver [arquivar/restaurar](/api-reference/products/manage-offer)).</ResponseField>
<ResponseField name="amount" type="integer">O preço em centavos. Em `recurring`, é a **faixa estável** (a última da régua), útil para exibir "a partir de".</ResponseField>
<ResponseField name="currency" type="string">Sempre `BRL`.</ResponseField>
<ResponseField name="interval" type="string">A cadência, em `recurring`; `null` em `one_time`.</ResponseField>
<ResponseField name="trial_days" type="integer">Dias de teste.</ResponseField>
<ResponseField name="cycles" type="array">A régua devolvida faixa a faixa (vazia em `one_time`). `end: null` na última = "em diante".</ResponseField>
<ResponseField name="checkout_url" type="string">O link pronto de checkout. `/s/{hash}` para `recurring`, `/c/{hash}` para `one_time`.</ResponseField>

<RequestExample>
  ```bash cURL - Recorrente com régua theme={null}
  curl -X POST https://pay.autorizou.dev/api/v1/products/51655469-5e1c-4356-bf9a-d593a7d61a0a/offers \
    -H "Authorization: Bearer 4eC39HqLyjWDarjtT1zdp7dc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "recurring",
      "name": "Mensal Progressivo",
      "interval": "monthly",
      "trial_days": 7,
      "cycles": [
        { "start": 1, "end": 3, "amount": 10000 },
        { "start": 4, "end": null, "amount": 12000 }
      ]
    }'
  ```

  ```bash cURL - Única theme={null}
  curl -X POST https://pay.autorizou.dev/api/v1/products/51655469-5e1c-4356-bf9a-d593a7d61a0a/offers \
    -H "Authorization: Bearer 4eC39HqLyjWDarjtT1zdp7dc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "one_time",
      "name": "Vitalício",
      "amount": 39900
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 201 Created theme={null}
  {
    "id": "b9af7796-ac98-47f2-b921-46b0415d7473",
    "hash": "AUTOFRTNRV0QX5OYK8V6N5K4IZ",
    "type": "recurring",
    "name": "Mensal Progressivo",
    "is_active": true,
    "amount": 12000,
    "currency": "BRL",
    "interval": "monthly",
    "trial_days": 7,
    "cycles": [
      { "start": 1, "end": 3, "amount": 10000 },
      { "start": 4, "end": null, "amount": 12000 }
    ],
    "checkout_url": "https://pay.autorizou.app/s/AUTOFRTNRV0QX5OYK8V6N5K4IZ",
    "created_at": "2026-07-20T03:16:38.000000Z"
  }
  ```

  ```json 422 - Régua inválida theme={null}
  {
    "message": "Os dados fornecidos são inválidos",
    "errors": {
      "cycles": ["A régua precisa começar no ciclo 1."],
      "cycles.1.start": ["As faixas precisam ser contíguas, sem buraco."]
    }
  }
  ```
</ResponseExample>

## E agora?

O `checkout_url` já funciona: compartilhe e receba. Para vender **por API** (você já tem cliente e cartão), use o `id` da oferta como `offer_id` em [`POST /charges/subscriptions`](/api-reference/subscriptions/create-subscription).
