Invoice Endpoints
Invoices are financial records synced from Stripe. Tax invoices (NFSe) are Brazilian fiscal documents issued via ISSNet (Brasilia/DF SOAP integration).
Invoice API
Base path: /wp-json/middag-account/v1/invoices
| Method | Endpoint | Auth | Scope | Description |
|---|---|---|---|---|
| GET | /invoices | JWT + Org | finances | List invoices |
| GET | /invoices/{id} | JWT + Org | finances | Invoice details |
| GET | /invoices/{id}/pdf | JWT + Org | finances | Download invoice PDF |
| GET | /invoices/order/{order_id} | JWT + Org | finances | Invoices linked to an order |
GET /invoices
Query filters: status (draft, open, paid, void, uncollectible), date_from, date_to.
Response (200):
json
{
"success": true,
"data": [
{
"id": 301,
"status": "paid",
"total": "1250.00",
"currency": "BRL",
"due_date": "2026-04-15",
"paid_at": "2026-04-10T09:15:00Z",
"order_id": 501,
"stripe_invoice_id": "in_1abc2def3ghi"
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 1,
"pages": 1
}
}GET /invoices/:id/pdf
Returns the invoice PDF as a binary download with Content-Type: application/pdf.
Tax Invoice (NFSe) Endpoints
Base path: /wp-json/middag-account/v1/tax-invoices
| Method | Endpoint | Auth | Scope | Description |
|---|---|---|---|---|
| GET | /tax-invoices | JWT + Org | finances | List NFSe |
| GET | /tax-invoices/{id} | JWT + Org | finances | NFSe details |
| GET | /tax-invoices/{id}/pdf | JWT + Org | finances | Download NFSe PDF |
| GET | /tax-invoices/order/{order_id} | JWT + Org | finances | NFSe linked to an order |
GET /tax-invoices
Query filters: status (pending, issued, cancelled, error).
Response (200):
json
{
"success": true,
"data": [
{
"id": 55,
"status": "issued",
"nfse_number": "2026000123",
"total": "1250.00",
"issued_at": "2026-04-12T10:00:00Z",
"order_id": 501
}
],
"meta": {
"page": 1,
"per_page": 20,
"total": 1,
"pages": 1
}
}Invoice Statuses
| Status | Description |
|---|---|
draft | Invoice created but not finalized |
open | Finalized and awaiting payment |
paid | Payment received (terminal) |
void | Voided / cancelled (terminal) |
uncollectible | Marked as uncollectible after failed attempts |
Tax Invoice Statuses
| Status | Description |
|---|---|
pending | Awaiting issuance via ISSNet |
issued | Successfully issued with NFSe number |
cancelled | Cancelled in the municipal system (terminal) |
error | Issuance failed -- retry via pending |