# Invoices and receipts (/developers/invoices)

Fianto makes one document in the merchant's name for every payment that succeeds: an invoice when the
merchant has turned invoices on, otherwise a payment receipt. Later corrections are credit notes and,
when company details are added, a replacement invoice. Your server can read these documents with
three read-only v1 routes, and follows them through the `invoice.*` and `credit_note.issued` webhook
events. What the merchant sees is in [Invoices](/merchants/invoices).

## What your application can read [#what-your-application-can-read]

Every read is scoped to the calling application, as `/v1/payments` is. An application sees the
documents of payments made through it: the invoice or receipt of each one-time payment, subscription
payment and renewal, and the credit notes and replacement invoices made for them. A draft is never
shown.

Invoices and payment requests the merchant writes in the dashboard belong to the merchant's Shop
application, which holds no secret, so no API key can read them. They reach you only through the Shop
application's webhooks; see [Payment link sales](/developers/payment-link-sales) for how that
application works.

The SDK has no methods for these routes yet: call them over HTTP with your app id and secret, as in
[Authentication](/developers/authentication).

## List documents [#list-documents]

`GET /v1/invoices` returns your documents, newest issued first, as `{ "items": [...], "next_cursor" }`.

| Query                        | Values                                                                                                 |
| ---------------------------- | ------------------------------------------------------------------------------------------------------ |
| `document_type`              | `invoice`, `receipt` or `payment_request`. A credit note has the type of the document it credits       |
| `status`                     | `open`, `overdue`, `part_paid`, `paid`, `credited`, `part_credited`, `void` or `issued` (credit notes) |
| `created_gte`, `created_lte` | ISO 8601 times, both included, on `issued_at`                                                          |
| `cursor`                     | The previous page's `next_cursor`                                                                      |
| `limit`                      | 1 to 100; 20 when left out                                                                             |

`open` includes overdue and part-paid documents, and `paid` includes credited ones. `overdue` is an
open document whose due date is before today in the merchant's issue time zone. `next_cursor` is
`null` on the last page. An unknown query parameter is a `400`.

```bash
curl "https://api.fianto.xyz/v1/invoices?document_type=invoice&limit=10" \
  --user "$FIANTO_APP_ID:$FIANTO_APP_SECRET"
```

## Read one [#read-one]

`GET /v1/invoices/{id}` returns one document by its id, `fian_inv_` followed by letters and digits.

```json
{
  "id": "fian_inv_3hQm7Rk2XbV9cTnL4pWs8d",
  "object": "invoice",
  "number": "INV-0042",
  "kind": "invoice",
  "document_type": "invoice",
  "status": "paid",
  "source": "checkout",
  "issue_date": "2026-09-28",
  "due_date": null,
  "currency": "USD",
  "subtotal": "20830000",
  "tax_amount": "4170000",
  "total": "25000000",
  "credited_amount": "0",
  "customer": {
    "id": "fian_cus_0cJCFTfDw8ZkPLbdr7m2d62PU0SL",
    "wallet": "FxLsWPrqTpmc1yHrKoYj8SE75mAzavKwPDen7Y2xF7pw",
    "email": "ada@example.com",
    "reference": "user_42"
  },
  "payment": {
    "id": "fian_pay_5caFRGUqMblmAgHXQ22uKn0hcZSj",
    "signature": "dbmKAFCAkMz8B2QTsHWkF1GtGVWQkjqXszoGh3XqDsyqsE26ftxJBSAeCpymBVfFGAjA8k6wG52JoKUcwo4nyMN"
  },
  "order_id": "order_1001",
  "subscription_id": null,
  "replaces": null,
  "credits": null,
  "created_at": "2026-09-28T10:02:20.000Z",
  "network": "mainnet",
  "issued_at": "2026-09-28T10:02:20.000Z"
}
```

## Download the PDF [#download-the-pdf]

`GET /v1/invoices/{id}/pdf` returns the document as `application/pdf`, as a download named like
`Invoice_INV-0042_Acme-Ltd_2026-09-28.pdf`. The PDF includes the buyer's company details, which the
JSON leaves out. The response is never cached.

```bash
curl -OJ "https://api.fianto.xyz/v1/invoices/fian_inv_3hQm7Rk2XbV9cTnL4pWs8d/pdf" \
  --user "$FIANTO_APP_ID:$FIANTO_APP_SECRET"
```

## The document object [#the-document-object]

The same object is the `data` of every invoice webhook event except `invoice.payment_recorded`. The
v1 routes add `issued_at`.

| Field                                                | Meaning                                                                                                                                                                                        |
| ---------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `id`                                                 | `fian_inv_…`                                                                                                                                                                                   |
| `object`                                             | `invoice`, or `credit_note` for a credit note                                                                                                                                                  |
| `number`                                             | Such as `INV-0042`, `REQ-0003` or `CN-0004`. `null` for a payment receipt, which goes by its payment's number                                                                                  |
| `kind`                                               | `invoice` or `credit_note`                                                                                                                                                                     |
| `document_type`                                      | `invoice`, `receipt` or `payment_request`. A credit note has its original's type                                                                                                               |
| `status`                                             | `open`, `paid`, `void` or `issued` (a credit note)                                                                                                                                             |
| `source`                                             | `checkout` (a one-time payment), `subscription`, `manual` (written in the dashboard) or `external` (issued for a transfer the merchant recorded)                                               |
| `issue_date`, `due_date`                             | `YYYY-MM-DD`, or `null`                                                                                                                                                                        |
| `currency`                                           | Always `USD`. The payer pays in USDC, valued at 1.00 USD, or in US dollars by card                                                                                                             |
| `subtotal`, `tax_amount`, `total`, `credited_amount` | Strings in base units, 6 decimals: `"25000000"` is 25.00 USD. `subtotal` is `total` less `tax_amount`. `total` is the merchant's price: the service fee and the network fee are not part of it |
| `customer`                                           | The payer's customer id, wallet, email (as typed, unverified) and the merchant's own reference                                                                                                 |
| `payment`                                            | The payment and its transaction signature. Both `null` on a credit note and on a document nobody has paid                                                                                      |
| `order_id`                                           | Your own `order_id`. `null` for a document the merchant wrote                                                                                                                                  |
| `subscription_id`                                    | The subscription a subscription payment belongs to, or `null`                                                                                                                                  |
| `replaces`                                           | The id of the invoice this one replaces, or `null`                                                                                                                                             |
| `credits`                                            | On a credit note, the id of the document it credits                                                                                                                                            |
| `created_at`                                         | When the document was created                                                                                                                                                                  |
| `network`                                            | `mainnet`                                                                                                                                                                                      |
| `issued_at`                                          | v1 only: when it was issued                                                                                                                                                                    |

The buyer's company name, address, tax ID and company number are never in the JSON. They are on the
PDF.

## Webhook events [#webhook-events]

Invoice events go to the endpoint of the application the document belongs to: yours for documents of
payments made through it, the Shop application's for documents the merchant writes.

| Event                      | When                                                                                                                                                                                                                          |
| -------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `invoice.issued`           | A document was issued: the invoice or receipt of a payment, an invoice or payment request the merchant finalized, a replacement invoice, a paid payment request's receipt, or a document for a transfer the merchant recorded |
| `invoice.paid`             | An invoice or payment request the merchant wrote was paid, through its link or by transfers the merchant recorded                                                                                                             |
| `invoice.payment_recorded` | A transfer the merchant recorded was applied to an invoice or payment request                                                                                                                                                 |
| `invoice.voided`           | The merchant voided an open invoice or payment request                                                                                                                                                                        |
| `credit_note.issued`       | A credit note was issued: after a void, a refund checked on Solana, a card refund that succeeded, or company details added later                                                                                              |

Payloads and the exact moment each is sent are on [Event types](/developers/webhooks/events#invoices).
The SDK's webhook handlers have a typed callback for each: `onInvoiceIssued`, `onInvoicePaid`,
`onInvoicePaymentRecorded`, `onInvoiceVoided` and `onCreditNoteIssued`.

## Not on devnet [#not-on-devnet]

Devnet does not serve invoices: its API has no `/v1/invoices` routes, and it sends no invoice events.
If invoices are not available on Fianto yet, the routes answer `404` with no `code`.

## Troubleshooting [#troubleshooting]

| You see | Why | Fix |
|---|---|---|
| 404 `invoice_not_found` | No document with that id belongs to your application: another application's, a document the merchant wrote, a draft, or an unknown id. | Use an id from `GET /v1/invoices` or from a webhook to your own endpoint. |
| 400 `cursor_invalid` | `cursor` is not the id of one of your documents. | Start again from the first page. |
| 400 `validation_failed` | An unknown query parameter, or a value outside the lists above. | Check the name and value of each filter. |
| 404 with no `code` | Invoices are not available on Fianto yet, or you called devnet. | Call mainnet once invoices are available. |

## See also [#see-also]

- [Event types](/developers/webhooks/events#invoices): Each invoice event and its payload.

- [Invoices](/merchants/invoices): What the merchant sees and sets.

- [Pagination and rate limits](/developers/pagination-and-rate-limits): Cursors and read limits.