# Accounts receivable

What each customer owes: invoices receivable, paid and in installments.

The guide, step by step: https://fiscalisto.com/en/docs/api/cuentas-por-cobrar.md

## Endpoints

- [Mark paid](https://fiscalisto.com/en/docs/api/referencia/cuentas-por-cobrar/mark-invoice-paid.md): `POST /v1/invoices/{id}/mark_paid`
- [Mark receivable](https://fiscalisto.com/en/docs/api/referencia/cuentas-por-cobrar/mark-invoice-unpaid.md): `POST /v1/invoices/{id}/mark_unpaid`
- [See what you're owed](https://fiscalisto.com/en/docs/api/referencia/cuentas-por-cobrar/list-receivables.md): `GET /v1/receivables`
- [See how a customer pays](https://fiscalisto.com/en/docs/api/referencia/cuentas-por-cobrar/get-customer-payment-behavior.md): `GET /v1/customers/{id}/payment_behavior`

It also answers with: Invoice (https://fiscalisto.com/en/docs/api/referencia/facturas.md).

## The Receivable object

What a customer owes an issuer in one currency, from their open invoices.

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | The RFC and currency (RFC:MXN): for starting_after. |
| `object` | `"receivable"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `customer` | object | yes | The customer who owes. |
| `customer.tax_id` | string | yes | RFC (Rfc), 12 characters for a persona moral and 13 for a persona física. |
| `customer.legal_name` | string or null | yes | Name or razón social exactly as on the constancia de situación fiscal, without the capital regime (without «S.A. de C.V.»). |
| `currency` | string | yes | The currency of those invoices. |
| `amount_due` | number | yes | What they owe in total, in that currency. |
| `amount_overdue` | number | yes | Of that, what is already past due (each invoice's due_date), in that currency. |
| `open_invoices` | integer | yes | How many open invoices they have. (from -9007199254740991 to 9007199254740991) |
| `oldest_invoice_date` | string | yes | The date (YYYY-MM-DD) of their oldest open invoice. |

Example:

```json
{
  "id": "ICV060329BY0:MXN",
  "object": "receivable",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "customer": {
    "tax_id": "ICV060329BY0",
    "legal_name": "INMOBILIARIA CVA"
  },
  "currency": "MXN",
  "amount_due": 34800,
  "amount_overdue": 17400,
  "open_invoices": 2,
  "oldest_invoice_date": "2026-09-01"
}
```

## The CustomerPaymentBehavior object

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

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `object` | `"customer_payment_behavior"` | yes | What kind of object it is («invoice», «customer»…). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `issuer` | string | yes | The issuer. |
| `customer` | string | yes | The customer (cus_…). |
| `tax_id` | string | yes | Their RFC. |
| `credit_days` | integer | yes | Their credit days: their own (Clientes, or their group's) or the empresa's (Ajustes › Cobranza automática). Lateness is measured against them. (from -9007199254740991 to 9007199254740991) |
| `rating` | `on_time`, `sometimes_late`, `late`, `very_late`, `no_history` | yes | 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). |
| `paid_invoices` | integer | yes | PPD invoices with a payment in the last 12 months. (from -9007199254740991 to 9007199254740991) |
| `average_days_to_pay` | number or null | yes | Days from invoice to payment, amount-weighted average; null without payments. |
| `median_days_to_pay` | integer or null | yes | The typical invoice: half were paid in this many days or fewer. |
| `p75_days_to_pay` | integer or null | yes | 3 out of 4 invoices were paid in this many days or fewer. |
| `on_time_share` | number or null | yes | 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` | number or null | yes | Days after the due date, amount-weighted average; unpaid past-due amounts count with their days late up to today. |
| `trend` | object or null | yes | The last 3 months against the previous 9; null with fewer than 2 paid invoices on either side. |
| `trend.direction` | `slower`, `faster`, `steady` | yes | slower: takes 7 or more days longer than before; faster: 7 or more fewer. |
| `trend.recent_days` | number | yes | Average days to pay over the last 3 months. |
| `trend.earlier_days` | number | yes | Average days over the previous 9 months. |
| `overdue_amount` | number | yes | What they owe that is already past due, in pesos. |
| `overdue_invoices` | integer | yes | How many invoices they have past due. (from -9007199254740991 to 9007199254740991) |
| `payment_forms` | array of object | yes | How they paid, largest first. |
| `payment_forms[].payment_form` | string | yes | SAT payment form code (c_FormaPago): 03 transfer, 02 check… |
| `payment_forms[].amount` | number | yes | What was paid this way, in pesos. |
| `payment_forms[].share` | number | yes | Its share of what was paid (0 to 1). |
| `months` | array of object | yes | Each of the last 12 months, oldest first. |
| `months[].month` | string | yes | The payments' month (YYYY-MM). |
| `months[].average_days_to_pay` | number or null | yes | Average days (amount-weighted) of that month's payments; null without payments. |
| `months[].amount` | number | yes | What was paid that month, in pesos. |
| `months[].paid_invoices` | integer | yes | Invoices with a payment that month. (from -9007199254740991 to 9007199254740991) |
| `last_payment` | object or null | yes | Their last payment; null without payments in 12 months. |
| `last_payment.date` | string | yes | The day (YYYY-MM-DD). |
| `last_payment.amount` | number | yes | What was paid that day, in pesos. |
| `cash_invoices` | integer | yes | Cash invoices (PUE) from the last 12 months: they are paid when issued and don't count in the rest. (from -9007199254740991 to 9007199254740991) |
| `open_invoices` | array of object | yes | What they owe now, oldest invoice first. |
| `open_invoices[].uuid` | string | yes | The invoice's UUID (tax folio). |
| `open_invoices[].date` | string | yes | Its date (YYYY-MM-DD). |
| `open_invoices[].payment_method` | `PPD`, `PUE` | yes | PPD on credit; PUE being paid this month. |
| `open_invoices[].amount_due` | number | yes | What is left, in pesos. |
| `open_invoices[].due_date` | string | yes | When it is due: its date plus the credit days (a PUE, at the end of its month). |
| `open_invoices[].expected_payment_date` | string | yes | When it would arrive: its date plus how long the customer usually takes (without history, the due date). |

Example:

```json
{
  "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"
    }
  ]
}
```
