pip install fiz-sdk (Python 3.10 or later) and composer require fiz-co/sdk (PHP 8.1 or later) join the TypeScript SDK: every operation of this API typed from the OpenAPI document, an Idempotency-Key on every write that automatic retries reuse, and an error response from the API raised as an exception with its status, X-Request-Id and, when the API sent one, code. The libraries page shows each one’s first request, and the quickstart the same steps in all three.
POST /invoices/{id}/issue now issues an invoice (FT) whose every line is priced at 0 or has a 100% discount, with a total of 0, and returns it as paid; it used to fail with a server error. Otherwise an invoice, invoice-receipt or simplified invoice must still total above 0 (an invoice-receipt or simplified invoice may reach 0 only through advance deductions); one that does not, or that has no lines, is now refused with an error that names the reason instead of a server error.
See: POST /invoices/{id}/issue
Issuing a transport document without an open activity returns AT_FAILED_TO_CREATE_SERIES_NO_ACTIVITY
When AT refuses the series of a transport document because the company has no open activity, POST /transport-documents/{id}/issue now answers with codeAT_FAILED_TO_CREATE_SERIES_NO_ACTIVITY, the code invoices already return for the same refusal, instead of AT_TRANSPORT_DOCUMENT_SERIES_REGISTRATION_FAILED. The status stays 400. The fix is to open the activity on the Portal das Finanças and issue again; the other series failures keep their code.
npm install @fiz-co/sdk: every operation of this API with request and response types from the OpenAPI document, an Idempotency-Key on every write that automatic retries reuse, and errors carrying the status, the code and the response’s X-Request-Id. The quickstart shows the same steps with it.
The responses of creating, updating, issuing, paying and cancelling invoices, of credit notes, recurring invoices, pro formas, customers and series now mark as nullable every field that can be null, as GET /invoices/{id} already did: for example a customer snapshot without an email, a line without a description, or summary.totalToPay on a credit note. The responses themselves did not change; a strict client stops rejecting these nulls, and regenerated clients type the fields as nullable.
See: POST /invoices · POST /invoices/{id}/issue · POST /invoices/credit-notes
Drafts return updatedAt; invoice and transport document responses fully typed
POST /invoices and PATCH /invoices/{id} now return the draft’s updatedAt, so it can be sent as expectedUpdatedAt to POST /invoices/{id}/issue without reading the draft again. The OpenAPI document now marks every field of GET /invoices/{id} and GET /invoices as always present and says which can be null, and describes the response of every /transport-documents route (TransportDocumentResponseDto), which it left undocumented. The responses themselves did not change otherwise.
See: POST /invoices · PATCH /invoices/{id} · POST /invoices/{id}/issue · GET /transport-documents/{id}
Responses carry every field their documentation lists
Some responses left out fields their schema declared: credit notes returned three of the eleven summary amounts, invoice, recurring invoice and credit note lines missed their amounts in meta, pro formas and recurring invoices summary.creditNotesTotal, and DELETE /customers/{id} and DELETE /items/{id} returned only a few fields of the record. They now return them all, and a credit note returns what each line changes (noteChangeKind, noteChangeFrom, noteChangeTo) when it is created, updated, issued or read. Nullable enum fields list null among their values. OAuth operations also document the 429 a connection gets when its request limit is reached, with Retry-After.
See: POST /invoices/credit-notes · POST /invoices · DELETE /customers/{id} · DELETE /items/{id}
Error code, X-Request-Id and a typed error body in the specification
An error the invoicing system raises now carries a machine-readable code next to message, and every response has an X-Request-Id header to quote to support. The OpenAPI document declares the error body on every 4xx and 5xx response, lists https://api.fiz.co under servers, and names the response schemas of GET /invoices, GET /invoices/{id}, GET /bank/connections and GET /bank/transactions. It also gives a type to 49 fields that were documented as an empty object, among them the invoice summary amounts, payment and the series fields. Nothing was removed; regenerated clients gain a base URL, a typed error, named types for those four responses and the real types of those fields.
See: GET /invoices · GET /invoices/{id}
advanceRef.paymentDate is null for an unpaid FT advance
On a line with kind: ADVANCE_DEDUCTION of GET /invoices/{id}, advanceRef.paymentDate of an FT advance is now the date of its latest receipt or recorded payment, and null when none is recorded; it used to fall back to the FT date. An FR advance still gives its own date. A client with a strict schema must accept null for this field.
The POST /invoices/credit-notes response schema now declares number and atcud: null on a draft, set once the note is issued. They were already returned, so the response itself did not change; regenerated clients gain the two fields.
GET /invoices/{id} returns isAdvance and advanceBalance (total, deducted, refunded, remaining), and marks a line that deducts an advance with kind: ADVANCE_DEDUCTION. A credit note on an advance invoice uses the new reason ADVANCE_REFUND, up to the remaining balance. In a partial credit note a deducted line is credited net of its deductions, and a line its deductions cover in full is refused with 400.
See: GET /invoices/{id} · POST /invoices/credit-notes
Export, import, replace and delete PDF templates, with starters, a live field reference (including line prices with VAT), a validator that answers as import would without storing anything, and a preview PDF on a sample document. OAuth apps can install templates too: an app sees only its own and they print only the documents it issued. Print with GET /invoices/{id}/pdf?templateId=….
The partner guide now lists what a covered connection includes: API access and issuing invoices, invoice-receipts, simplified invoices, credit notes and receipts through the app, and fiscal PDF templates on those documents. Transport documents and the company’s own use of FIZ need the company’s own plan.
Every connector tool now declares an output schema and returns structured content next to its text, so a client can read the result without parsing prose.
The connector is listed in the official MCP Registry as co.fiz/fiz, and /.well-known/mcp/server-card.json describes its tools for directories that cannot sign in. Tools that only add a record (create_*) are no longer flagged as destructive, so assistants stop treating them like deletions.
The company owner can create a sandbox on the API page and its fiz_test_ keys: same base URL and requests, documents reported only to the AT test environment (never e-Fatura), PDFs marked as test documents. GET /company returns environment: production | sandbox. Bank routes and MCP refuse test keys with 403; email, payment links and issuing transport or working documents are not available, recurring schedules never run, and OAuth apps always act on production.
Lines on invoices, recurring templates and pro formas accept withholdingTaxEnabled and withholdingTaxPercent, for that document only: the catalogue item is not changed. The type follows the issuer (IRS for a sole trader, IRC for a company). false with a percentage, or true with no percentage available, is refused with 400; without these fields the line follows the item as before.
See: POST /invoices · POST /invoices/scheduled · POST /proposals
Discount and withholding fields on items deprecated
On POST /items and PATCH /items/{id}, unitDiscountType, unitDiscountPercent, unitDiscountAmount, ossCountry and the withholdingTax* fields are marked deprecated. They still work; set discounts and withholding on the document line instead.
For a company in the Azores, a SAF-T PT export could start and end a day early (a November export covering 31 October to 29 November). Periods now match the dates requested; mainland and Madeira companies were not affected.
GET /exports/saft-pt returns a temporary download link to the company’s SAF-T PT file, for month=YYYY-MM or a startDate–endDate range. It works with an API key, or with OAuth tokens that carry the new saft_pt.export scope, which existing connections do not gain: request it and ask for fresh consent.
Every tool now has a title and read-only, destructive and open-world hints, so Claude and ChatGPT ask before a tool that changes data. find_expenses and get_expense_stats without a period read the current year instead of failing.
An explicit taxRate on an item with ossCountry must now be one of that country’s current rates for the VAT band; the 400 lists the valid ones. Such rates already failed when the document was issued, so the refusal moved earlier: send a listed rate, or leave taxRate out to have it derived. The connector’s create_item accepts an OSS country and rate too.
See: POST /items · PATCH /items/{id}
Readiness no longer asks for AT sync when SAF-T is sent by hand
For API keys and personal connections, GET /company no longer reports AT_SYNC_REQUIRED for a company that submits its SAF-T monthly by hand: such a company can issue, and AT credentials are required only while AT sync is on. Registered apps keep the stricter rule. In the connector, get_company reports how documents reach the AT and the fiscal previews say what will be sent.
The GET /bank/transactions schema now documents statusCode (Accepted or Cleared), the fields already returned (payer, payee, note, merchantCategoryName) and how stable id is: a pending row can come back with another id once booked, so deduplicate on booked rows.
find_invoices rows carry the outstanding amount and the total paid, counting partial payments and credit notes, so questions like “who still owes me” get the right answer.
Items accept unitPriceWithVat instead of unitPrice and return a derived unitPriceWithVat. Lines on invoices, recurring templates and pro formas accept their own unitPrice or unitPriceWithVat for that document only; the catalogue item keeps its price. Sending both, or unitPriceWithVat with an amount discount in the same request, is refused with 400: use a percentage discount.
OAuth apps can use /transport-documents through REST and the connector: reads with invoicing.read, drafts with invoicing.write, issue and cancel with invoicing.issue. An app sees and changes only the transport documents it created, and sends addresses inline.
Unvalued transport documents; start time must be in the future
· Changed · Transport documents · Breaking change#
isValued: false creates a transport document without prices on the PDF (0.00 is reported to the AT). movementStartTime in the past is now refused with 400 on create and update, because a document cannot be issued or cancelled after its start time: send a future time. Issue accepts expectedUpdatedAt and answers 409 if the draft changed.
See: POST /transport-documents · PATCH /transport-documents/{id} · POST /transport-documents/{id}/issue
New tools to find, read, draft and update transport documents, and to issue and cancel them in two steps with confirmation. A preview is refused for a document whose start time has passed.
POST /invoices/credit-notes takes optional items, one per parent line: the returned quantity, or a lower unitPrice credited on the remaining quantity; crediting more than a line has left is refused with 400, and without items the note is still a full reversal. PATCH /invoices/{id} now refuses items on a credit or debit note draft: create a new note with items instead.
See: POST /invoices/credit-notes · PATCH /invoices/{id}
get_company returns can_issue, the blockers with the FIZ page that fixes each one, and cae_missing when the company has no activity code (the draft tools then need cae). create_item accepts a withholding percentage for sole traders.
POST /invoices/{id}/cancel accepts an optional reason (up to 500 characters), reported to the AT. The docs now say when to cancel (formal errors, an operation that never happened, then re-issue) and when to raise a credit note instead.
POST /customers/{id}/restore brings back an archived customer, and customer responses carry isArchived. Find an archived one with GET /customers?isArchived=true.
See: POST /customers/{id}/restore · GET /customers
GET /company and the connector’s get_company return vatSettings: the company’s selectedVATRegime and ossEnabled. The regime is the starting point of automatic VAT, not the tax of a line.
The send_feedback tool, under the new support.write permission, sends a bug report or feature request to FIZ support in the user’s name, only after the user confirms the exact text. Existing connections reconnect to grant it.
GET /expenses lists the purchase documents imported from e-Fatura for a year, quarter or date range, with their category, VAT per rate and deductible VAT; GET /expenses/stats summarises the same period. Available with an API key or the new OAuth scope expenses.read, and in the connector as find_expenses and get_expense_stats.
GET /company returns grantedScopes, requestedScopes and, for an OAuth app, its installation. A new readiness reason, SCOPE_MISSING, appears when the company granted less than the app asks for; its actionUrl opens the app’s install page.
The quickstart goes from an API key to an issued invoice in five requests, with a prompt to hand the work to a coding agent. Markdown editions of the docs and an llms.txt index let agents read them without a browser.
A guide and a working example for building a product on FIZ: registering an app, OAuth with PKCE, partner signup, permissions, token refresh, idempotent retries and the review before production.
A registered app can call the invoice, customer, item, company and series endpoints with a bearer token, under invoicing.read, invoicing.read_all, invoicing.write, invoicing.issue and company.read. An app reads its own records unless granted invoicing.read_all. Each grant has a budget of 300 requests per minute; over it the API answers 429 with Retry-After.
GET /company returns the company and its readiness to issue, with a reason code and the page that fixes each blocker. Invoice responses carry updatedAt, and POST /invoices/{id}/issue accepts it as an optional expectedUpdatedAt: a draft changed since then is refused.
Create, list, read, cancel, delete and download pro formas: numbered at creation, never reported to the AT, no fiscal effect. A pro forma lists the invoices raised from it. The connector gains find_proposals, get_proposal and create_proposal.
Create, list, read, change, pause, resume and delete schedules that FIZ issues and reports to the AT on its own. Every document a schedule issues carries scheduleTemplateId, so GET /invoices?scheduleTemplateId=… reconciles what went out. Requires a plan with recurring invoices.
See: POST /invoices/scheduled · PATCH /invoices/scheduled/{id}
Every write endpoint accepts an optional Idempotency-Key header: a retry with the same key and body returns the original response and status, with Idempotent-Replayed: true, instead of writing twice. The same key with another body is a 422; keys are kept 30 days. Without the header nothing changes.
https://api.fiz.co/mcp is an MCP server: sign in to FIZ with OAuth and choose the company and permissions. The assistant reads customers, items, invoices, series and bank transactions, creates drafts, and issues, records payments, cancels or credits only in two steps, after the user confirms each one.
POST /invoices and PATCH /invoices/{id} accept an optional date, the date printed on the document, which sets its tax period. Without it, create uses today and an update keeps the stored date; an omitted dueDate follows the issue date.
See: POST /invoices · PATCH /invoices/{id}
August 2026
Issuing returns the document number; dueDate is optional
POST /invoices/{id}/issue now returns the issued document’s number, atcud and shortHash. dueDate is optional on POST /invoices and defaults to the issue date. The issue response is documented under status 200, the status it has always returned.
A line or item discount can now be 100%, or an amount equal to the unit price, so an item given away stays on the document at no charge. Only an amount above the unit price is refused.
See: POST /invoices · POST /items
taxRate derived when omitted; stricter VAT territory
POST /items and PATCH /items/{id} no longer need taxRate: it is derived from vatRate and the territory or the OSS country, and is 0 for exempt items. vatTerritory now accepts only CONTINENTAL, MADEIRA or AZORES and is refused together with ossCountry: send one or the other. Where an OSS country has two rates in one category, taxRate is still required.
POST /invoices and PATCH /invoices/{id} accept an optional taxPointDate, the date the goods or services were supplied. It defaults to the issue date and cannot be later than it; credit and debit notes take the original document’s date. Invoice responses return it.
POST /items and PATCH /items/{id} accept unitDiscountType with unitDiscountPercent or unitDiscountAmount; send unitDiscountType: null to remove it. Item responses return these fields.
Each line in items on POST /invoices and PATCH /invoices/{id} can carry discountType with discountPercent or discountAmount (per unit, before VAT). It replaces the item’s own discount on that line only and applies before the global discount.
POST /invoices/{id}/pay returns the receipt it issued; its id works with GET /invoices/{id}/pdf. GET /invoices accepts parentInvoiceId, and with documentType=RECEIPT lists one invoice’s receipts.
POST /invoices/{id}/pay records a payment with a method, a date and an optional amount; without an amount it settles the whole outstanding balance. The payment issues a receipt (RG).
A draft whose items were changed with PATCH /invoices/{id} could be accepted and then fail at issue. Each line now takes the item’s current data, and an item missing what a line needs is refused with a 400 that names the missing fields.
/-json and /-yaml now describe every endpoint in English; the Portuguese document is at /-json-pt and /-yaml-pt. Paths and schemas are unchanged, but descriptions in generated clients change language.
Create, update, issue (reported to the AT), cancel, delete, list and download guias de transporte of every movement type (GR, GT, GA, GC, GD). Lines are { id, quantity } as on invoices, and addresses are sent inline.
See: POST /transport-documents · POST /transport-documents/{id}/issue
POST /vat/calculate returns the VAT rate, exemption reason and legal text for a sale from customer and item data, without creating a document — OSS, reverse charge, intra-EU supplies and the autonomous regions included. POST /vat/validate-client checks a customer’s VAT number. The calculation needs a plan with automatic VAT (402 otherwise).
See: POST /vat/calculate · POST /vat/validate-client
POST /invoices/credit-notes credits an issued invoice in full, with a reason code and an optional text; it is issued at once unless you send issue: false. POST /invoices/{id}/cancel cancels an issued invoice.
See: POST /invoices/credit-notes · POST /invoices/{id}/cancel
GET /series lists the account’s active series. Pass an id as seriesId on POST /invoices or PATCH /invoices/{id} to issue in that series; without it the default series is used.
GET /bank/connections lists the account’s linked banks and GET /bank/transactions returns one connection’s transactions, with date, text, direction and type filters and pagination. An account without bookkeeping access gets 403.
See: GET /bank/connections · GET /bank/transactions
POST /invoices accepts notes. PATCH /invoices/{id} changes a draft: only the fields you send change, and a document that is no longer a draft is refused.
POST /invoices accepts a discount on the whole document in summary: globalDiscountType (PERCENT or AMOUNT) with globalDiscountPercent or globalDiscountAmount. Invoice responses return the discount totals.
API-key access (x-api-key) to customers and items (create, list, read, archive) and to invoices: create a draft, issue it, list, read or delete it, and get its PDF.
See: POST /invoices · POST /invoices/{id}/issue · GET /invoices/{id}/pdf
About this changelog
Every entry is a change an integrator or a connector user can see: a new endpoint, field, parameter, permission or MCP tool, or a change in what the API accepts or returns. It is dated the day it became available in production. Fixes that change nothing you can observe are not listed.
The API is not versioned. Changes are additive unless an entry is marked Breaking change; such an entry says what to change in your integration.
Follow it with any feed reader: Atom feed (Portuguese: /docs/changelog.xml?lang=pt). For coding agents the page is also available as Markdown. Each entry has a permanent link (# next to its date).