FISCALISTO / API
Accounts receivable
Know which invoices are already paid, which are in installments and how much each customer owes you, and hear about each payment by webhook.
Each income invoice says whether it's been collected. Fiscalisto keeps track with what it already stamps: the payment complements, the credit notes and, in the app, the reconciled bank deposits. You don't store balances.
On each invoice
| Field | What it is |
|---|---|
payment_status | paid, partial (payments or notes for part of it) or unpaid. null if it isn't an income invoice or isn't current. |
amount_due | What's left to collect, in the invoice's currency. |
amount_paid | What's been collected: current payment complements and credit notes. |
due_date | While something is owed, the day it's due (YYYY-MM-DD): its date plus the credit days in the customer's record (or their customer group) or, without them, the company's (30 unless changed); a PUE with paid_later, the last day of its month. null once paid. |
payment_terms | The payment terms you wrote when creating it (CondicionesDePago in the XML, also on the PDF), such as "Crédito a 30 días"; null without them. Send them in payment_terms on POST /v1/invoices, up to 1,000 characters without ` |
Each customer carries credit_days (their credit days; null: their group's or the company's) and payment_terms (the terms their new invoices start with in the app; null: the company's). Change them with POST /v1/customers/{id}. POST /v1/invoices doesn't add the terms by itself: send them in payment_terms.
A PPD invoice starts unpaid and goes down with each payment complement; if a complement is cancelled, its balance comes back. A PUE one is paid from the moment it's stamped, unless you stamp it with "paid_later": true (the customer pays you this month): it stays unpaid until you mark it paid. Send paid_on (YYYY-MM-DD) with the day you were paid, or today's is used; the invoice shows it in paid_on, and it counts in the customer's payment history (GET /v1/customers/{id}/payment_behavior).
curl -X POST https://api.fiscalisto.com/v1/invoices/inv_OufpKqnrvx9p6hW1yQbT3mZr8sKdLx0VeN/mark_paid \
-H "Authorization: Bearer $FISCALISTO_API_KEY"POST /v1/invoices/{id}/mark_unpaid does the opposite with a PUE already stamped. If the month ends and a PUE is still unpaid, the law requires replacing it with a PPD (RMF rule 2.7.1.39). A PPD isn't marked: it's paid with its complement (400 invoice_not_markable).
In the app, a years-old PPD without a complement can be taken out of Por cobrar (collected without a complement, or uncollectible) so it doesn't add up as debt. The API doesn't change it: for the SAT it's still unpaid, so it keeps its payment_status (unpaid or partial) and its amount_due, and stays in GET /v1/receivables. If its complement arrives later, it becomes paid and invoice.paid is sent.
What you're owed
curl https://api.fiscalisto.com/v1/receivables \
-H "Authorization: Bearer $FISCALISTO_API_KEY"Returns what each customer owes, per currency: amount_due, how much of it is past due (amount_overdue, by each invoice's due_date), how many open invoices they have (open_invoices) and the oldest one's date (oldest_invoice_date), sorted by RFC. With ?customer=RFC (or their cus_… id), only that customer. Their invoices: GET /v1/invoices?customer=RFC&payment_status=open (unpaid, partial, open or paid).
How each customer pays
curl https://api.fiscalisto.com/v1/customers/cus_OufpKqnrvx9p1/payment_behavior \
-H "Authorization: Bearer $FISCALISTO_API_KEY"Returns how that customer pays the issuer, from their credit (PPD) invoices of the last 12 months and their payment complements, in pesos, like Cómo paga in the app:
| Field | What it is |
|---|---|
rating | on_time, sometimes_late, late, very_late or no_history (fewer than 2 paid invoices and nothing overdue). |
average_days_to_pay | Days from invoice to payment, amount-weighted average. median_days_to_pay is the typical invoice. |
on_time_share | The share (0 to 1) of what was paid that arrived before falling due, with their credit_days. |
average_days_late | Days past the due date, on average. What's overdue and unpaid counts with its days up to today, so a customer who stopped paying doesn't come out punctual. |
trend | The last 3 months against the previous 9: slower, faster or steady. |
open_invoices | What they owe, with due_date and expected_payment_date: its date plus how long the customer usually takes. |
credit_days are the customer's (from their record or their group) or, if they have none, the company's (Ajustes › Cobranza automática). Use it to decide whether to give them credit in your own system or to project when the money will arrive. It doesn't apply to XAXX010101000 or XEXX010101000 (customer_generic_tax_id): many customers share those RFCs.
Each payment, by webhook
| Event | When |
|---|---|
invoice.partially_paid | A payment arrived for part of a PPD invoice (a payment complement or a credit note). |
invoice.paid | Nothing is owed anymore: the last complement, a credit note, a reconciled deposit or mark_paid. |
In both, data.object is the invoice with its payment_status and amount_due. That way your system records the payment or releases the order without asking.
In test mode it works the same, with the complements and notes you stamp with your fk_test_ key.
Was this page helpful?
Withholding certificates
Stamp the withholding and payment information certificate (CFDI de Retenciones 2.0) for what you withheld from a supplier: professional fees, rent, dividends, interest or payments abroad.
Bank reconciliation
Send the deposits of the issuer's account and Fiscalisto tells you which invoice each one paid; once reconciled, its invoices are paid.