# Mark a supplier invoice paid

`POST https://api.fiscalisto.com/v1/supplier_invoices/{id}/mark_paid`

The payment your ERP or your bank made, like «Marcar pagada» in the app: the supplier sees it, and if it's PPD we ask them for its payment complement. supplier_invoice.paid arrives.

## Before you call

- **Supplier portal in the plan** of your empresa, if your API account belongs to an empresa: it comes with Operaciones, which is added to any paid plan in **Ajustes › Plan y pagos** and comes in Corporativo. In test mode you can already use it.

## Parameters

| Name | In | Required | Description |
| --- | --- | --- | --- |
| `id` | path | yes | The object's id. |
| `Idempotency-Key` | header |  | Optional (the SDKs send it on their own). If the response is lost, repeat the request with the same value within 24 hours: it answers the same, with idempotent-replayed: true, and doesn't do it twice (it doesn't create, send emails or charge). |

## Body

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `paid_on` | string | yes | The day you paid it (YYYY-MM-DD, today or earlier). |
| `reference` | string or null |  | The payment's reference (the transfer's or the ERP's), or null. |

Example:

```json
{
  "paid_on": "2026-11-27",
  "reference": "SPEI 004512"
}
```

## With the TypeScript SDK

```ts
import { Fiscalisto } from "fiscalisto";

// La llave viene de FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const supplierInvoice = await fiscalisto.supplierInvoices.markPaid("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", {
  paid_on: "2026-11-27",
  reference: "SPEI 004512",
}, { idempotencyKey: "pedido-A-1042" });
```

## With the Python SDK

```python
from fiscalisto import Fiscalisto

# La llave viene de FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

supplier_invoice = fiscalisto.supplier_invoices.mark_paid("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", {
    "paid_on": "2026-11-27",
    "reference": "SPEI 004512",
}, idempotency_key="pedido-A-1042")
```

## With the PHP SDK

```php
<?php

use Fiscalisto\Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$supplierInvoice = $fiscalisto->supplierInvoices->markPaid('spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx', [
    'paid_on' => '2026-11-27',
    'reference' => 'SPEI 004512',
], ['idempotency_key' => 'pedido-A-1042']);
```

## With the .NET SDK

```csharp
using Fiscalisto;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var supplierInvoice = await fiscalisto.SupplierInvoices.MarkPaidAsync("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", new MarkSupplierInvoicePaidParams
{
    PaidOn = "2026-11-27",
    Reference = "SPEI 004512",
}, new RequestOptions { IdempotencyKey = "pedido-A-1042" });
```

## With the Go SDK

```go
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// La llave viene de FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	supplierInvoice, err := client.SupplierInvoices.MarkPaid(ctx, "spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", &fiscalisto.MarkSupplierInvoicePaidParams{
		PaidOn:    "2026-11-27",
		Reference: fiscalisto.String("SPEI 004512"),
	}, fiscalisto.WithIdempotencyKey("pedido-A-1042"))
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(supplierInvoice.ID)
}
```

## With the Java SDK

```java
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.RequestOptions;
import com.fiscalisto.model.MarkSupplierInvoicePaidParams;

// La llave viene de FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var supplierInvoice = fiscalisto.supplierInvoices().markPaid("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", new MarkSupplierInvoicePaidParams()
        .setPaidOn("2026-11-27")
        .setReference("SPEI 004512"), RequestOptions.idempotencyKey("pedido-A-1042"));
System.out.println(supplierInvoice.getId());
```

## Response 200

OK.

A `SupplierInvoice` object:

| Field | Type | Always present | Description |
| --- | --- | --- | --- |
| `id` | string | yes | Object identifier, with its prefix (iss_, inv_, ret_, cus_, prd_, emp_, bat_, brn_, whs_, stm_, adj_, evt_, whe_). |
| `livemode` | boolean | yes | true in production (fk_live_ keys), false in test mode (fk_test_). Test objects aren't valid before the SAT. |
| `object` | `"supplier_invoice"` | yes | What kind of object it is («invoice», «customer»…). |
| `issuer` | string | yes | The issuer in your account (iss_…) that received it. |
| `supplier` | string | yes | The supplier (sup_…) that sent it. |
| `supplier_tax_id` | string | yes | The supplier's RFC, or the `EXT-<país>-<tax ID>` key of a foreign one. |
| `uuid` | string | yes | The tax folio (UUID of the stamp); a foreign supplier's invoice, which has no CFDI, carries `EXT-…` and sat_invoice null. |
| `sat_invoice` | string or null | yes | The same invoice among your received invoices (sat_…), for its XML and PDF, or null. |
| `series` | string or null | yes | Its series, or null. |
| `folio` | string or null | yes | Its folio, or null. |
| `type` | `income`, `credit_note` | yes | income (income invoice) or credit_note. |
| `date` | string | yes | The invoice's date. |
| `currency` | string | yes | The currency. |
| `total` | number | yes | The invoice's total. |
| `payable` | number | yes | What they are paid: the total without the differences against their order or the accepted early-payment discount. |
| `payment_method` | string or null | yes | PUE or PPD. |
| `status` | `received`, `approved`, `scheduled`, `paid`, `rejected` | yes | received (to review), approved, scheduled (with a payment date), paid or rejected. |
| `purchase_order` | string or null | yes | The purchase order it invoices (OC-12), or null. |
| `matches_purchase_order` | boolean or null | yes | true if it matched its order, false if it had differences, null without an order. |
| `contrarecibo` | string or null | yes | Its counter-receipt folio, or null. |
| `due_on` | string or null | yes | The day it is due by its payment dates, or null. |
| `scheduled_on` | string or null | yes | The day scheduled to pay it, or null. |
| `paid_on` | string or null | yes | The day it was paid, or null. |
| `paid_amount` | number or null | yes | What was paid, or null. |
| `payment_reference` | string or null | yes | The payment reference, or null. |
| `rejection_reason` | string or null | yes | Why it was rejected, or null. |
| `warnings` | array of object | yes | What was checked and left as a warning (code and message), for your team to see. |
| `warnings[].code` | string | yes | Withholding key (CveRetenc), c_CveRetenc: 01 professional services, 05 leasing, 14 dividends, 16 interest, 18 payments abroad… Keys 06 and 14 to 24 carry their complement, as SAT's catalog asks (share_sale with 06 and 19, dividends with 14, distributable_remainder with 15, interest, trust_lease, foreign_payment, prize, trust, retirement_plan, mortgage_interest, financial_derivatives); 01, 02, 04 and 05 carry foreign_payment when the recipient is foreign; 26 (technology platforms) carries platform, and its totals and taxes are calculated from the operations. 27 and 28 can't be issued here. |
| `warnings[].message` | string | yes | What happened and how to fix it, for a person. |
| `received_at` | string (date-time) or null | yes | When it arrived. |
| `approved_at` | string (date-time) or null | yes | When it was approved, or null. |

```json
{
  "id": "spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx",
  "object": "supplier_invoice",
  "livemode": false,
  "issuer": "iss_OufpKqnrvx9p",
  "supplier": "sup_OufpKqnrvx9p3Lk8mZr1XyT5uBcW8sKdLx",
  "supplier_tax_id": "AAA010101AAA",
  "uuid": "9F1C2B3A-4D5E-4F60-8A7B-1C2D3E4F5A6B",
  "sat_invoice": "sat_OufpKqnrvx9p2D",
  "series": "A",
  "folio": "120",
  "type": "income",
  "date": "2026-11-09T10:00:00",
  "currency": "MXN",
  "total": 11600,
  "payable": 11600,
  "payment_method": "PPD",
  "status": "approved",
  "purchase_order": "OC-12",
  "matches_purchase_order": true,
  "contrarecibo": "CR-41",
  "due_on": "2026-12-09",
  "scheduled_on": null,
  "paid_on": null,
  "paid_amount": null,
  "payment_reference": null,
  "rejection_reason": null,
  "warnings": [],
  "received_at": "2026-11-09T10:05:00-06:00",
  "approved_at": "2026-11-09T12:30:00-06:00"
}
```

## Errors

- `feature_not_in_plan` (403): 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.
- `issuer_archived` (400): The issuer is archived and no longer stamps. Its documents can still be read and canceled.
- `issuer_linked_empresa` (403): 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.
- `issuer_missing` (404): There is no such issuer in the account (or it belongs to the other mode).
- `issuer_not_allowed` (403): This key can't use that issuer.
- `issuer_required` (400): The account has several issuers and the request doesn't say which: send `issuer` (iss_…).
- `livemode_mismatch` (400): The object belongs to the other mode: an fk_test_ key only sees test data and an fk_live_ key only live data.
- `resource_missing` (404): There's no object with that id (or it belongs to another issuer or the other mode).
- `supplier_invoice_invalid` (400): The supplier invoice can't do that in its current status (only an approved or scheduled one can be scheduled, a paid date can't be in the future, or the SAT reports it canceled). `message_es` says why.

Plus those of any call (key, fields, limits): https://fiscalisto.com/en/docs/api/errores.md.
