Skip to main content

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.

ValueNameDescription
M01Artigo 16.º n.º 6 do CIVA (Ou similar)Artigo 16.º n.º 6 alínea a) a d) do CIVA
M02Artigo 6.º do Decreto-Lei n.º 198/90, de 19 de JunhoArtigo 6.º do Decreto-Lei n.º 198/90, de 19 de Junho
M03Exigibilidade de caixaDecreto-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
M04Isento Artigo 13.º do CIVA (Ou similar)Artigo 13.º do CIVA
M05Isento Artigo 14.º do CIVA (Ou similar)Artigo 14.º do CIVA
M06Isento Artigo 15.º do CIVA (Ou similar)Artigo 15.º do CIVA
M07Isento Artigo 9.º do CIVA (Ou similar)Artigo 9.º do CIVA
M08IVA - AutoliquidaçãoArtigo 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
M09IVA - Não confere direito a deduçãoArtigo 60.º CIVA; Artigo 72.º n.º 4 do CIVA
M10IVA - Regime de isençãoArtigo 53.º do CIVA
M11Regime particular do tabacoDecreto-Lei n.º 346/85, de 23 de Agosto
M12Regime da margem de lucro - Agências de ViagensDecreto-Lei n.º 221/85, de 3 de Julho
M13Regime da margem de lucro - Bens em segunda mãoDecreto-Lei n.º 199/96, de 18 de Outubro
M14Regime da margem de lucro - Objetos de coleção e antiguidadesDecreto-Lei n.º 199/96, de 18 de Outubro
M15Regime da margem de lucro - Objetos de arteDecreto-Lei n.º 199/96, de 18 de Outubro
M16Isento Artigo 14.º do RITI (Ou similar)Artigo 14.º do RITI
M99Nã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)
note

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.

CodeDocumentPortuguese nameNumber prefixSAF-T typeCreated with
TInvoice/ReceiptFatura-ReciboFRFRCreate Document
IInvoiceFaturaFTFTCreate Document
SSimplified InvoiceFatura SimplificadaFSFSCreate Document
CCredit NoteNota de CréditoNCNCCreate Document
DDebit NoteNota de DébitoNDNDCreate Document
BQuoteOrçamentoOORCreate Document
PPro-forma InvoicePro-formaPFPFCreate Document
ZPurchase OrderNota de EncomendaPONECreate Document
WWaybillGuia de TransporteGTGTCreate Waybill
YDelivery NoteGuia de RemessaGRGRCreate Waybill
RReceiptReciboRG, or RC under cash-basis VAT (IVA de caixa)RG / RCNot available in the API
  • Number prefix is how the document number starts, for example FT FT/40420 for an invoice in series FT.
  • 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" with TypeInvalid. Create Waybill accepts either case.
  • Create Document accepts T, I, S, C, D, B, P and Z. Create Waybill accepts only W and Y. Sending W or Y to Create Document returns TypeInvalid.
  • 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 isIt 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 - Portugal
  • ES - Spain
  • FR - France
  • DE - Germany
  • BR - Brazil

Currency Codes​

For currency codes, use the ISO 4217 standard.

Common examples:

  • EUR - Euro
  • USD - US Dollar
  • GBP - British Pound
  • BRL - Brazilian Real