Skip to content

FISCALISTO / API / REFERENCE

See how a customer pays · Accounts receivable

Open in ChatGPTOpen in ClaudeOpen in Cursor
GET
/v1/customers/{id}/payment_behavior

How many days they take to pay, what share arrives on time with their credit days, whether they pay slower than before, how they pay and when what they owe would arrive. From their credit invoices (PPD) of the last 12 months and their payment complements, like «Cómo paga» in the app. It doesn't apply to XAXX010101000 or XEXX010101000.

Authorization

bearerAuth
headerAuthorizationBearer <key>

Your secret key: fk_test_… in test mode, fk_live_… in production. Desarrolladores › Llaves.

Path parameters

id*string

The object's id.

Response body

OK.

application/json
  1. response

How a customer pays: from their credit invoices (PPD) of the last 12 months and their payment complements, in pesos.

object*string

What kind of object it is («invoice», «customer»…).

livemode*boolean

true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT.

issuer*string

The issuer.

customer*string

The customer (cus_…).

tax_id*string

Their RFC.

credit_days*integer

Their credit days: their own (Clientes, or their group's) or the empresa's (Ajustes › Cobranza automática). Lateness is measured against them.

Range-9007199254740991 <= value <= 9007199254740991
rating*string

on_time (80 % or more arrives on time and an average delay of 5 days or less), sometimes_late (up to 15 days), late (up to 45), very_late (more) or no_history (fewer than 2 paid invoices and nothing past due).

One of"on_time""sometimes_late""late""very_late""no_history"
paid_invoices*integer

PPD invoices with a payment in the last 12 months.

Range-9007199254740991 <= value <= 9007199254740991
average_days_to_pay*|

Days from invoice to payment, amount-weighted average; null without payments.

median_days_to_pay*|

The typical invoice: half were paid in this many days or fewer.

p75_days_to_pay*|

3 out of 4 invoices were paid in this many days or fewer.

on_time_share*|

The share (0 to 1) of what was paid that arrived before its due date; unpaid past-due amounts count as late.

average_days_late*|

Days after the due date, amount-weighted average; unpaid past-due amounts count with their days late up to today.

trend*|

The last 3 months against the previous 9; null with fewer than 2 paid invoices on either side.

overdue_amount*number

What they owe that is already past due, in pesos.

overdue_invoices*integer

How many invoices they have past due.

Range-9007199254740991 <= value <= 9007199254740991
payment_forms*array<>

How they paid, largest first.

months*array<>

Each of the last 12 months, oldest first.

last_payment*|

Their last payment; null without payments in 12 months.

cash_invoices*integer

Cash invoices (PUE) from the last 12 months: they are paid when issued and don't count in the rest.

Range-9007199254740991 <= value <= 9007199254740991
open_invoices*array<>

What they owe now, oldest invoice first.

Errors

  • Público en general (XAXX010101000) and foreign customers (XEXX010101000) share one RFC, so how one pays says nothing about the others: there's no payment behavior for them.

  • The issuer is archived and no longer stamps. Its documents can still be read and canceled.

  • The account has several issuers and the request doesn't say which: send issuer (iss_…).

  • The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.

  • Live, this part of the API (inventario, portal de proveedores, pedidos, comprobación de gastos) follows the empresa's plan, as in the app: it comes with Operaciones (added to any paid plan; included in Corporativo). The books (the /v1/accounting routes except DIOT, cross checks, IVA refunds and fixed assets) come with Contabilidad (added to Independiente, Emprendedor or Negocio; included in Despacho and Corporativo): without it, changing the books answers this error, and reading them works only up to the last month it had it. Add either in Ajustes › Plan y pagos; test mode has everything.

  • That issuer is an empresa of the app connected to your account: through the API it only offers its Portal de proveedores (/v1/portal_suppliers and /v1/supplier_invoices) and, once someone who may pay suppliers and change Configurar pagos turned them on, its supplier payouts (/v1/payouts and /v1/payroll_payouts). It also stops when whoever connected it (or turned its payouts on) no longer has that permission in the empresa: message_es says which. Do everything else in the app.

  • This key can't use that issuer.

  • There is no such issuer in the account (or it belongs to the other mode).

  • There's no object with that id (or it belongs to another issuer or the other mode).

Plus those of any call (key, fields, limits): Errors. They all carry code, message and, when it's about a field, param.

curl -X GET 'https://api.fiscalisto.com/v1/customers/cus_OufpKqnrvx9p1/payment_behavior' \  -H 'Authorization: Bearer fk_test_…'
{  "object": "customer_payment_behavior",  "livemode": false,  "issuer": "iss_OufpKqnrvx9p",  "customer": "cus_OufpKqnrvx9p1",  "tax_id": "ICV060329BY0",  "credit_days": 30,  "rating": "late",  "paid_invoices": 14,  "average_days_to_pay": 47.5,  "median_days_to_pay": 45,  "p75_days_to_pay": 58,  "on_time_share": 0.214,  "average_days_late": 18.2,  "trend": {    "direction": "slower",    "recent_days": 56,    "earlier_days": 41.3  },  "overdue_amount": 17400,  "overdue_invoices": 1,  "payment_forms": [    {      "payment_form": "03",      "amount": 162400,      "share": 0.875    },    {      "payment_form": "02",      "amount": 23200,      "share": 0.125    }  ],  "months": [    {      "month": "2026-10",      "average_days_to_pay": 56,      "amount": 34800,      "paid_invoices": 2    }  ],  "last_payment": {    "date": "2026-10-28",    "amount": 17400  },  "cash_invoices": 3,  "open_invoices": [    {      "uuid": "5FB2822E-396D-4725-8521-CDC4BDD20CCF",      "date": "2026-09-01",      "payment_method": "PPD",      "amount_due": 17400,      "due_date": "2026-10-01",      "expected_payment_date": "2026-10-16"    }  ]}

Was this page helpful?