Schema Objects

Full Global E-Invoice object reference

View as Markdown

This page documents every object in the Staple Global E-Invoice schema. Each table shows fields, types, requiredness, descriptions, and country-specific notes. Required values marked Optional* are conditionally required by some countries — check the country notes column.

Conventions

These conventions apply across the entire schema unless a specific field overrides them.

  • Date fields - All fields of type string (date) use the format YYYY-MM-DD.
  • Time fields - All fields of type string (time) use the format HH:MM:SS in UTC. Milliseconds are not supported.
  • Amount fields - All fields of type string (decimal) are represented with 2 decimal places, e.g. "1500.00".
  • Percent fields - All percent fields use string (decimal), e.g. "7.0" for 7%.
  • Country codes - Use ISO 3166-1 alpha-2 codes.
  • Currency codes - Use ISO 4217 codes.

Quick links: Invoice · Address · Advance · Attachment · Card · Charge · CreditTransfer · DeliveryDetails · DirectDebit · Discount · DocumentRef · DueDate · ExchangeRate · Identity · Inbox · Item · Line · LineCharge · LineDiscount · Name · Note · Online · Ordering · Party · PayInstructions · PaymentDetails · PayTerms · Period · Person · Registration · Stamp · Tax · TaxCombo · TaxIdentity · Totals

Invoice

Root object — top-level invoice document.

FieldTypeRequiredDescriptionCountry Notes
CountrystringRequiredAlpha-2 country code identifying the tax regime.
ComplianceStandardsstring[]OptionalAddon keys that activate country-specific validation rules. e.g. ["eu-en16931-v2017","de-xrechnung-v3"]🇩🇪 Required for DE. 🇮🇹 Required for IT. 🇫🇷 Required for FR. 🇲🇽 Required for MX. 🇵🇱 Required for PL.
TypeFlagsstring[]OptionalScenario tags: simplified, reverse-charge, self-billed, partial, prepayment🇪🇺 Use reverse-charge for EU cross-border B2B transactions.
UUIDstring (uuid)OptionalUniversally unique identifier for the invoice.
TypestringOptionalInvoice type. Defaults to standard. Allowed values: standard, credit-note, debit-note, corrective, proforma.
DocGroupstringOptionalInvoice series / group identifier. Groups invoices by project, date range, or type. Prepended to DocNumber with a dash when output format has no series field.
DocNumberstringRequiredSequential invoice number. Max 50 characters. e.g. "INV-0042"
IssueDatestring (date)RequiredInvoice issue date in YYYY-MM-DD format.
IssueTimestring (time)OptionalInvoice issue time in HH:MM:SS format.🇲🇽 🇲🇾 Required for MX and MY.
OpDatestring (date)OptionalDate when the invoiced operation became effective.
ValueDatestring (date)OptionalDate taxes become accountable. Defaults to IssueDate.
CurrencystringRequiredISO 4217 currency code. e.g. "EUR", "MYR", "MXN"
ExchangeRatesExchangeRate[]OptionalExchange rates for converting foreign currency amounts.🇲🇾 Required when invoice currency is not MYR.
PrecedingDocumentRef[]OptionalReferences to prior invoices this document replaces or extends.Required when Type is credit-note, corrective, or debit-note.
TaxTaxOptionalInvoice-level tax configuration. See Tax object for details.
SupplierPartyRequiredThe entity issuing the invoice and responsible for tax obligations.
CustomerPartyOptionalThe entity receiving the goods or services. May be omitted for simplified invoices.🇲🇾 🇩🇪 🇮🇹 Required for MY B2B, DE, IT.
LinesLine[]OptionalInvoice line items. Recommended for all invoices.
DiscountsDiscount[]OptionalInvoice-level discounts applied to the whole document.
ChargesCharge[]OptionalInvoice-level surcharges applied to the whole document.
OrderingOrderingOptionalOrdering details including purchase order references and buyer/seller parties.🇩🇪 Buyer reference in Ordering.Code required for DE XRechnung.
PaymentPaymentDetailsOptionalPayment terms, instructions, and advance payments.
DeliveryDeliveryDetailsOptionalDelivery address, date, and receiver details.🇲🇾 Used for shipping recipient details in MY.
NotesNote[]OptionalFree-text annotations, legal details, or correction reasons.🇪🇸 VeriFactu requires a general key note.
Complementsstring[]OptionalStructured country-specific complement values.🇲🇽 Used for CFDI payment complements in MX.
AttachmentsAttachment[]OptionalSupporting documents. Not for alternative PDF versions.
MetastringOptionalSemi-structured data that does not fit the main body.
TotalsTotalsCalculatedSummary of all invoice totals including taxes. Computed server-side — do not submit.

Type values

ValueDescription
standardA regular commercial invoice document between a supplier and customer.
credit-noteReflects a refund, either partial or complete, of the preceding document. A credit note effectively extends the previous document.
debit-noteAn additional set of charges to be added to the preceding document.
correctiveCorrected invoice that completely replaces the preceding document.
proformaFor a client’s validation before sending a final invoice.

Party

Used for Supplier, Customer, and embedded party references in Ordering and Delivery.

FieldTypeRequiredDescriptionCountry Notes
NamestringOptional*Legal name of the organization or individual.🇲🇾 Required, max 300 chars.
AliasstringOptionalAlternate short name.
TaxIDTaxIdentityOptional*Tax registration identity. Determines the invoice tax regime when Invoice.Country is omitted.🇲🇾 🇩🇪 🇲🇽 🇮🇹 Required for most countries.
IdentitiesIdentity[]OptionalAdditional registration codes: BRN, SST, NRIC, MSIC, Peppol ID, GLN, etc.🇲🇾 Required: BRN or NRIC, SST number, MSIC code.
PeoplePerson[]OptionalPhysical contact persons representing the party.
InboxesInbox[]OptionalElectronic document delivery inboxes. e.g. Peppol participant ID.🇩🇪 Peppol inbox required for DE Peppol delivery.
AddressesAddress[]Optional*Postal addresses.🇲🇾 🇩🇪 🇮🇹 Required for MY, DE, IT.
Emailsobject[]OptionalEmail addresses. Each object has a single Addr string field.
Telephonesobject[]OptionalPhone numbers. Each object has a single Num string field.🇲🇾 Optional but recommended for MY.
RegistrationRegistrationOptionalCompany registration details such as capital, office, and book entries.🇮🇹 Required for IT (company registration).
ExtstringOptionalRegime-specific extension codes for the party.
MetastringOptionalAdditional semi-structured data.🇲🇾 Use for MSIC business activity description: key msic-description.

TaxIdentity

Tax registration details for a party.

FieldTypeRequiredDescriptionCountry Notes
CountrystringRequiredAlpha-2 country code where the tax ID was issued.
CodestringOptional*The tax identification number. Format varies by country: VAT number, TIN, RFC, GST ID, etc.🇲🇾 TIN (max 14 chars). 🇲🇽 RFC format. 🇩🇪 USt-IdNr format.
SchemestringOptionalOverride the default tax scheme. e.g. "VAT", "GST"

Address

Postal or fiscal address.

FieldTypeRequiredDescriptionCountry Notes
NumstringOptionalHouse or building number.
StreetstringOptional*First line of the street address.
StreetExtrastringOptionalAdditional street address line.
LocalitystringOptional*City, town, or district name.
RegionstringOptionalProvince, county, or state name.
StatestringOptionalState or province code where required.🇲🇽 Required for MX.
CodestringOptional*Post or ZIP code.
CountrystringOptional*ISO alpha-2 country code.
PoBoxstringOptionalPost office box number.

Identity

Additional registration or classification code for a party or item.

FieldTypeRequiredDescriptionCountry Notes
CodestringRequiredThe actual identity value. e.g. "202001234567"
KeystringOptionalClassification key. Common values: BRN, NRIC, PASSPORT, SST, MSIC, TTX, TIN. Mutually exclusive with Type.🇲🇾 Use BRN, SST, MSIC keys for MY.
TypestringOptionalContext-specific type code. Mutually exclusive with Key.
LabelstringOptionalHuman-readable label. e.g. "GLN", "DUNS"
ScopestringOptionalContext: tax or legal.
CountrystringOptionalCountry that issued this identity (alpha-2).

Inbox

Electronic document delivery inbox, e.g. Peppol participant ID.

FieldTypeRequiredDescriptionCountry Notes
SchemestringOptionalScheme ID (ISO 6523 or CEF code). e.g. "0088" for GLN, "0192" for Peppol.
CodestringOptionalInbox identifier code. Mutually exclusive with URL and Email.
URLstringOptionalInbox URL. Mutually exclusive with Code and Email.
EmailstringOptionalInbox email address. Mutually exclusive with Code and URL.
KeystringOptionalType of inbox for disambiguation between multiple inboxes.

Person

A physical contact person representing a party.

FieldTypeRequiredDescriptionCountry Notes
NameNameRequiredStructured name of the person.
LabelstringOptionalRole label. e.g. "Attn", "Contact"
RolestringOptionalJob title or role description.
Emailsobject[]OptionalEmail addresses belonging to the person.
Telephonesobject[]OptionalPhone numbers belonging to the person.

Name

Structured personal name.

FieldTypeRequiredDescriptionCountry Notes
GivenstringOptionalFirst or given name.
SurnamestringOptionalFamily name.
Surname2stringOptionalSecond family name, common in Spanish-speaking countries.
PrefixstringOptionalName prefix. e.g. "Mr.", "Dr."
AliasstringOptionalPreferred name or nickname.

Registration

Company registration details required by some countries.

FieldTypeRequiredDescriptionCountry Notes
Capitalstring (decimal)OptionalShare capital amount.🇮🇹 Required for IT.
CurrencystringOptionalCurrency of the capital (ISO 4217).
OfficestringOptionalRegistration office name.
EntrystringOptionalRegistry entry number.

Line

A single row in the invoice.

FieldTypeRequiredDescriptionCountry Notes
Quantitystring (decimal)RequiredNumber of units. e.g. "10.00"
ItemItemRequiredProduct or service details.
TaxesTaxCombo[]Optional*Tax categories applicable to this line.Required for all countries with tax obligations.
DiscountsLineDiscount[]OptionalDiscounts applied to this line.
ChargesLineCharge[]OptionalCharges applied to this line.
PeriodPeriodOptionalService delivery period for this line.
NotesNote[]OptionalLine-specific annotations.
ExtstringOptionalRegime-specific extension codes for the line.
Totalstring (decimal)CalculatedLine total after discounts. Computed server-side.

Item

Product or service being sold.

FieldTypeRequiredDescriptionCountry Notes
NamestringRequiredBrief product or service name.🇲🇾 Max 300 chars.
DescriptionstringOptionalLong description of the product or service.
Pricestring (decimal)RequiredUnit price. Zero or positive. e.g. "250.00"
CurrencystringOptionalItem currency if different from invoice currency.
UnitstringOptionalUnit of measure. e.g. "piece", "hour", "kg", "KGM"🇲🇾 Uses UN/ECE Rec 20 codes.
KeystringOptionalItem classification: goods or services.
RefstringOptionalSupplier’s internal product reference code.
IdentitiesIdentity[]Optional*Product codes: HS tariff code, classification code, SKU, UNSPSC, etc.🇲🇾 Classification code (CLASS key) required. Tariff code (PTC key) for goods.
OriginstringOptionalCountry of origin (alpha-2). e.g. "GB"🇲🇾 Optional for MY goods.
ExtstringOptional*Regime-specific extension codes for the item.🇲🇽 Required: mx-cfdi-prod-serv. 🇮🇹 Required: it-sdi-nature. 🇧🇷 Required: br-nfse-service-code.

TaxCombo

Tax category and rate applicable to a line item.

FieldTypeRequiredDescriptionCountry Notes
CatstringRequiredTax category code. e.g. "VAT", "GST", "SST", "IGST"
RatestringOptionalNamed rate. e.g. "standard", "reduced", "zero", "exempt"
Percentstring (decimal)OptionalOverride percentage. e.g. "7.0". Calculated from Rate if omitted.
ExtstringOptional*Regime-specific tax extension codes.🇲🇽 Required: mx-cfdi-tax-type. 🇮🇹 Required: it-sdi-nature. 🇧🇷 Required: br-nfe-fiscal-operation. 🇪🇸 Required: es-verifactu-regime.

LineDiscount

Discount applied to a single line item.

FieldTypeRequiredDescriptionCountry Notes
Amountstring (decimal)RequiredFixed discount amount. Calculated from Percent if provided.
Percentstring (decimal)OptionalPercentage to apply. e.g. "10.0"
ReasonstringOptionalDescription of why the discount was applied.
KeystringOptionalDiscount type key. e.g. standard, special-agreement, sample

LineCharge

Surcharge applied to a single line item.

FieldTypeRequiredDescriptionCountry Notes
Amountstring (decimal)RequiredFixed charge amount. Calculated from Percent if provided.
Percentstring (decimal)OptionalPercentage to apply. e.g. "5.0"
ReasonstringOptionalDescription of why the charge was applied.
KeystringOptionalCharge type key. e.g. delivery, packing, handling, insurance

Discount

Invoice-level discount applied to the whole document.

FieldTypeRequiredDescriptionCountry Notes
Amountstring (decimal)RequiredFixed discount amount. Calculated from Percent if provided.
Percentstring (decimal)OptionalPercentage of invoice sum to deduct. e.g. "10.0"
ReasonstringOptionalDescription of the discount.🇲🇾 Reason description required for MY.
TaxesTaxCombo[]OptionalTaxes applicable to the discount.

Charge

Invoice-level surcharge applied to the whole document.

FieldTypeRequiredDescriptionCountry Notes
Amountstring (decimal)RequiredFixed charge amount. Calculated from Percent if provided.
Percentstring (decimal)OptionalPercentage of invoice sum to add. e.g. "5.0"
ReasonstringOptionalDescription of the charge.🇲🇾 Reason description required for MY.
KeystringOptionalCharge type: stamp-duty, customs, delivery, packing, handling, insurance, storage, admin
TaxesTaxCombo[]OptionalTaxes applicable to the charge.

Ordering

Purchase order references and related document links.

FieldTypeRequiredDescriptionCountry Notes
CodestringOptionalBuyer’s purchase order number for internal routing.🇩🇪 Required for DE XRechnung (buyer reference BT-10).
PeriodPeriodOptionalBilling period the document covers.
BuyerPartyOptionalParty responsible for payment if different from Customer.
SellerPartyOptionalTax-liable seller if different from Supplier. Used for marketplace scenarios.
IssuerPartyOptionalThird party responsible for issuing the document (e.g. fiscal representative).
PurchasesDocumentRef[]OptionalBuyer’s purchase order document references.
ContractsDocumentRef[]OptionalContract document references.
ProjectsDocumentRef[]OptionalProject document references.

PaymentDetails

Payment terms, instructions, and pre-payments.

FieldTypeRequiredDescriptionCountry Notes
PayeePartyOptionalParty to receive payment, if different from Supplier.
TermsPayTermsOptionalPayment terms and due dates.
AdvancesAdvance[]OptionalPre-payments to deduct from the amount due.🇲🇾 Use for MY prepayment fields.
InstructionsPayInstructionsOptionalHow and where to send payment.

PayTerms

Payment conditions and due dates.

FieldTypeRequiredDescriptionCountry Notes
KeystringOptionalType of terms: end-of-month, due-date, deferred, instant, elective, pending, advanced, delivery
DueDatesDueDate[]OptionalSpecific payment due dates with amounts.
NotesstringOptionalFree-text payment conditions. Max 256 characters. e.g. "Payment is Cash"🇲🇾 Used for MY payment terms text.

DueDate

A specific payment date with an associated amount.

FieldTypeRequiredDescriptionCountry Notes
Datestring (date)RequiredWhen the payment is due.
Amountstring (decimal)RequiredAmount due by this date.
Percentstring (decimal)OptionalPercentage of total due by this date. e.g. "50.0". Use at most one percent entry per document.
NotesstringOptionalAdditional notes for this due date. Max 256 characters.

PayInstructions

How payment should be made.

FieldTypeRequiredDescriptionCountry Notes
KeystringRequiredPayment method: any, card, credit-transfer, credit-transfer+sepa, debit-transfer, cash, cheque, bank-draft, direct-debit, direct-debit+sepa, online, promissory-note, netting, other🇲🇾 Maps to MY payment mode code.
RefstringOptionalRemittance reference linking payment to invoice.
DetailstringOptionalFree-text description of the payment method.
CreditTransferCreditTransfer[]OptionalBank transfer details.🇲🇾 Supplier bank account number stored here.
CardCardOptionalCard payment reference details.
DirectDebitDirectDebitOptionalDirect debit mandate details.
OnlineOnline[]OptionalOnline payment links.
NotesstringOptionalAdditional payment instructions. Max 256 characters.

CreditTransfer

Bank transfer payment details.

FieldTypeRequiredDescriptionCountry Notes
IBANstringOptionalInternational Bank Account Number.
BICstringOptionalBank Identifier Code (SWIFT).
NumberstringOptionalAccount number when IBAN is not available.🇲🇾 MY bank account number goes here.
NamestringOptionalBank name.

Card

Payment card reference.

FieldTypeRequiredDescriptionCountry Notes
Last4stringOptionalLast 4 digits of the card PAN.
First6stringOptionalFirst 6 digits of the card PAN.
HolderstringOptionalCard holder name.

DirectDebit

Direct debit mandate details.

FieldTypeRequiredDescriptionCountry Notes
RefstringOptionalMandate reference assigned by payee.
CreditorstringOptionalBank-assigned creditor ID.
AccountstringOptionalAccount to be debited.

Online

Online payment link.

FieldTypeRequiredDescriptionCountry Notes
URLstring (uri)RequiredPayment URL.
KeystringOptionalIdentifier for this payment method. e.g. "paypal"
LabelstringOptionalDisplay name for the payment provider.

Advance

A pre-payment made before the invoice was issued.

FieldTypeRequiredDescriptionCountry Notes
DescriptionstringRequiredDetails about the advance payment. Max 256 characters.
Amountstring (decimal)RequiredAmount paid in advance.🇲🇾 Maps to MY PrePayment Amount.
Datestring (date)OptionalDate the advance was made.🇲🇾 Maps to MY PrePayment Date.
RefstringOptionalReference ID for the advance payment.🇲🇾 Maps to MY PrePayment Reference Number.
KeystringOptionalPayment method used for the advance. Same values as PayInstructions.Key.
GrantbooleanOptionalSet true if the advance came from a public grant or subsidy.
CurrencystringOptionalCurrency of the advance if different from the invoice currency.

DeliveryDetails

Goods delivery destination and recipient.

FieldTypeRequiredDescriptionCountry Notes
ReceiverPartyOptionalParty receiving the goods. Not responsible for taxes.🇲🇾 Maps to MY Shipping Recipient (Name, TIN, BRN, Address).
Datestring (date)OptionalExpected delivery date.
PeriodPeriodOptionalDelivery window if a specific date is not available.
IdentitiesIdentity[]OptionalCodes to identify the delivery. e.g. customs form numbers.🇲🇾 Use for MY Customs Form No.1/No.2 reference numbers.

DocumentRef

Reference to an existing document — used in Preceding and Ordering.

FieldTypeRequiredDescriptionCountry Notes
CodestringRequiredThe document number or identifier being referenced.
IssueDatestring (date)OptionalIssue date of the referenced document.
SeriesstringOptionalSeries of the referenced document.
ReasonstringOptionalWhy this document is being referenced.
PeriodPeriodOptionalTax period the referenced document applied to.
StampsStamp[]OptionalOfficial seals of approval from tax authorities or intermediaries.🇲🇽 Used for CFDI cancellation stamps.
ExtstringOptionalRegime-specific correction method codes.

ExchangeRate

Currency conversion rate.

FieldTypeRequiredDescriptionCountry Notes
FromstringRequiredSource currency code (ISO 4217).
TostringRequiredTarget currency code (ISO 4217).🇲🇾 Target must be MYR for MY.
Amountstring (decimal)RequiredHow much 1 unit of From is worth in To.
Atstring (datetime)OptionalEffective date and time of the rate.

Note

Free-text annotation or legal detail.

FieldTypeRequiredDescriptionCountry Notes
TextstringRequiredThe note content. Max 256 characters.
KeystringOptionalSubject classification: general, legal, payment, goods, customs, reason, tax, regulatory, other🇪🇸 VeriFactu requires Key: "general" note with invoice description.
CodestringOptionalAdditional code to identify the note.

Attachment

Supporting document attached to the invoice.

FieldTypeRequiredDescriptionCountry Notes
URLstring (uri)RequiredWhere to find the attachment.
NamestringOptionalFilename of the attachment.
DescriptionstringOptionalWhy this attachment is included.
MIMEstringOptionalMIME type. e.g. "application/pdf", "application/xml"
CodestringOptionalCode identifying the payload type.

Stamp

Official seal from a tax authority or intermediary.

FieldTypeRequiredDescriptionCountry Notes
PrvstringRequiredProvider key identifying the stamping agency. e.g. "sat-mx", "sdi-it"
ValstringRequiredThe stamp value issued by the agency.

Period

A date range used for billing, delivery, or tax periods. Both Start and End dates are inclusive.

FieldTypeRequiredDescriptionCountry Notes
Startstring (date)RequiredStart date of the period (inclusive).
Endstring (date)RequiredEnd date of the period (inclusive).

Tax

Tax defines a summary of the taxes that may be applied to an invoice.

FieldTypeRequiredDescription
PricesIncludestringOptionalCategory of the tax already included in the line item prices. Useful for price-inclusive invoices.
RoundingstringOptionalRounding model used to perform tax calculations. Allowed values: precise, currency.
PointstringOptionalEvent that triggers tax liability. Allowed values: issue, delivery, payment.
ExtstringOptionalAdditional extensions applied to the invoice as a whole.
NotesNote[]OptionalTax-related notes, typically used for exemption reasons or category-specific explanations.
MetastringOptionalAdditional processing data that should not be relied upon by recipients.

Tax rounding values

ValueDescription
preciseDefault model. Maintains maximum precision during calculations.
currencyRounds to currency precision before summation. Easier to reconcile visually but can introduce rounding differences.

Tax point values

ValueDescription
issueTax point is the invoice issue date.
deliveryTax point is the actual delivery date.
paymentTax point is the date on which payment is made.

Totals

Totals contains the summaries of all calculations for the invoice. This object is calculated server-side — do not submit it as part of the request payload.

FieldTypeDescription
Sumstring (decimal)Total of all line item amounts.
Discountstring (decimal)Total of all discounts applied at the document level.
Chargestring (decimal)Total of all charges applied at the document level.
TaxIncludedstring (decimal)Total tax amount already included in prices.
Totalstring (decimal)Net total amount after discounts and charges, excluding tax.
Taxstring (decimal)Total indirect tax amount applied to the invoice.
TotalWithTaxstring (decimal)Final total amount after applying indirect taxes.
RetainedTaxstring (decimal)Total tax amount retained or withheld by the customer.
Roundingstring (decimal)Adjustment amount applied to satisfy rounding rules.
Payablestring (decimal)Final amount to be paid after retained taxes and rounding.
Advancestring (decimal)Total amount already paid in advance by the customer.
Duestring (decimal)Remaining amount that needs to be paid.

Alpha-2 Country Codes

The Country field and other country code fields in the schema use ISO 3166-1 alpha-2 codes. The table below lists the supported tax regimes.

View supported alpha-2 country codes
CodeCountry
AEUnited Arab Emirates
ARArgentina
ATAustria
BEBelgium
BRBrazil
CACanada
CHSwitzerland
COColombia
DEGermany
DKDenmark
ELGreece
ESSpain
FRFrance
GBUnited Kingdom
IEIreland
INIndia
ITItaly
MXMexico
NLThe Netherlands
PLPoland
PTPortugal
SESweden
SGSingapore
USUnited States of America

Currency Codes

The Currency field and other currency code fields in the schema use ISO 4217 alpha-3 codes.

View supported currency codes
CodeCurrencyCountry
AEDUAE DirhamUnited Arab Emirates
ARSArgentine PesoArgentina
AUDAustralian DollarAustralia
BRLBrazilian RealBrazil
CADCanadian DollarCanada
CHFSwiss FrancSwitzerland
CNYChinese Yuan RenminbiChina
COPColombian PesoColombia
DKKDanish KroneDenmark
EUREuroAustria, Belgium, France, Germany, Greece, Ireland, Italy, The Netherlands, Portugal, Spain
GBPPound SterlingUnited Kingdom
HKDHong Kong DollarHong Kong
INRIndian RupeeIndia
JPYJapanese YenJapan
KRWSouth Korean WonSouth Korea
MXNMexican PesoMexico
MYRMalaysian RinggitMalaysia
NZDNew Zealand DollarNew Zealand
PLNPolish ZlotyPoland
SEKSwedish KronaSweden
SGDSingapore DollarSingapore
THBThai BahtThailand
USDUS DollarUnited States of America
VNDVietnamese DongVietnam