Before you start
- The clinic’s
billingdata area is on. It is off by default; otherwise every call answers403 DATA_AREA_OFF. - Your key has
billing.invoices.readfor invoices,billing.payments.readfor charges, receipts and balances, andbilling.packages.readfor bonos. - Responses name the patient by
idonly, never by name or fiscal data. For the name, read the patient withGET /patients/{id}(areapatients). - Every amount is in cents, with its
currency(usuallyEUR).
Does this patient owe anything?
Response
pending is what they owe and credit is money they paid that is not applied to anything yet. They are reported apart, never netted, as on the patient’s record. uninvoiced is the total of their open charges that no invoice documents yet, collected or not.
What they owe, session by session
Each priced session, bono sale or loose concept is a charge. Itssettlement derives from what was collected: pending, partial or settled.
uninvoiced=true (what is left to invoice) or by service date with from and to (YYYY-MM-DD). A voided charge (status: "voided") owes nothing: courtesy, recording error, cancelled appointment or covered by a bono.
Receipts
cash, card, bizum, transfer, other) and which charges it paid (applications). A corrected receipt is reversed and counts for nothing; it only appears with includeReversed=true. The receipt’s internal notes never leave through the API.
Invoices
number: null; the fiscal number is given on issue. pending is what is left to collect. A rectificativa (series R) points to the invoice it corrects with correctsInvoiceId. Voided invoices only appear with includeVoided=true. To read the lines:
chargeId.
Bonos
remaining is the sessions left and total the sessions it was sold with. With a personal credential (MCP or a personal key) you read only the bonos of patients of your centers; the others answer 404, as if they did not exist.
From an assistant
Over MCP the same operations arebrelio_list_invoices, brelio_get_invoices, brelio_list_charges, brelio_list_receipts, brelio_get_balances and brelio_list_packages. They appear only once the clinic turns Billing on and you hold the permission. Try: “Which sessions has Ana Pérez not paid yet?”: the assistant finds the patient and reads their charges.