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

# Delete Payment Reminder

> Exclui ou cancela um lembrete de pagamento. Por padrão realiza exclusão lógica (marca como inactive), mas pode fazer exclusão permanente com hardDelete=true. O usuário só pode excluir seus próprios lembretes. Requer API key para autenticação e assinatura ativa.

> [!NOTE]
>
> Este endpoint exclui ou cancela um lembrete de pagamento.

## Descrição

O endpoint `DELETE /tools/api/delete-payment-reminder` permite excluir lembretes de pagamento. Por padrão, realiza exclusão lógica (marca como inactive), mas pode fazer exclusão permanente com o parâmetro `hardDelete=true`. O usuário só pode excluir seus próprios lembretes.

## Autenticação

Este endpoint requer autenticação via Bearer token.

**Authorization** `string` *required*

Bearer token com a API key do usuário. Formato: `Bearer sk-your-api-key-here`

## Parâmetros de Query

**reminderId** `string` *required*

ID do lembrete a ser excluído

**hardDelete** `boolean` *required*

Se deve fazer exclusão permanente (true) ou apenas cancelar (false, padrão)

**s** `string` *required*

Parâmetro interno para indicar requisições via MCP. Use `s=s` para requisições MCP.

## Resposta

### Sucesso (200)

```json Success - Soft Delete theme={null}
{
  "success": true,
  "data": {
    "id": "pr_123456789",
    "title": "Conta de luz",
    "action": "cancelled",
    "hardDelete": false
  },
  "message": "Payment reminder \"Conta de luz\" cancelled successfully",
  "timestamp": "2024-11-27T16:30:00Z"
}
```

```json Success - Hard Delete theme={null}
{
  "success": true,
  "data": {
    "id": "pr_123456789",
    "title": "Conta de luz",
    "action": "deleted permanently",
    "hardDelete": true
  },
  "message": "Payment reminder \"Conta de luz\" deleted permanently successfully",
  "timestamp": "2024-11-27T16:30:00Z"
}
```

### Erro de Validação (400)

```json Error theme={null}
{
  "error": "Invalid or missing reminderId",
  "message": "reminderId must be provided as a query parameter"
}
```

### Erro de Autenticação (401)

```json Error theme={null}
{
  "error": "Invalid or inactive API key",
  "message": "Please check your API key and try again",
  "type": "invalid_api_key"
}
```

### Erro de Acesso (403)

```json Error theme={null}
{
  "error": "Permission denied",
  "message": "You do not have permission to delete this reminder"
}
```

### Lembrete Não Encontrado (404)

```json Error theme={null}
{
  "error": "Reminder not found",
  "message": "No reminder found with ID: pr_123456789"
}
```

## Campos da Resposta

**success** `boolean` *required*

Indica se a requisição foi bem-sucedida

**data** `object` *required*

Objeto com informações do lembrete excluído

**Deleted Reminder Data**

**id** `string` *required*

Identificador único do lembrete excluído

**title** `string` *required*

Título do lembrete excluído

**action** `string` *required*

Tipo de ação realizada: `cancelled` ou `deleted permanently`

**hardDelete** `boolean` *required*

Se foi uma exclusão permanente (true) ou cancelamento (false)

**message** `string` *required*

Mensagem de confirmação da exclusão/cancelamento

**timestamp** `string` *required*

Timestamp da requisição em formato ISO 8601

## Exemplos de Uso

### cURL

```bash theme={null}
# Cancelar lembrete (soft delete)
curl -X DELETE 'https://www.pierre.finance/tools/api/delete-payment-reminder?reminderId=pr_123456789' \
  -H 'Authorization: Bearer sk-your-api-key-here'

# Excluir permanentemente (hard delete)
curl -X DELETE 'https://www.pierre.finance/tools/api/delete-payment-reminder?reminderId=pr_123456789&hardDelete=true' \
  -H 'Authorization: Bearer sk-your-api-key-here'
```

### JavaScript

```javascript theme={null}
const API_KEY = 'sk-your-api-key-here';
const BASE_URL = 'https://www.pierre.finance/tools/api';

async function deletePaymentReminder(reminderId, hardDelete = false) {
  const params = new URLSearchParams({ reminderId });
  if (hardDelete) {
    params.append('hardDelete', 'true');
  }
  
  const response = await fetch(`${BASE_URL}/delete-payment-reminder?${params}`, {
    method: 'DELETE',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    }
  });
  
  return await response.json();
}

// Exemplos de uso
deletePaymentReminder('pr_123456789'); // Cancelar (soft delete)
deletePaymentReminder('pr_123456789', true); // Excluir permanentemente
```

### Python

```python theme={null}
import requests

API_KEY = 'sk-your-api-key-here'
BASE_URL = 'https://www.pierre.finance/tools/api'

headers = {
    'Authorization': f'Bearer {API_KEY}',
    'Content-Type': 'application/json'
}

def delete_payment_reminder(reminder_id, hard_delete=False):
    params = {'reminderId': reminder_id}
    if hard_delete:
        params['hardDelete'] = 'true'
    
    response = requests.delete(f'{BASE_URL}/delete-payment-reminder',
                              headers=headers, params=params)
    return response.json()

# Exemplos de uso
delete_payment_reminder('pr_123456789')  # Cancelar
delete_payment_reminder('pr_123456789', hard_delete=True)  # Excluir permanentemente
```

## Códigos de Status

* `200`: Sucesso - Lembrete excluído/cancelado
* `400`: Parâmetros inválidos
* `401`: Erro de autenticação ou assinatura
* `403`: Acesso negado - lembrete pertence a outro usuário
* `404`: Lembrete não encontrado
* `500`: Erro interno do servidor

## Diferença entre Soft Delete e Hard Delete

### Soft Delete (Padrão)

* Marca o lembrete como `inactive`
* Dados são preservados no banco de dados
* Pode ser reativado posteriormente
* Não envia mais notificações
* Libera cota do plano

### Hard Delete

* Exclui permanentemente o lembrete
* Dados são removidos do banco de dados
* **Não pode ser desfeito**
* Libera cota do plano

> [!WARNING]
>
> A exclusão permanente (hardDelete=true) **não pode ser desfeita**. Use com cautela! Para a maioria dos casos, recomendamos usar o soft delete (padrão) ou atualizar o status para `inactive`.

> [!TIP]
>
> Se você quiser apenas pausar um lembrete temporariamente sem excluí-lo, use o endpoint `update-payment-reminder` com `newStatus: 'inactive'` ao invés de excluir.

> [!NOTE]
>
> Lembretes cancelados (soft delete) não contam para o limite de quota do plano, assim como lembretes com hard delete.


## OpenAPI

````yaml DELETE /tools/api/delete-payment-reminder
openapi: 3.1.0
info:
  title: Pierre Finance API
  description: >-
    API para acessar dados financeiros do Pierre Finance, incluindo contas,
    transações, parcelas e sincronização.
  version: v1.0.0
servers:
  - url: https://www.pierre.finance
security: []
tags:
  - name: Authentication
    description: API key management and authentication
  - name: Accounts
    description: Financial accounts management
  - name: Transactions
    description: Financial transactions
  - name: Installments
    description: Credit card installments and purchases
  - name: Bills
    description: Credit card bills and current bill summaries
  - name: Balance
    description: Account balance information
  - name: Closing Dates
    description: Credit card closing date management
  - name: Sync
    description: Account synchronization
  - name: Spending Limits
    description: Personal spending limits and alerts management
  - name: Payment Reminders
    description: Payment reminders management with WhatsApp and Email notifications
  - name: Analytics
    description: Financial analytics and insights
  - name: Memories
    description: User memory management for personalized AI interactions
  - name: Open Finance
    description: Open Finance connection and integration
paths:
  /tools/api/delete-payment-reminder:
    delete:
      tags:
        - Payment Reminders
      description: >-
        Exclui ou cancela um lembrete de pagamento. Por padrão realiza exclusão
        lógica (marca como inactive), mas pode fazer exclusão permanente com
        hardDelete=true. O usuário só pode excluir seus próprios lembretes.
        Requer API key para autenticação e assinatura ativa.
      operationId: deletePaymentReminder
      parameters:
        - name: reminderId
          in: query
          description: ID do lembrete de pagamento a ser excluído
          required: true
          schema:
            type: string
        - name: hardDelete
          in: query
          description: >-
            Se deve fazer exclusão permanente (true) ou apenas cancelar (false,
            padrão)
          required: false
          schema:
            type: boolean
            default: false
      responses:
        '200':
          description: Lembrete de pagamento excluído/cancelado com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  data:
                    type: object
                    properties:
                      id:
                        type: string
                      title:
                        type: string
                      action:
                        type: string
                        example: deleted permanently
                      hardDelete:
                        type: boolean
                  message:
                    type: string
                    example: >-
                      Payment reminder "Conta de luz" deleted permanently
                      successfully
                  timestamp:
                    type: string
                    format: date-time
        '400':
          description: Parâmetros inválidos
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Invalid or missing reminderId
                  message:
                    type: string
        '401':
          $ref: '#/components/responses/AuthError'
        '403':
          description: Acesso negado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Permission denied
                  message:
                    type: string
                    example: You do not have permission to delete this reminder
        '404':
          description: Lembrete não encontrado
          content:
            application/json:
              schema:
                type: object
                properties:
                  error:
                    type: string
                    example: Reminder not found
                  message:
                    type: string
        '500':
          $ref: '#/components/responses/ServerError'
      security:
        - BearerAuth: []
components:
  responses:
    AuthError:
      description: Authentication or subscription error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/AuthError'
    ServerError:
      description: Internal server error
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ServerError'
  schemas:
    AuthError: {}
    ServerError: {}
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: string
      description: 'API key in Bearer token format. Example: Bearer sk-your-api-key-here'

````

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