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

# Atualizar presell

> Atualiza um presell da ação, incluindo troca de tipo

Atualização parcial: envie apenas os campos que deseja alterar. Aceita os mesmos campos do [criar presell](/api-reference/presells/criar-presell), todos opcionais.

<Warning>
  **Regras de tipo e configuração** (idênticas aos upsells):

  * Os objetos `custom`/`iframe` são **substituição total** — envie o objeto completo.
  * **Trocar o `type` exige a configuração do novo tipo na mesma requisição.** Mudar para `simple` exige o objeto `simple: { button_text, button_url }`.
  * Objeto de configuração que não corresponde ao tipo retorna `PRESELL_CONFIG_TYPE_MISMATCH`.
</Warning>

## Path params

<ParamField path="id" type="string" required>ID da ação (UUID).</ParamField>
<ParamField path="presell_id" type="string" required>ID do presell (UUID).</ParamField>

## Erros

| HTTP  | Código                     | Quando ocorre                                        |
| ----- | -------------------------- | ---------------------------------------------------- |
| `404` | `PRESELL_NOT_FOUND`        | Presell inexistente, de outra ação ou de outra conta |
| `400` | `NO_FIELDS_TO_UPDATE`      | Nenhum campo enviado                                 |
| `400` | demais códigos `PRESELL_*` | Mesmas regras de validação do criar                  |

<RequestExample>
  ```bash trocar para iframe theme={null}
  curl -u "pb_xxx:sk_xxx" -X PUT \
    -H "Content-Type: application/json" \
    -d '{
      "type": "iframe",
      "iframe": { "type": "fullscreen", "url": "https://presell.cliente.digital/" }
    }' \
    "https://api.sortify.com.br/v1/raffles/{id}/presells/{presell_id}"
  ```

  ```bash desativar theme={null}
  curl -u "pb_xxx:sk_xxx" -X PUT \
    -H "Content-Type: application/json" \
    -d '{ "is_active": false }' \
    "https://api.sortify.com.br/v1/raffles/{id}/presells/{presell_id}"
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "message": "Presell atualizado com sucesso",
    "data": {
      "id": "9e8d7c6b-5a4f-3e2d-1c0b-a9f8e7d6c5b4",
      "type": "iframe",
      "title": "Oferta parceira",
      "description": null,
      "display_order": 0,
      "iframe": { "type": "fullscreen", "url": "https://presell.cliente.digital/" },
      "is_active": true,
      "created_at": "2026-07-06T12:00:00.000Z",
      "updated_at": "2026-07-06T12:10:00.000Z"
    }
  }
  ```
</ResponseExample>
