Skip to main content
The ByDoctor Payments API gives you programmatic access to every financial transaction recorded by the platform — from cash payments at the reception desk to health plan invoices awaiting reimbursement. You can use this data to build custom dashboards, feed an accounting system, or produce TISS reconciliation reports for health plans.

Key concepts

Before querying payments, there are two important conventions to understand:
  • Amounts are in centavos (integer). R$ 150,00 is represented as 15000. There are no decimal points in the amount field. All values are in BRL.
  • Payments are linked to appointments. Every payment object carries an appointment_id that you can use to join financial data with clinical data for richer reports.

Listing payments

Use GET /payments with query parameters to filter the dataset to exactly the records you need. Request — all paid payments for January 2025:
Response:

Aggregating monthly revenue

The following JavaScript example fetches all paid payments for a given month and produces a total revenue figure, handling pagination automatically.

Revenue breakdown by payment method

Group the same payment list by method to produce a payment-method breakdown report — useful for understanding the split between card, PIX, and health plan receipts.

Health plan reconciliation

To support TISS (Troca de Informações em Saúde Suplementar) reporting, filter payments by method=health_plan and cross-reference each result with its linked appointment.
For each payment returned, use appointment_id to fetch the full appointment (including patient_id, professional_id, and starts_at) to build the procedure and beneficiary data required in the TISS XML guide.

Webhook-based real-time updates

Subscribe to payment.paid to push financial data into your accounting system the moment a payment is confirmed, rather than polling periodically.
The following example receives the payment.paid event and forwards it to a hypothetical accounting API:

Bank accounts

If your clinic has multiple bank accounts configured in ByDoctor, use GET /bank-accounts to retrieve them. The bank_account_id on each payment tells you which account received the funds — useful when routing revenue data to different ledgers in your accounting system.
If you prefer a one-off export rather than a programmatic integration, the ByDoctor dashboard supports manual CSV export from the Financial section. Navigate to Financial → Reports → Export and select your date range and filters. This is ideal for ad-hoc audits or sharing data with an accountant who does not need API access.