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

# Gerenciar Oferta

> Edita uma oferta (inclusive reescreve a régua de preços), arquiva e restaura. Reescrever a régua nunca reprecifica quem já assina.

Depois de criada, a oferta é gerenciada por `id`. Você edita o nome, o valor (única) ou a régua inteira (recorrente), e liga/desliga a oferta com arquivar/restaurar.

<ParamField path="id" type="string" required>
  O `id` (uuid) da oferta.
</ParamField>

## Editar

`PUT /v1/product-offers/{id}`

<ParamField body="name" type="string">
  Novo nome. **Máximo:** 80 caracteres.
</ParamField>

<ParamField body="amount" type="integer">
  Novo valor em centavos (ofertas `one_time`). Mínimo `100`.
</ParamField>

<ParamField body="interval" type="string">
  Nova cadência (ofertas `recurring`): `monthly`, `quarterly`, `half-yearly`, `yearly`.
</ParamField>

<ParamField body="trial_days" type="integer">
  Dias de teste (`1` a `365`).
</ParamField>

<ParamField body="cycles" type="array">
  A régua nova, inteira (ofertas `recurring`). Segue as mesmas regras da [criação](/api-reference/products/create-offer): começa no ciclo 1, contígua, só a última aberta.
</ParamField>

<Info>
  Reescrever a régua é seguro: a régua **congela na assinatura** de cada cliente no momento em que ele assinou. Editar a oferta muda apenas quem assinar dali para frente. **Ninguém é reprecificado.**
</Info>

## Arquivar e restaurar

Arquivar desliga a oferta: o `checkout_url` dela para de aceitar novas compras, mas as ofertas irmãs do produto seguem vivas, e quem já assinou **não é afetado**.

| Método | Rota                              | Efeito                      |
| ------ | --------------------------------- | --------------------------- |
| `POST` | `/v1/product-offers/{id}/archive` | `is_active` vira `false`.   |
| `POST` | `/v1/product-offers/{id}/restore` | `is_active` volta a `true`. |

## Resposta

As três rotas devolvem a oferta atualizada, no mesmo formato de [Criar Oferta](/api-reference/products/create-offer) (com `cycles` e `checkout_url`).

<RequestExample>
  ```bash cURL - Reescrever a régua theme={null}
  curl -X PUT https://pay.autorizou.dev/api/v1/product-offers/b9af7796-ac98-47f2-b921-46b0415d7473 \
    -H "Authorization: Bearer 4eC39HqLyjWDarjtT1zdp7dc" \
    -H "Content-Type: application/json" \
    -d '{
      "name": "Mensal Progressivo",
      "cycles": [
        { "start": 1, "end": 6, "amount": 9900 },
        { "start": 7, "end": null, "amount": 12900 }
      ]
    }'
  ```

  ```bash cURL - Arquivar theme={null}
  curl -X POST https://pay.autorizou.dev/api/v1/product-offers/b9af7796-ac98-47f2-b921-46b0415d7473/archive \
    -H "Authorization: Bearer 4eC39HqLyjWDarjtT1zdp7dc"
  ```
</RequestExample>

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

<Note>
  Posse por construção: uma oferta de outro lojista **não resolve** (devolve `404`), mesmo com um `id` válido.
</Note>
