Skip to main content
POST
/
tools
/
api
/
create-payment-reminder
cURL
curl --request POST \
  --url https://www.pierre.finance/tools/api/create-payment-reminder \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "<string>",
  "dueDate": "2023-12-25",
  "amount": 123,
  "reminderTime": "2023-11-07T05:31:56Z",
  "isRecurring": false,
  "recurrencePattern": "daily"
}
'
{
  "success": true,
  "data": {
    "id": "pr_123456789",
    "title": "Conta de luz",
    "amount": 150.00,
    "dueDate": "2024-12-15",
    "reminderTime": "2024-12-14T09:00:00Z",
    "status": "active",
    "isRecurring": false,
    "recurrencePattern": null,
    "createdAt": "2024-11-27T15:30:00Z",
    "updatedAt": "2024-11-27T15:30:00Z"
  },
  "message": "Payment reminder created successfully: Conta de luz",
  "timestamp": "2024-11-27T15:30:00Z"
}
Este endpoint cria um novo lembrete de pagamento com notificações via WhatsApp e Email.

Descrição

O endpoint POST /tools/api/create-payment-reminder permite criar lembretes de pagamento únicos ou recorrentes. Você receberá notificações automáticas via WhatsApp e Email nos horários configurados.

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

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

Body Parameters

title
string
required
Título do lembrete (ex: “Conta de luz”, “Aluguel”)
amount
number
Valor do pagamento em BRL (opcional)
dueDate
string
required
Data de vencimento no formato YYYY-MM-DD
reminderTime
string
Data/hora do lembrete em formato ISO 8601. Se não fornecido, será 1 dia antes do vencimento às 9h.
isRecurring
boolean
Se o lembrete é recorrente (padrão: false)
recurrencePattern
string
Padrão de recorrência: daily, weekly, monthly, ou yearly. Obrigatório se isRecurring=true.

Resposta

Sucesso (200)

{
  "success": true,
  "data": {
    "id": "pr_123456789",
    "title": "Conta de luz",
    "amount": 150.00,
    "dueDate": "2024-12-15",
    "reminderTime": "2024-12-14T09:00:00Z",
    "status": "active",
    "isRecurring": false,
    "recurrencePattern": null,
    "createdAt": "2024-11-27T15:30:00Z",
    "updatedAt": "2024-11-27T15:30:00Z"
  },
  "message": "Payment reminder created successfully: Conta de luz",
  "timestamp": "2024-11-27T15:30:00Z"
}

Erro de Validação (400)

{
  "error": "Invalid or missing title",
  "message": "Title must be a non-empty string"
}

Erro de Autenticação (401)

{
  "error": "Invalid or inactive API key",
  "message": "Please check your API key and try again",
  "type": "invalid_api_key"
}

Erro de Quota Excedida (403)

{
  "success": false,
  "error": "Quota exceeded",
  "message": "Limite de lembretes atingido. Você já tem 10 lembretes ativos e seu plano PRO permite até 10 lembretes."
}

Campos da Resposta

success
boolean
required
Indica se a requisição foi bem-sucedida
data
object
required
Objeto com os dados do lembrete criado
message
string
required
Mensagem de confirmação da criação
timestamp
string
required
Timestamp da requisição em formato ISO 8601

Exemplos de Uso

cURL

# Criar lembrete único
curl -X POST 'https://www.pierre.finance/tools/api/create-payment-reminder' \
  -H 'Authorization: Bearer sk-your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Conta de luz",
    "amount": 150.00,
    "dueDate": "2024-12-15"
  }'

# Criar lembrete recorrente mensal
curl -X POST 'https://www.pierre.finance/tools/api/create-payment-reminder' \
  -H 'Authorization: Bearer sk-your-api-key-here' \
  -H 'Content-Type: application/json' \
  -d '{
    "title": "Aluguel",
    "amount": 1500.00,
    "dueDate": "2024-12-05",
    "isRecurring": true,
    "recurrencePattern": "monthly"
  }'

JavaScript

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

async function createPaymentReminder(title, dueDate, amount = null, isRecurring = false, recurrencePattern = null) {
  const body = {
    title,
    dueDate,
    ...(amount && { amount }),
    ...(isRecurring && { isRecurring, recurrencePattern })
  };
  
  const response = await fetch(`${BASE_URL}/create-payment-reminder`, {
    method: 'POST',
    headers: {
      'Authorization': `Bearer ${API_KEY}`,
      'Content-Type': 'application/json'
    },
    body: JSON.stringify(body)
  });
  
  return await response.json();
}

// Exemplos de uso
createPaymentReminder('Conta de luz', '2024-12-15', 150);
createPaymentReminder('Aluguel', '2024-12-05', 1500, true, 'monthly');

Python

import requests
from datetime import datetime, timedelta

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 create_payment_reminder(title, due_date, amount=None, is_recurring=False, recurrence_pattern=None):
    data = {
        'title': title,
        'dueDate': due_date
    }
    
    if amount:
        data['amount'] = amount
    if is_recurring:
        data['isRecurring'] = is_recurring
        data['recurrencePattern'] = recurrence_pattern
    
    response = requests.post(f'{BASE_URL}/create-payment-reminder',
                           headers=headers, json=data)
    return response.json()

# Exemplos de uso
reminder = create_payment_reminder('Conta de luz', '2024-12-15', 150)
recurring = create_payment_reminder('Aluguel', '2024-12-05', 1500, True, 'monthly')

Códigos de Status

  • 200: Sucesso - Lembrete criado
  • 400: Parâmetros inválidos
  • 401: Erro de autenticação ou assinatura
  • 403: Quota excedida - limite de lembretes atingido
  • 500: Erro interno do servidor

Limites por Plano

  • BASIC: 5 lembretes ativos
  • PRO: 10 lembretes ativos
  • PREMIUM: 30 lembretes ativos

Recorrência

Os lembretes recorrentes são renovados automaticamente após a data de vencimento:
  • daily: Todos os dias no mesmo horário
  • weekly: Toda semana no mesmo dia da semana
  • monthly: Todo mês no mesmo dia do mês
  • yearly: Todo ano na mesma data
As notificações são enviadas via WhatsApp e Email no horário configurado. Se não especificado, o lembrete será enviado 1 dia antes do vencimento às 9h (horário de Brasília).
Para contas mensais fixas como aluguel, internet e outros serviços, use lembretes recorrentes para receber notificações automáticas todo mês.

Authorizations

Authorization
string
header
required

API key in Bearer token format. Example: Bearer sk-your-api-key-here

Body

application/json
title
string
required
dueDate
string<date>
required
amount
number
reminderTime
string<date-time>
isRecurring
boolean
default:false
recurrencePattern
enum<string>
Available options:
daily,
weekly,
monthly,
yearly

Response

Lembrete de pagamento criado com sucesso

success
boolean
Example:

true

data
object
message
string
Example:

"Payment reminder created successfully: Conta de luz"

timestamp
string<date-time>