---
title: "Invoice V3.1 · invoiceType"
canonical: "https://knowledge-hub.onetrail.com/space/docs/726106120/Invoice%20V3.1%20%C2%B7%20invoiceType"
format: markdown
---
**Complex type** in namespace `http://www.onetrail.net` · part of [Invoice V3.1](https://onetrail.atlassian.net/wiki/spaces/docs/pages/718701262)

## Diagram

![invoiceType diagram](media://5cf640cb-327e-4bae-9909-942e3921e86d)

## Elements

| # | Element | Type | Occurs | Description |
| --- | --- | --- | --- | --- |
| 1 | **invoiceDate** [required] | [DateTimeFormatType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/718701262/XSD+documentation+invoice#XSDdocumentationinvoice-DateTimeFormatType)  
pattern `[0-9]{8}T[0-9]{6}` | 1..1 | Specifies the date of the invoice in CCYYMMDDTHHMMSS format. |
| 2 | **headerText** | [FreeFormTextType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726564939) | 0..1 | Header comment line, available for backward compatibility. Please use the remarks section instead. |
| 3 | **remarks** | [RemarksType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726859883) | 0..1 |  |
| 4 | **addresses** [required] | [addressesType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/725450867) | 1..1 | Addresses contain information about the parties involved. 6 types of addresses are available, of which 5 are mandatory: MANDATORY<br>- 'TradingPartnerFrom'
- 'TradingPartnerTo'
- 'BillFrom'
- 'BillTo'
- 'ShipTo' OPTIONAL
- 'ShipFrom' In case of a ShipTo address, either the PartnerID should be filled for known/registered delivery addresses, or all address lines in case of a direct shipment (drop-ship or fulfillment) address. |
| 5 | **invoiceLines** [required] | [invoiceLinesType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726630458) | 1..1 | The invoice lines contain all the items being invoiced from the Seller to the Buyer. It contains identifications for matching the order-, line number and product identifiers. The possibility to communicate track and trace information and/or serial numbers is also available. |
| 6 | **paymentDueDate** [required] | [paymentDueDateType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/727089159) | 1..1 | Payment should be made on or before your payment due date. Please specify the date in CCYYMMDDTHHMMSS format. |
| 7 | **paymentTerms** | [paymentTermsType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726597791) | 0..1 | Payment terms on header level. origcode contains the code provided by the Seller. Period specifies the number of days. In some cases, multiple payment terms are provided to allow different discount percentages for different payment due dates. |
| 8 | **shipmentTermsCode** | `xsd:string` | 0..1 | For future use. |
| 9 | **returnMaterialsAuthorisationNumber** | `xsd:string` | 0..1 | This element will hold the reference number of a returned product authorization. |
| 10 | **taxSummary** [required] | [taxesType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/725483654) | 1..1 | The Taxes specify the rates and amounts of each tax (VAT) being applied to this invoice. The rate field contains the normalized VAT code and is mandatory. Either or both the origrate and monetaryAmount must be specified. |
| 11 | **charges** | [chargesType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726728759) | 0..1 |  |
| 12 | **discounts** | [discountsType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/725483685) | 0..1 |  |
| 13 | **levies** | [leviesTotalType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/725483625) | 0..1 |  |
| 14 | **amountSummary** [required] | [amountSummaryType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/726892731) | 1..1 |  |

## Attributes

| Attribute | Type | Use | Description |
| --- | --- | --- | --- |
| **@invoiceTypeCode** | [invoiceTypeCodeType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/718701262/XSD+documentation+invoice#XSDdocumentationinvoice-invoiceTypeCodeType)  
`Invoice` `Credit` `Debit` | [required] | Specifies the type of invoice. Possible values are:<br>- 'Invoice'
- 'Credit'
- 'Debit' In the Onetrail TPN™ format the amounts and quantities are always positive numbers, so no negative sign is used. The table below describes how to deal with some cases: Unit amountType Line amountType Tax amount Type
- Price correction negative 'Credit' 'Credit' 'Credit'
- Price correction positive 'Debit' 'Debit' 'Debit'
- Items returned 'Credit' 'Credit' 'Credit'
- Too few items invoiced 'Debit' 'Debit' 'Debit'
- Too much discount invoiced 'Credit' 'Credit' 'Credit'
- Too little charges invoiced 'Credit' 'Credit' 'Credit' |
| **@amountTypeCode** | [amountTypeCodeType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/718701262/XSD+documentation+invoice#XSDdocumentationinvoice-amountTypeCodeType)  
`Debit` `Credit` | [required] | Specifies the sign of the amounts. If credit, the amounts will not have a negative (-) sign.<br>- 'Debit''
- 'Credit' |
| **@currency** | [currencyType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/718701262/XSD+documentation+invoice#XSDdocumentationinvoice-currencyType)  
length 3 | [required] | [Reference](http://nl.wikipedia.org/wiki/ISO_4217): Specifies the currency for the invoice. Please use ISO 4217, 3-letter codes in capitals. |
| **@id** | `xsd:string` | [required] | Specifies the invoice number. |

## Used by

- [invoicesType](https://onetrail.atlassian.net/wiki/spaces/docs/pages/727122059) / **invoice**

<details>
<summary>XSD source</summary>

```xml
<xsd:complexType name="invoiceType">
        <xsd:sequence>
            <xsd:element name="invoiceDate" type="DateTimeFormatType">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">Specifies the date of the invoice in CCYYMMDDTHHMMSS format.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="headerText" type="FreeFormTextType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">Header comment line, available for backward compatibility.
Please use the remarks section instead.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="remarks" type="RemarksType" minOccurs="0"/>
            <xsd:element name="addresses" type="addressesType">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">Addresses contain information about the parties involved.
6 types of addresses are available, of which 5 are mandatory:
MANDATORY
- 'TradingPartnerFrom'
- 'TradingPartnerTo'
- 'BillFrom'
- 'BillTo'
- 'ShipTo'

OPTIONAL
- 'ShipFrom'

In case of a ShipTo address, either the PartnerID should be filled for known/registered delivery addresses, or all address lines in case of a direct shipment (drop-ship or fulfillment) address.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="invoiceLines" type="invoiceLinesType">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">The invoice lines contain all the items being invoiced from the Seller to the Buyer. It contains identifications for matching the order-, line number and product identifiers.
The possibility to communicate track and trace information and/or serial numbers is also available.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="paymentDueDate" type="paymentDueDateType">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">Payment should be made on or before your payment due date.
                        Please specify the date in CCYYMMDDTHHMMSS format.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="paymentTerms" type="paymentTermsType" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation>Payment terms on header level. origcode contains the code provided by the Seller. Period specifies the number of days.
                        In some cases, multiple payment terms are provided to allow different discount percentages for different payment due dates.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="shipmentTermsCode" type="xsd:string" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">For future use.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="returnMaterialsAuthorisationNumber" type="xsd:string" minOccurs="0">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">This element will hold the reference number of a returned product authorization.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="taxSummary" type="taxesType">
                <xsd:annotation>
                    <xsd:documentation xml:lang="EN">The Taxes specify the rates and amounts of each tax (VAT) being applied to this invoice.
                        The rate field contains the normalized VAT code and is mandatory.
                        Either or both the origrate and monetaryAmount must be specified.</xsd:documentation>
                </xsd:annotation>
            </xsd:element>
            <xsd:element name="charges" type="chargesType" minOccurs="0"/>
            <xsd:element name="discounts" type="discountsType" minOccurs="0"/>
            <xsd:element name="levies" type="leviesTotalType" minOccurs="0"/>
            <xsd:element name="amountSummary" type="amountSummaryType"/>
        </xsd:sequence>
        <xsd:attribute name="invoiceTypeCode" type="invoiceTypeCodeType" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="EN">Specifies the type of invoice. Possible values are:
                    - 'Invoice'
                    - 'Credit'
                    - 'Debit'

                    In the Onetrail TPN™ format the amounts and quantities are always positive numbers, so no negative sign is used.
                    The table below describes how to deal with some cases:

                                                    Unit amountType     Line amountType     Tax amount Type

                    - Price correction negative     'Credit'              'Credit'              'Credit'
                    - Price correction positive     'Debit'               'Debit'               'Debit'

                    - Items returned                'Credit'              'Credit'              'Credit'
                    - Too few items invoiced        'Debit'               'Debit'               'Debit'

                    - Too much discount invoiced    'Credit'              'Credit'              'Credit'
                    - Too little charges invoiced   'Credit'              'Credit'              'Credit'</xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="amountTypeCode" type="amountTypeCodeType" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="EN">Specifies the sign of the amounts. If credit, the amounts will not have a negative (-) sign.
                    - 'Debit''
                    - 'Credit'</xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="currency" type="currencyType" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="EN" source="http://nl.wikipedia.org/wiki/ISO_4217">Specifies the currency for the invoice. Please use ISO 4217, 3-letter codes in capitals.</xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
        <xsd:attribute name="id" type="xsd:string" use="required">
            <xsd:annotation>
                <xsd:documentation xml:lang="EN">Specifies the invoice number.</xsd:documentation>
            </xsd:annotation>
        </xsd:attribute>
    </xsd:complexType>

```
</details>