Appendix
This page contains reference data and additional information for the MagniFinance API.
Tax Exemption Reasons
The following table lists the valid tax exemption reason codes that can be used in the TaxExemptionReasonCode field when creating documents with 0% tax.
| Value | Name | Description |
|---|---|---|
| M01 | Artigo 16.º n.º 6 do CIVA (Ou similar) | Artigo 16.º n.º 6 alínea a) a d) do CIVA |
| M02 | Artigo 6.º do Decreto-Lei n.º 198/90, de 19 de Junho | Artigo 6.º do Decreto-Lei n.º 198/90, de 19 de Junho |
| M03 | Exigibilidade de caixa | Decreto-Lei n.º 204/97, de 9 de Agosto; Decreto-Lei n.º 18/99, de 21 de Outubro; Lei n.º 15/2009, de 1 de Abril |
| M04 | Isento Artigo 13.º do CIVA (Ou similar) | Artigo 13.º do CIVA |
| M05 | Isento Artigo 14.º do CIVA (Ou similar) | Artigo 14.º do CIVA |
| M06 | Isento Artigo 15.º do CIVA (Ou similar) | Artigo 15.º do CIVA |
| M07 | Isento Artigo 9.º do CIVA (Ou similar) | Artigo 9.º do CIVA |
| M08 | IVA - Autoliquidação | Artigo 2.º n.º 1 alínea i), j) ou l) do CIVA; Artigo 6.º do CIVA; Decreto-Lei n.º 21/2007, de 29 de Janeiro; Decreto-Lei n.º 362/99, de 16 de Setembro |
| M09 | IVA - Não confere direito a dedução | Artigo 60.º CIVA; Artigo 72.º n.º 4 do CIVA |
| M10 | IVA - Regime de isenção | Artigo 53.º do CIVA |
| M11 | Regime particular do tabaco | Decreto-Lei n.º 346/85, de 23 de Agosto |
| M12 | Regime da margem de lucro - Agências de Viagens | Decreto-Lei n.º 221/85, de 3 de Julho |
| M13 | Regime da margem de lucro - Bens em segunda mão | Decreto-Lei n.º 199/96, de 18 de Outubro |
| M14 | Regime da margem de lucro - Objetos de coleção e antiguidades | Decreto-Lei n.º 199/96, de 18 de Outubro |
| M15 | Regime da margem de lucro - Objetos de arte | Decreto-Lei n.º 199/96, de 18 de Outubro |
| M16 | Isento Artigo 14.º do RITI (Ou similar) | Artigo 14.º do RITI |
| M99 | Não sujeito; não tributado (Ou similar) | Outras situações de não liquidação do imposto (Exemplos: artigo 2.º, n.º 2; artigo 3.º, n.ºs 4, 6 e 7; artigo 4.º, n.º 5, todos do CIVA) |
The codes in the Value column are the valid values to be filled in requests with the TaxExemptionReasonCode field.
Document Types
Every document has a one-letter type code. You send it in the Type field when you create a document, and Get Document returns it in the same field.
| Code | Document | Portuguese name | Number prefix | SAF-T type | Created with |
|---|---|---|---|---|---|
T | Invoice/Receipt | Fatura-Recibo | FR | FR | Create Document |
I | Invoice | Fatura | FT | FT | Create Document |
S | Simplified Invoice | Fatura Simplificada | FS | FS | Create Document |
C | Credit Note | Nota de Crédito | NC | NC | Create Document |
D | Debit Note | Nota de Débito | ND | ND | Create Document |
B | Quote | Orçamento | O | OR | Create Document |
P | Pro-forma Invoice | Pro-forma | PF | PF | Create Document |
Z | Purchase Order | Nota de Encomenda | PO | NE | Create Document |
W | Waybill | Guia de Transporte | GT | GT | Create Waybill |
Y | Delivery Note | Guia de Remessa | GR | GR | Create Waybill |
R | Receipt | Recibo | RG, or RC under cash-basis VAT (IVA de caixa) | RG / RC | Not available in the API |
- Number prefix is how the document number starts, for example
FT FT/40420for an invoice in seriesFT. - SAF-T type is the code the document has in the SAF-T (PT) file. Quotes and purchase orders use a different code there (
OR,NE) than in their number (O,PO). - Codes are upper case. Create Document rejects a lower-case code such as
"t"withTypeInvalid. Create Waybill accepts either case. - Create Document accepts
T,I,S,C,D,B,PandZ. Create Waybill accepts onlyWandY. SendingWorYto Create Document returnsTypeInvalid. - Receipts (
R) can't be created through the API.
Which types your account can issue
There is no per-type switch: you can issue a type when your account has an active series for it. Without one, the request fails with SerieDataNotMatch. Create and view series in MagniFinance under Settings → General → Document series. Every series must also be communicated to the Portuguese Tax Authority (AT) before documents can be issued in it.
Other limits:
- Simplified invoices (
S) are capped by Portuguese law: a net total of €1,000 when every line is a product, €100 otherwise. Above that, issue an invoice (I) or invoice/receipt (T). - IPPN partners can issue only invoice/receipts (
T) and credit notes (C) by default. See Create Document for the details.
Document references
A document can reference an earlier one through DocumentReference. Credit notes (C) and debit notes (D) must reference the invoice they correct. For every other type the reference is optional.
| When the referenced document is | It can be referenced by |
|---|---|
Invoice/Receipt, Invoice or Simplified Invoice (T, I, S) | Credit Note, Debit Note (C, D) |
Quote, Pro-forma Invoice or Purchase Order (B, P, Z) | T, I, S, C, D |
Waybill or Delivery Note (W, Y) | Invoice/Receipt, Invoice or Simplified Invoice (T, I, S) |
Credit Note, Debit Note or Receipt (C, D, R) | Nothing: these can't be referenced |
The referenced document must be closed, belong to the same company, and have a date no later than the new document's.
Country Codes
For country codes, use the ISO 3166-1 alpha-2 standard.
Common examples:
PT- PortugalES- SpainFR- FranceDE- GermanyBR- Brazil
Currency Codes
For currency codes, use the ISO 4217 standard.
Common examples:
EUR- EuroUSD- US DollarGBP- British PoundBRL- Brazilian Real