Changes to generic fields

invoiceRefs is optional

Portugal specific fields

type CreditNote {
  // ... all generic credit note fields
  lines: InvoiceLine[];
  invoiceRefs: string[],
  customInfo: {
    prt: {
      goodsServiceAvailableDate?: string;
      note? string;
      paymentMeansCode: PaymentMeansCode;
      paymentMeansDueDate:
      reason: string;
    }
  }
}

type InvoiceLine {
  itemCode: string;
  description: string;
  unit: UnitsOfMeasure;
  quantity?: number;
  vat: {
    type: 'fixed' | 'percent';
    code: TaxCode;
    amount: number;
    exemptReason?: string;
    exemptReasonCode?: PortugalExemptionReasonCodes;
  };
  price: {
    amount: number;
  };
}
NameTypeRequiredDescription
invoiceRefsstring arrayYesInvoices associated with this document. Only one invoice reference is allowed.
lines[].itemCodestringYesAn identifier for the item.
lines[].descriptionstringYesDescription of the goods or service
lines[].unitstringYesA value from an enumerated list as outlined on Units of Measure
lines[].quantitynumberNoQuantity of the good or service
lines[].vat.typestringYesA value from an enumerated list of types:
"fixed"
"percent"
lines[].vat.codestringYesA value from an enumerated list of types:
"PRT-NOR": Standard rate
"PRT-ISE": Exempt from Tax
"PRT-NS": Tax-exempt/Out of scope services
"PRT-RED: Reduced or lower rate
"PRT-INT": Intermediate rate is a special VAT rate applied to certain goods and services that do not fall under the standard or reduced rates
lines[].vat.exemptReasonstringConditionalIf the line VAT amount is 0, an exemption reason is required.
lines[].vat.exemptReasonCodestringConditionalIf the line VAT amount is 0, a value from an enumerated list outlined on Portugal exemption reason codes is required.
lines[].vat.amountnumberYesVAT percent or value per item
lines[].price.amountnumberYesUnit price of the good or service
invoiceRefsstringYesAn array of existing invoices
customInfo.prt.goodsServiceAvailableDatestring (ISO 8601 date)NoThe date that the goods or services are available.
customInfo.prt.notestringNoDocument note
customInfo.prt.paymentMeansCodestringYesA value from an enumerated list as outlined on Payments Means
customInfo.prt.paymentMeansDueDatestring (ISO 8601 date)yesDue date of invoice
customInfo.prt.reasonstring yesReason for credit.

Example CSV file

Credit note - Portugal.csv