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 theamountfield. All values are in BRL. - Payments are linked to appointments. Every payment object carries an
appointment_idthat you can use to join financial data with clinical data for richer reports.
Listing payments
UseGET /payments with query parameters to filter the dataset to exactly the records you need.
Request — all paid payments for January 2025:
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 bymethod 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 bymethod=health_plan and cross-reference each result with its linked appointment.
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 topayment.paid to push financial data into your accounting system the moment a payment is confirmed, rather than polling periodically.
payment.paid event and forwards it to a hypothetical accounting API:
Bank accounts
If your clinic has multiple bank accounts configured in ByDoctor, useGET /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.