# Supplier portal

> Bring the invoices your suppliers send through the portal into your ERP as soon as they're approved, and send back the date you'll pay them and the payment.

The **Portal de proveedores** (supplier portal) is where your suppliers register, upload their invoices (checked before they arrive: SAT, 69-B, PUE or PPD, withholdings, exchange rate, purchase order…) and see when they'll be paid. With the API, your ERP (SAP, NetSuite, CONTPAQi or your own) receives what's approved without anyone exporting it by hand, and sends back to Fiscalisto the payment date and the payment, which the supplier sees on their portal.

- A **portal supplier** (`sup_…`): their registration, their documents, the account they're paid to and their rating.
- A **supplier invoice** (`spi_…`): what was checked, its purchase order, its contrarecibo (receipt voucher) and its dates. Its status: `received` (to review) → `approved` → `scheduled` → `paid`, or `rejected`.

Review and approval (with their levels) are done in the app, in **Compras y gastos › Portal de proveedores**.

## Your company in the app

If the portal belongs to the same company where you created the key (in its menu, **Desarrolladores**), there's nothing to connect: its RFCs are already issuers (`type: "own"`) and these routes work with them, if the company's plan includes the portal (Negocio and up).

If the portal is in another of your companies in the app, connect it: in [Desarrolladores › Emisores](/desarrolladores/emisores), in production, press **Conectar una empresa** and choose the company and its RFC. It becomes one more issuer (`iss_…`, with `type: "portal"`) and these routes and their events work with your `fk_live_` key. It's the same company, not a copy, and it follows that company's plan: if it stops having the portal, it returns `403` `feature_not_in_plan`. Through the API only its portal is used (and its [supplier payouts](https://fiscalisto.com/en/docs/api/pagos-a-proveedores), if they were turned on): any other route with that issuer returns `403` `issuer_linked_empresa`. Connecting it takes, in that company, being able to manage its credentials and see its Portal de proveedores; scheduling and marking paid (`schedule` and `mark_paid`) also takes being able to pay suppliers. It works with the permissions of whoever connected it, checked on every request: if they leave the company or lose them, its routes and events return `403` `issuer_linked_empresa` until someone else who may connects it. `DELETE /v1/issuers/{id}` disconnects it without changing the company.

## Approved invoices

Listen for `supplier_invoice.approved` on your [webhooks](https://fiscalisto.com/en/docs/api/webhooks), or ask for the approved ones:

```bash tab="cURL"
curl -G https://api.fiscalisto.com/v1/supplier_invoices \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -d status=approved
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

for await (const item of fiscalisto.supplierInvoices.list({ status: "approved" })) {
  console.log(item.id);
}
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

for item in fiscalisto.supplier_invoices.list({"status": "approved"}):
    print(item["id"])
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

foreach ($fiscalisto->supplierInvoices->list(['status' => 'approved']) as $item) {
    echo $item['id'], "\n";
}
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	for item, err := range client.SupplierInvoices.ListAutoPaging(ctx, &fiscalisto.ListSupplierInvoicesParams{
		Status: fiscalisto.String("approved"),
	}) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ListSupplierInvoicesParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

for (var item : fiscalisto.supplierInvoices().listAutoPaging(new ListSupplierInvoicesParams().setStatus("approved"))) {
    System.out.println(item.getId());
}
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await foreach (var item in fiscalisto.SupplierInvoices.ListAutoPagingAsync(new ListSupplierInvoicesParams { Status = "approved" }))
    Console.WriteLine(item.Id);
```

Each one carries `payable` (what's paid to them: the total without the differences with their order or the early-payment discount), `due_on` (when it falls due by your payment dates), `purchase_order`, `contrarecibo` and `warnings` (what was checked and left as a warning). Its XML and PDF are at `GET /v1/sat_invoices/{sat_invoice}/xml` and `/pdf`. Also filter by `supplier` (`sup_…`) or `received_since` (YYYY-MM-DD).

A supplier abroad issues no CFDI: in its portal it sends its invoice as a PDF with its number, date, total and currency. Its invoice carries `uuid` `EXT-…`, `sat_invoice` null and its number in `folio`; its PDF is in its order's files in the app.

## Schedule the payment

The day you'll pay it. The supplier sees it on their portal and `supplier_invoice.scheduled` arrives:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/supplier_invoices/spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx/schedule \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "pay_on": "2026-11-27" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

const supplierInvoice = await fiscalisto.supplierInvoices.schedule("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", { pay_on: "2026-11-27" });
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

supplier_invoice = fiscalisto.supplier_invoices.schedule("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", {"pay_on": "2026-11-27"})
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

$supplierInvoice = $fiscalisto->supplierInvoices->schedule('spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx', ['pay_on' => '2026-11-27']);
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	supplierInvoice, err := client.SupplierInvoices.Schedule(ctx, "spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", &fiscalisto.ScheduleSupplierInvoiceParams{
		PayOn: "2026-11-27",
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(supplierInvoice.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ScheduleSupplierInvoiceParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var supplierInvoice = fiscalisto.supplierInvoices().schedule("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", new ScheduleSupplierInvoiceParams().setPayOn("2026-11-27"));
System.out.println(supplierInvoice.getId());
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

var supplierInvoice = await fiscalisto.SupplierInvoices.ScheduleAsync("spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx", new ScheduleSupplierInvoiceParams { PayOn = "2026-11-27" });
```

Only an approved or already scheduled one, on a date from today on. If SAT reports it cancelled since it was approved, it returns `400` `supplier_invoice_invalid` and isn't scheduled.

## Mark it paid

When your ERP or your bank pays it. If it's PPD, we ask the supplier for their payment complement (no later than the 5th of the following month) and `supplier_invoice.paid` arrives:

```bash tab="cURL"
curl https://api.fiscalisto.com/v1/supplier_invoices/spi_OufpKqnrvx9p7Hq2mZr1XyT5uBcW8sKdLx/mark_paid \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "paid_on": "2026-11-27", "reference": "SPEI 004512" }'
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

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

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

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

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

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

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from 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"),
	})
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(supplierInvoice.ID)
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.MarkSupplierInvoicePaidParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

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

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

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

Fiscalisto doesn't make the payment: it records it. `paid_on` is today or earlier.

## Your suppliers

```bash tab="cURL"
curl -G https://api.fiscalisto.com/v1/portal_suppliers \
  -H "Authorization: Bearer $FISCALISTO_API_KEY" \
  -d status=approved
```

```ts tab="TypeScript"
import { Fiscalisto } from "fiscalisto";

// The key comes from FISCALISTO_API_KEY.
const fiscalisto = new Fiscalisto();

for await (const item of fiscalisto.portalSuppliers.list({ status: "approved" })) {
  console.log(item.id);
}
```

```python tab="Python"
from fiscalisto import Fiscalisto

# The key comes from FISCALISTO_API_KEY.
fiscalisto = Fiscalisto()

for item in fiscalisto.portal_suppliers.list({"status": "approved"}):
    print(item["id"])
```

```php tab="PHP"
<?php

use Fiscalisto\Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
$fiscalisto = new Fiscalisto();

foreach ($fiscalisto->portalSuppliers->list(['status' => 'approved']) as $item) {
    echo $item['id'], "\n";
}
```

```go tab="Go"
package main

import (
	"context"
	"fmt"
	"log"

	fiscalisto "fiscalisto.com/go"
)

func main() {
	// The key comes from FISCALISTO_API_KEY.
	client, err := fiscalisto.NewClient("")
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()

	for item, err := range client.PortalSuppliers.ListAutoPaging(ctx, &fiscalisto.ListPortalSuppliersParams{
		Status: fiscalisto.String("approved"),
	}) {
		if err != nil {
			log.Fatal(err)
		}
		fmt.Println(item.ID)
	}
}
```

```java tab="Java"
import com.fiscalisto.FiscalistoClient;
import com.fiscalisto.model.ListPortalSuppliersParams;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

for (var item : fiscalisto.portalSuppliers().listAutoPaging(new ListPortalSuppliersParams().setStatus("approved"))) {
    System.out.println(item.getId());
}
```

```csharp tab="C#"
using Fiscalisto;

// The key comes from FISCALISTO_API_KEY.
var fiscalisto = new FiscalistoClient();

await foreach (var item in fiscalisto.PortalSuppliers.ListAutoPagingAsync(new ListPortalSuppliersParams { Status = "approved" }))
    Console.WriteLine(item.Id);
```

- `status`: `invited`, `onboarding` (registering), `in_review`, `approved` (can send invoices), `rejected` or `suspended`. `portal_supplier.approved` arrives when a registration is approved.
- `bank_account`: the CLABE they're paid to. A new one stays `pending` until approved in the app, which asks to confirm who they are; meanwhile they're paid to `previous_clabe`. That way nobody changes a supplier's account without your team seeing it.
- `tax_id`: their RFC. A supplier abroad, with no RFC, carries its key `EXT-<country>-<tax ID>` (the country in SAT's c_Pais: `EXT-USA-123456789`), and its `bank_account` carries its account number or IBAN in `clabe` and its bank and SWIFT in `bank`. Filter by it with `tax_id`.
- `documents`: whether their registration is complete and current, and how many documents are missing, awaiting review or expired.
- `score`: their 0 to 100 rating over the last 12 months (`excellent`, `good`, `fair` or `poor`) and each part: `invoices` (invoices right the first time), `deliveries` (on-time deliveries), `prices` (the order's price and quantity), `documents` (documents up to date) and `complements` (payment complements), with how many cases were measured.

## Events

| Event | When it arrives |
| --- | --- |
| `supplier_invoice.received` | A supplier sent an invoice. |
| `supplier_invoice.approved` | It was approved, with all its levels: it can go to your ERP. |
| `supplier_invoice.rejected` | It was rejected, with `rejection_reason`. |
| `supplier_invoice.scheduled` | Its payment date was scheduled or changed. |
| `supplier_invoice.paid` | It was marked paid. |
| `portal_supplier.approved` | A supplier's registration was approved. |

`data.object` is the supplier invoice or the supplier, as `GET` returns them.
