Logo van Skill Cobranca Automatizada Saas Abacatepay

Skill Cobranca Automatizada Saas Abacatepay

Organisatie
IAPro-Community
skill-cobranca-automatizada-saas-abacatepay

Automatische SaaS-factureringsengine met AbacatePay (PIX + creditcard), configureerbaar incassobeheer (regua de cobranca), proefperiodebeheer, factuurportaal, meldingen via e-mail (Resend) en WhatsApp (Evolution API), CRUD voor beheerders en factureringsstatistieken. Bestrijkt de volledige factureringscyclus, van provisioning tot incasso.

Add to TypingMind

Overzicht

UitgeverIAPro-Community
RepositoryOrquestrador-Maestro
Skillnaamskill-cobranca-automatizada-saas-abacatepay
Sterren
63
Forks
11
Meegeleverde bestanden
5
LicentieApache-2.0
Links
  • Instructies in Markdown

    Het model laadt het bestand SKILL.md alleen als dat nodig is. Dat kost dus alleen tokens als een verzoek daadwerkelijk bij de skill past.

  • Werkt met elk LLM

    AI-skills bestaan uit instructies in gewone Markdown, niet uit aanbiederspecifieke code. Daardoor werken ze met GPT, Claude, Gemini, Grok of een lokaal model.

  • Meegeleverde bestanden: 5

    Scripts, sjablonen en referentiemateriaal die het model tijdens het werken kan lezen. De bestanden kunnen alleen worden gelezen en worden nooit uitgevoerd.

  • Open source

    Gepubliceerd door IAPro-Community op GitHub. Bekijk de bronbestanden voordat je de skill installeert.

Installatie

Installeer de AI-skill Skill Cobranca Automatizada Saas Abacatepay in TypingMind om deze met elk LLM te gebruiken, of voeg de skill toe aan een andere agent die SKILL.md kan lezen.

1

Installeren in TypingMind

TypingMind installeert een skill rechtstreeks vanuit de GitHub-map. De app leest SKILL.md, bundelt de bijbehorende bestanden en slaat het resultaat lokaal op.

  1. Open de app en ga naar Plug-ins → Skills.
  2. Kies "Installeren via GitHub".
  3. Plak de onderstaande URL van de skillmap en bevestig.
    https://github.com/IAPro-Community/Orquestrador-Maestro/tree/v1/codex/skills/skill-cobranca-automatizada-saas-abacatepay
  4. Schakel de skill in voor elke chat waarin je de skill wilt kunnen gebruiken.
Plug-ins → Skills → Skill toevoegen → Via GitHub-URL. Plak vervolgens de map-URL en druk op Doorgaan.
2

Installeren in een andere agent

Elke agent die het Agent Skills-formaat kan lezen, kan deze skill gebruiken — kopieer de map naar de skillmap van die agent.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/IAPro-Community/Orquestrador-Maestro.git /tmp/Orquestrador-Maestro
mkdir -p .claude/skills
cp -r /tmp/Orquestrador-Maestro/codex/skills/skill-cobranca-automatizada-saas-abacatepay .claude/skills/skill-cobranca-automatizada-saas-abacatepay
Start Claude Code na het kopiëren opnieuw op, zodat de nieuwe skill wordt herkend.

Gebruik deze skill in TypingMind

Schakel Skill Cobranca Automatizada Saas Abacatepay in voor een chat naar keuze in TypingMind en het model doet de rest. De naam en beschrijving staan in de systeemprompt. Zodra een verzoek bij de skill past, laadt het model zelf de volledige instructies. Je hoeft de skill nooit handmatig aan te roepen. Pas als het model de skill daadwerkelijk gebruikt, kost dat tokens.

Het model laadt Skill Cobranca Automatizada Saas Abacatepay automatisch zodra een verzoek erbij past.

Werkt met elk AI-model

AI-skills zijn gewone Markdown-instructies in plaats van aanbiederspecifieke code. Daardoor is Skill Cobranca Automatizada Saas Abacatepay niet gebonden aan het model waarvoor de skill is geschreven. Installeer de skill één keer in TypingMind en gebruik deze met GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama of een lokaal model dat je zelf draait — allemaal met je eigen API-sleutels.

  • Alleen geladen wanneer nodig

    De systeemprompt bevat alleen de naam en beschrijving. De instructies worden bij het eerste bijpassende verzoek opgehaald, dus een ongebruikte skill kost niets.

  • Wissel van model tijdens een chat

    Omdat de skill uit instructies bestaat en niet uit code, blijft deze werken als je van model wisselt — het volgende model leest hetzelfde SKILL.md-bestand.

Skillinstructies

Dit is de inhoud van SKILL.md die het model laadt. Lees deze vóór de installatie — een skill bestaat uit instructies die je model zal volgen.

skill-cobranca-automatizada-saas-abacatepay

When To Use

This skill covers the complete automated billing system ("cobranca automatizada") for Brazilian SaaS products using AbacatePay. Use when implementing or maintaining:

=== Provisioning ===

  • Billing configuration tables (cobrancas, cobranca_reguas, billing_config, etc.)
  • Dunning rule sequencing (cobranca_regua_eventos)
  • Encrypted integration configs (Resend, Evolution API, AbacatePay)

=== Billing Engine ===

  • Automated invoice generation and dunning execution via cron
  • AbacatePay billing creation (PIX + CARD)
  • Webhook processing with HMAC-SHA256 verification
  • Invoice state machine (pending, paid, overdue, cancelled, refunded)
  • Subscription/plan integration via cobranca_tracking

=== Trial Management ===

  • Configurable trial duration
  • Pre-expiration notifications (7/3/1 days before)
  • Automatic trial expiration and account blocking

=== Interfaces ===

  • Public invoice page (FaturaPage) with PIX QR Code, payment link, polling
  • Pricing/Plans page with AbacatePay checkout
  • User-side invoice listing (MinhasCobrancasSection)
  • Admin billing management (cobranças CRUD, planos CRUD, global settings)
  • Plan Manager (PlanManager) for user plan changes

=== Notifications ===

  • Email via Resend with HTML templates (logo, badge, invoice details)
  • WhatsApp via Evolution API with template variables
  • Variables: {{nome}}, {{plano}}, {{valor}}, {{vencimento}}, {{link_pagamento}}, {{empresa_nome}}
  • Dunning sequence: configurable events with days_apos_vencimento, channel (email/whatsapp/ambos)

Architecture

                     +-------------------+
                     |   Cron (8/12/16h  |
                     |   BRT + 5min)     |
                     +--------+----------+
                              |
         +--------------------+--------------------+
         |                    |                    |
   Processar            Trial               Metrics
   Cobranças          Notificações          (meia-noite)
         |                    |
   +-----v------+      +-----v------+
   | Ver regua   |      | Trial exp. |
   | Send notif  |      | Notif pre  |
   | Create bill |      +------------+
   +-----+------+
         |
   +-----v------------------------------------------+
   |           Controller Layer                      |
   |  cobrancas.ts | abacatepay-webhook.ts           |
   |  fatura.ts    | trial.ts                        |
   +-----+----------------------------+--------------+
         |                            |
   +-----v----------+        +--------v---------+
   |  AbacatePay    |        |  Notifications    |
   |  API v2        |        |  Resend + Evol.  |
   +----------------+        +------------------+
         |
   +-----v----------+
   |  Supabase/     |
   |  PostgreSQL    |
   +----------------+

Billing State Machine

pending ──► paid ──► refunded
  │
  ├──► overdue ──► paid
  │             └──► cancelled
  │
  └──► cancelled

States managed by invoice-state-machine.ts:

  • pending: cobrança criada, aguardando pagamento
  • paid: paga, released_at setado, conteúdo liberado
  • overdue: vencida, entra na régua de cobrança
  • cancelled: cancelada manualmente ou por expiração
  • refunded: estornada (transição exclusiva de paid)

Key Tables

TablePurpose
cobrancasCore billing records per user
cobranca_reguasDunning rule sets per tenant
cobranca_regua_eventosIndividual dunning events in sequence
billing_configEncrypted integration configs (Resend, Evolution, AbacatePay)
front_usersUser profiles with plan and status
partner_billing_configPartner-specific billing overrides
cobranca_trackingSubscription-like recurring billing tracking
transaction_logBilling operation audit log
abacatepay_eventsRaw webhook event storage

Full details in billing-tables.md.

Core Flows

Dunning Flow (Régua de Cobrança)

  1. Cron runs billing-cron.ts at 8h/12h/16h BRT
  2. Queries cobrancas WHERE status = 'overdue' AND NOT paga
  3. For each cobranca, resolves billing_config + cobranca_regua + cobranca_regua_eventos
  4. Checks if next evento should fire (based on dias_apos_vencimento)
  5. Sends notification via billing-sender.ts (email + WhatsApp)
  6. If all eventos fired and still overdue, marks as cancelled

Webhook Flow

  1. POST /api/abacatepay-webhook receives an AbacatePay v2 event
  2. HMAC-SHA256 signature verification (replay + timing-safe compare)
  3. Rate limited: 100 req/min per IP
  4. On checkout.completed or subscription.renewed: processPaymentWithTransaction updates cobranca + cobranca_tracking
  5. On failure: processRollback reverts state
  6. Raw event stored in abacatepay_events

Trial Flow

  1. trial-cron.ts runs every 5 minutes
  2. Queries users where trial ends within notification window
  3. Sends pre-expiration notifications (7/3/1 day before)
  4. On expiration: blocks account (status = blocked)
  5. billing-cron.ts also handles trial notifications at 8/12/16h

Invoice Portal Flow

  1. FaturaPage loads by shortlink (8 chars, unique)
  2. Materializes billing from AbacatePay API on demand
  3. Shows: PIX QR Code, payment link, due date, amount, status badge
  4. Polls status every 5 seconds
  5. "Share via WhatsApp" button with pre-formatted message

Configuration

billing_config stores encrypted credentials per owner (AES-256-GCM):

  • resend_config: Resend API key + from email
  • evolution_config: Evolution API URL + API key + instance
  • abacatepay_config: AbacatePay API key
  • trial_duration_days: Trial length (default)
  • Encryption key: BILLING_CONFIG_ENCRYPTION_KEY env var

See billing-config.md for full schema and setup.

Provider API Boundary

  • AbacatePay: new code uses API v2 and the webhook events checkout.completed, checkout.refunded, checkout.disputed, subscription.completed, subscription.renewed, and subscription.cancelled. The legacy v1 billing.* events belong behind a migration adapter.
  • Resend: keep the key server-side and send through the official SDK or POST https://api.resend.com/emails with Authorization: Bearer <key> and a User-Agent; use Idempotency-Key for retryable sends, record provider request IDs, and redact message content from logs.
  • Evolution API: use the deployed v2 documentation and apikey header; keep instance credentials server-side and account for v2.4.0 activation/licensing before diagnosing business-endpoint failures.

Guardrails

  1. Keep ALL payment provider secrets server-side. Never expose AbacatePay API keys in browser bundles.
  2. Process webhooks idempotently: check cobranca current state before mutating.
  3. Treat checkout redirect as advisory. Grant access only after webhook confirmation.
  4. Do not log API keys, webhook secrets, full CPF/CNPJ, full phone numbers.
  5. Cron must not overlap. billing-cron uses lock checks to prevent concurrent runs.
  6. Dunning notifications must respect channel preference (email, whatsapp, or ambos).
  7. Trial expiration is irreversible: set status = blocked, do not auto-unblock without payment.
  8. Metrics queries (MRR, faturamento) should use aggregateBillingMetrics(), not ad-hoc SQL.
  9. New integrations must use https://api.abacatepay.com/v2, /checkouts/create, /subscriptions/create, and /transparents/create as appropriate. Keep /v1/billing/* and billing.* only inside an explicit legacy adapter.

Local Reference (example-saas)

This skill is extracted from the example-saas SaaS billing system. The production codebase is at:

  • {{USER_HOME}}/Documents/Code/example-saas/server/controllers/cobrancas.ts — billing CRUD + processing + dunning
  • {{USER_HOME}}/Documents/Code/example-saas/server/controllers/abacatepay-webhook.ts — webhook handler
  • {{USER_HOME}}/Documents/Code/example-saas/server/controllers/fatura.ts — invoice lookup by shortlink
  • {{USER_HOME}}/Documents/Code/example-saas/server/controllers/trial.ts — trial expiration processing
  • {{USER_HOME}}/Documents/Code/example-saas/server/services/abacatepay-create-billing-v2.ts — AbacatePay billing creation
  • {{USER_HOME}}/Documents/Code/example-saas/server/services/billing-sender.ts — notification dispatch (email + WhatsApp)
  • {{USER_HOME}}/Documents/Code/example-saas/server/services/billing-email-template.ts — HTML invoice email template
  • {{USER_HOME}}/Documents/Code/example-saas/server/services/billing-integrations-config.ts — encrypted config management
  • {{USER_HOME}}/Documents/Code/example-saas/server/services/billing-metrics.ts — MRR and billing metrics
  • {{USER_HOME}}/Documents/Code/example-saas/server/utils/invoice-state-machine.ts — state machine logic
  • {{USER_HOME}}/Documents/Code/example-saas/server/cron/billing-cron.ts — main billing scheduler
  • {{USER_HOME}}/Documents/Code/example-saas/server/cron/trial-cron.ts — trial scheduler
  • {{USER_HOME}}/Documents/Code/example-saas/src/pages/FaturaPage.tsx — public invoice page
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/PlansPage.tsx — pricing/plans page
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/PlanManager.tsx — user plan manager
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/AdminCobrancas.tsx — admin billing CRUD
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/AdminPlanos.tsx — admin plan CRUD
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/AdminGlobalSettings.tsx — global settings
  • {{USER_HOME}}/Documents/Code/example-saas/src/components/MinhasCobrancasSection.tsx — user invoice list
  • {{USER_HOME}}/Documents/Code/example-saas/supabase/migrations/20260617_cobrancas_foundation.sql — core tables
  • {{USER_HOME}}/Documents/Code/example-saas/supabase/migrations/20260617_cobrancas_website_final.sql — shortlink trigger
  • {{USER_HOME}}/Documents/Code/example-saas/supabase/migrations/20240101_billing_config.sql — billing_config table
  • {{USER_HOME}}/Documents/Code/example-saas/supabase/migrations/20240117_partner_billing.sql — partner billing

Reference Files

  • billing-tables.md — complete table schemas, indexes, enums, RLS policies
  • billing-flows.md — detailed flow diagrams and pseudocode for each core flow
  • billing-config.md — encryption, config resolution, and setup steps
  • billing-admin.md — admin interfaces and CRUD operations
  • billing-notifications.md — email/WhatsApp templates, dunning sequence, template variables

Validation

  • After changes, run build and typecheck (npm run build, npm run typecheck or equivalent)
  • Simulate webhook: POST checkout.completed and subscription.renewed events and verify idempotent processing
  • Test dunning: create overdue cobranca with regua de 0/3/7 dias and confirm notification dispatch
  • Test trial: set trial_duration_days=1, create user, wait for pre-expiration and expiration
  • Verify no AbacatePay/Resend/Evolution keys leak to browser bundles
  • Run project lint when available

Related Skills

  • skill-abacatepay-integration — AbacatePay v2 API specifics and legacy v1 migration boundary
  • skill-saas-core-limits — plan limits, entitlements, feature flags after payment
  • skill-evolution-api — WhatsApp notification channel
  • skill-supabase-rls — RLS policies for billing tables
  • skill-saas-factory — top-level SaaS construction entry

Meegeleverde bestanden

Zolang de skill geladen is, leest het model deze bestanden als dat nodig is. Het model kan ze alleen lezen; ze worden nooit uitgevoerd.

Veelgestelde vragen

Wat doet de AI-skill Skill Cobranca Automatizada Saas Abacatepay?

Automatische SaaS-factureringsengine met AbacatePay (PIX + creditcard), configureerbaar incassobeheer (regua de cobranca), proefperiodebeheer, factuurportaal, meldingen via e-mail (Resend) en WhatsApp (Evolution API), CRUD voor beheerders en factureringsstatistieken. Bestrijkt de volledige factureringscyclus, van provisioning tot incasso.

Waarom Skill Cobranca Automatizada Saas Abacatepay gebruiken in TypingMind?

Omdat je deze skill één keer installeert en met elk model kunt gebruiken. Skill Cobranca Automatizada Saas Abacatepay bestaat uit gewone Markdown in plaats van aanbiederspecifieke code. Dezelfde skill werkt dus met GPT-5, Claude, Gemini, Grok of een lokaal model. Ook als je midden in een chat van model wisselt, blijft de skill werken. TypingMind werkt met je eigen API-sleutels, dus je betaalt aanbieders rechtstreeks in plaats van een abonnement per gebruikersplek af te sluiten. Je skills en chats blijven in je eigen opslag.

Hoe installeer ik Skill Cobranca Automatizada Saas Abacatepay in TypingMind?

Open Plug-ins → Skills → Installeren vanaf GitHub in TypingMind en plak https://github.com/IAPro-Community/Orquestrador-Maestro/tree/v1/codex/skills/skill-cobranca-automatizada-saas-abacatepay. TypingMind leest het bestand SKILL.md, bundelt de bijbehorende bestanden en installeert het geheel als een skill die je per chat kunt inschakelen.

Welke AI-modellen kunnen Skill Cobranca Automatizada Saas Abacatepay gebruiken?

Elk model dat je in TypingMind koppelt. AI-skills bestaan uit gewone Markdown-instructies in plaats van aanbiederspecifieke code. GPT, Claude, Gemini, Grok en lokale modellen kunnen deze skill dus allemaal laden wanneer een verzoek erbij past.

Hoeveel AI-modellen kan ik met Skill Cobranca Automatizada Saas Abacatepay gebruiken?

Zoveel als je wilt. Je kunt Skill Cobranca Automatizada Saas Abacatepay gebruiken met elk model dat skills ondersteunt, zoals GPT, Claude, Gemini, Grok, DeepSeek, Mistral of Llama. Allemaal in TypingMind met je eigen API-sleutels.

Is de AI-skill Skill Cobranca Automatizada Saas Abacatepay gratis?

Ja. Deze skill is door IAPro-Community op GitHub gepubliceerd onder de licentie Apache-2.0. Je betaalt alleen je eigen AI-aanbieder voor de tokens die je gebruikt.

Wat zijn AI-skills?

Een AI-skill is een herbruikbare bundel instructies die een AI-model leert hoe het één specifieke taak moet uitvoeren. De skill volgt het open Agent Skills-formaat: het bestand SKILL.md bevat de naam en beschrijving van de skill. Daarnaast kan de skill scripts, sjablonen of referentiebestanden bevatten die het model nodig heeft. Het model leest de instructies alleen als je verzoek bij de skill past. Een geïnstalleerde skill kost dus niets zolang deze niet wordt gebruikt.

Waarin verschillen AI-skills van plug-ins of MCP-servers?

Een plug-in of MCP-server geeft een model nieuwe tools om aan te roepen: code die ergens wordt uitgevoerd en een resultaat teruggeeft. Een AI-skill geeft het model juist kennis en een werkwijze: hoe het een taak moet aanpakken, welke stappen het moet volgen en hoe goede uitvoer eruitziet. Skills bestaan uit gewone Markdown en hebben dus geen server, API-sleutel of runtime nodig. Ze werken met elk model.

Bekijk alles

Maak nu je eigen AI-werkruimte

Schrijf je in voor onze nieuwsbrief en blijf op de hoogte van nieuwe functies en toekomstige weggeefacties 👇