Invoice Json Object

Documentazione •
In questo articolo

Data structure used by the Invoice Layout Extension to print an invoice. 


{
    "billing_info": {
        "discount": {
            "amount_vat_exclusive": "2.20"
        },
        "due_date": "2020-06-17",
        "total_advance_payment": "",
        "total_amount_vat_exclusive": "122.15",
        "total_amount_vat_exclusive_before_discount": "124.35",
        "total_amount_vat_inclusive": "131.56",
        "total_amount_vat_inclusive_before_discount": "133.93",
        "total_categories": [],
        "total_discount_percent": "1.8",
        "total_discount_vat_exclusive": "2.20",
        "total_discount_vat_inclusive": "2.37",
        "total_rounding_difference": "",
        "total_to_pay": "131.56",
        "total_vat_amount": "9.41",
        "total_vat_amount_before_discount": "9.58",
        "total_vat_codes": [
            {
                "total_amount_vat_exclusive": "122.15",
                "total_amount_vat_inclusive": "131.56",
                "total_vat_amount": "9.41",
                "vat_code": "V77"
            }
        ],
        "total_vat_rates": [
            {
                "total_amount_vat_exclusive": "122.15",
                "total_amount_vat_inclusive": "131.56",
                "total_vat_amount": "9.41",
                "vat_rate": "7.70"
            }
        ]
    },
    "creator_info": {
        "name": "ch.banana.application.invoice.default",
        "pubdate": "2021-09-24",
        "publisher": "Banana.ch SA",
        "version": ""
    },
    "customer_info": {
        "address1": "Via ai Salici 12",
        "address2": "",
        "address3": "",
        "business_name": "La stanza del Te SA",
        "city": "Lugano",
        "country": "",
        "country_code": "CH",
        "courtesy": "",
        "email": "",
        "first_name": "pinco",
        "iban": "",
        "last_name": "",
        "mobile": "",
        "number": "1",
        "phone": "",
        "postal_code": "6900",
        "web": ""
    },
    "document_info": {
        "currency": "CHF",
        "customer_reference": "asdf",
        "date": "2020-06-17",
        "decimals_amounts": 2,
        "description": "Fornitura merce (esempio iva esclusa)",
        "doc_type": "10",
        "locale": "it",
        "number": "3",
        "rounding_totals": "0.05",
        "text_begin": "",
        "title": "Fornitura merce (esempio iva esclusa)",
        "vat_mode": "vat_excl"
        "custom_info": [
            {
                "id": "custom_field_1",
                "title": "Weight",
                "value": "45 kg"
            },
            {
                "id": "custom_field_2",
                "title": "Packages",
                "value": "3"
            }
        ]
    },
    "items": [
        {
            "description": "Te\n1\n2\n3",
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "price": "",
            "quantity": "4.00",
            "total": "",
            "total_amount_vat_exclusive": "19.68",
            "total_amount_vat_inclusive": "21.20",
            "total_vat_amount": "1.52",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "5.30",
                "calculated_amount_vat_exclusive": "4.92",
                "calculated_amount_vat_inclusive": "5.30",
                "calculated_vat_amount": "0.38",
                "vat_code": "V77",
                "vat_rate": "7.70"
            },
            "vat_code": "",
            "vat_rate": ""
        },
        {
            "description": "Te",
            "discount": {
                "percent": "30."
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "4.00",
            "total": "",
            "total_amount_vat_exclusive": "13.78",
            "total_amount_vat_inclusive": "14.84",
            "total_vat_amount": "1.06",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "5.30",
                "calculated_amount_vat_exclusive": "4.92",
                "calculated_amount_vat_inclusive": "5.30",
                "calculated_vat_amount": "0.38",
                "discounted_amount_vat_exclusive": "3.44",
                "discounted_amount_vat_inclusive": "3.71",
                "discounted_vat_amount": "0.27",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "discount": {
                "amount": "1.60"
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "4.00",
            "total": "",
            "total_amount_vat_exclusive": "13.74",
            "total_amount_vat_inclusive": "14.80",
            "total_vat_amount": "1.06",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "5.30",
                "calculated_amount_vat_exclusive": "4.92",
                "calculated_amount_vat_inclusive": "5.30",
                "calculated_vat_amount": "0.38",
                "discounted_amount_vat_exclusive": "3.44",
                "discounted_amount_vat_inclusive": "3.70",
                "discounted_vat_amount": "0.26",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "",
            "quantity": "10000",
            "total_amount_vat_exclusive": "17.18",
            "total_amount_vat_inclusive": "18.50",
            "total_vat_amount": "1.32",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "0.00185",
                "calculated_amount_vat_exclusive": "0.00172",
                "calculated_amount_vat_inclusive": "0.00185",
                "calculated_vat_amount": "0.00013",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "discount": {
                "amount": "0.00035"
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "10000",
            "total": "",
            "total_amount_vat_exclusive": "13.93",
            "total_amount_vat_inclusive": "15.00",
            "total_vat_amount": "1.07",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "0.00185",
                "calculated_amount_vat_exclusive": "0.00172",
                "calculated_amount_vat_inclusive": "0.00185",
                "calculated_vat_amount": "0.00013",
                "discounted_amount_vat_exclusive": "0.00139",
                "discounted_amount_vat_inclusive": "0.00150",
                "discounted_vat_amount": "0.00011",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "discount": {
                "percent": "3."
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "10000",
            "total": "",
            "total_amount_vat_exclusive": "16.67",
            "total_amount_vat_inclusive": "17.95",
            "total_vat_amount": "1.28",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "0.00185",
                "calculated_amount_vat_exclusive": "0.00172",
                "calculated_amount_vat_inclusive": "0.00185",
                "calculated_vat_amount": "0.00013",
                "discounted_amount_vat_exclusive": "0.00167",
                "discounted_amount_vat_inclusive": "0.00179",
                "discounted_vat_amount": "0.00013",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "",
            "quantity": "0.00025",
            "total_amount_vat_exclusive": "9.33",
            "total_amount_vat_inclusive": "10.05",
            "total_vat_amount": "0.72",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "40200.00",
                "calculated_amount_vat_exclusive": "37325.91",
                "calculated_amount_vat_inclusive": "40200.00",
                "calculated_vat_amount": "2874.09",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "discount": {
                "amount": "8000"
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "0.00025",
            "total": "",
            "total_amount_vat_exclusive": "7.47",
            "total_amount_vat_inclusive": "8.05",
            "total_vat_amount": "0.58",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "40200.00",
                "calculated_amount_vat_exclusive": "37325.91",
                "calculated_amount_vat_inclusive": "40200.00",
                "calculated_vat_amount": "2874.09",
                "discounted_amount_vat_exclusive": "29897.86",
                "discounted_amount_vat_inclusive": "32200.00",
                "discounted_vat_amount": "2302.14",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Te",
            "discount": {
                "percent": "25."
            },
            "item_type": "item",
            "mesure_unit": "pz",
            "number": "1000",
            "quantity": "0.00025",
            "total": "",
            "total_amount_vat_exclusive": "7.00",
            "total_amount_vat_inclusive": "7.54",
            "total_vat_amount": "0.54",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "40200.00",
                "calculated_amount_vat_exclusive": "37325.91",
                "calculated_amount_vat_inclusive": "40200.00",
                "calculated_vat_amount": "2874.09",
                "discounted_amount_vat_exclusive": "27994.43",
                "discounted_amount_vat_inclusive": "30150.00",
                "discounted_vat_amount": "2155.57",
                "vat_code": "V77",
                "vat_rate": "7.70"
            }
        },
        {
            "description": "Spese di spedizione",
            "item_type": "item",
            "mesure_unit": "",
            "number": "4000",
            "price": "",
            "quantity": "1.00",
            "total": "",
            "total_amount_vat_exclusive": "5.57",
            "total_amount_vat_inclusive": "6.00",
            "total_vat_amount": "0.43",
            "unit_price": {
                "amount_vat_exclusive": null,
                "amount_vat_inclusive": "6.00",
                "calculated_amount_vat_exclusive": "5.57",
                "calculated_amount_vat_inclusive": "6.00",
                "calculated_vat_amount": "0.43",
                "vat_code": "V77",
                "vat_rate": "7.70"
            },
            "vat_code": "",
            "vat_rate": ""
        }
    ],
    "note": [
        {
            "date": null,
            "description": "aFASD\nF AS\nDF\n AS\nDF ASDF"
        }
    ],
    "payment_info": {
        "due_date": "2020-07-17"
    },
    "supplier_info": {
        "address1": "VIa alle colline 12",
        "address2": "",
        "address3": "",
        "business_name": "My Company",
        "city": "Lugano",
        "country": "Svizzera",
        "country_code": "CH",
        "courtesy": "",
        "email": "info@mycompany.zz",
        "first_name": "",
        "fiscal_number": "",
        "iban_number": "CH93 0076 2011 6238 5295 7",
        "last_name": "",
        "mobile": "",
        "phone": "+41 56 777 999",
        "postal_code": "600",
        "vat_number": "CHE-111.333.999 IVA",
        "web": "https://www.mycompany.zz"
    },
    "type": "invoice",
    "version": "1.0"
}

Invoice Json Properties Explanation

The Json has the following main elements:

  • type
    "invoice"
  • version
    "1.0"
  • document_info
    • Information relative to the invoice or estimate (currency, doctype,...) 
    • Initial texts, before Items
  • payment_info
    Invoice due date.
  • supplier_info
    Address of the company that issue/send the invoice.customer_info
  • Address of one receiving the invoice.
  • shipping_info
    Shipping Address  
  • items
    The list of items
  • billing_info
    Total of the invoices.note
  • note
    Array that contains the notes, to be printed at the end.
  • parameters
    Not used
  • template_parameters
  • Texts that are defined in the Invoice Dialogs
  • transactions
    Payment information (not used in transactions)

 

Source of data

This list explains where the actual information on your invoice json object is coming from

Invoice Object PropertySource
customer_info.address1Table: Accounts, View: Address, Column: Street
customer_info.address2Table: Accounts, View: Address, Column: AddressExtra
customer_info.address3Table: Accounts, View: Address, Column: POBox
customer_info.balanceTable: Accounts, View: Address, Column: Balance
customer_info.balance_base_currencyTable: Accounts, View: Address, Column: BalanceCurrency
customer_info.bank_accountTable: Accounts, View: Address, Column: BankAccount
customer_info.bank_clearingTable: Accounts, View: Address, Column: BankClearing
customer_info.bank_nameTable: Accounts, View: Address, Column: BankName
customer_info.business_nameTable: Accounts, View: Address, Column: OrganisationName
customer_info.cityTable: Accounts, View: Address, Column: Locality
customer_info.countryTable: Accounts, View: Address, Column: Country
customer_info.country_codeTable: Accounts, View: Address, Column: CountryCode
customer_info.courtesyTable: Accounts, View: Address, Column: NamePrefix
customer_info.credit_limitTable: Accounts, View: Address, Column: CreditLimit
customer_info.currencyTable: Accounts, View: Address, Column: Currency
customer_info.date_birthTable: Accounts, View: Address, Column: DateOfBirth
customer_info.emailTable: Accounts, View: Address, Column: EmailWork
customer_info.faxTable: Accounts, View: Address, Column: Fax
customer_info.first_nameTable: Accounts, View: Address, Column: FirstName
customer_info.fiscal_numberTable: Accounts, View: Address, Column: FiscalNumber
customer_info.iban_numberTable: Accounts, View: Address, Column: BankIban
customer_info.langTable: Accounts, View: Address, Column: Language
customer_info.last_nameTable: Accounts, View: Address, Column: FamilyName
customer_info.member_feeTable: Accounts, View: Address, Column: MemberFee
customer_info.mobileTable: Accounts, View: Address, Column: PhoneMobile
customer_info.numberTable: Accounts, View: Address, Column: Account
customer_info.payment_term_daysTable: Accounts, View: Address, Column: PaymentTermInDays
customer_info.phoneTable: Accounts, View: Address, Column: PhoneMain
customer_info.postal_codeTable: Accounts, View: Address, Column: PostalCode
customer_info.stateTable: Accounts, View: Address, Column: Region
customer_info.vat_numberTable: Accounts, View: Address, Column: VatNumber
customer_info.webTable: Accounts, View: Address, Column: Website
document_info.currencyInvoice currency which usually corresponds to the customer account currency
document_info.dateTable: Transactions, Column: DateDocument or Date
document_info.decimals_amountsDecimals are the same as the decimals used in the accounting file
document_info.descriptionNot used
document_info.doc_typeTable: Transactions, Column: DocType
document_info.greetingsTable: Transactions, Column: DocType
Transactions with DocType=10:gre
If there are many rows with 10:gre the texts are joined with ','.
More info...
document_info.localeMenu: File-File and accounting properties, Other, current Language
document_info.numberTable: Transactions, Column: DocInvoice
document_info.order_dateTable: Transactions, Column: DocType
Transactions with DocType=10:ordd
More info...
document_info.order_numberTable: Transactions, Column: DocType
Transactions with DocType=10:ordn
More info...
document_info.origin_rowRow index of source transaction
document_info.origin_tableTable name of source transaction
document_info.rounding_totalDefault value for CHF: 0.05
You can overwrite this value with the menu command: Account2 - Customers - Settings - Advanced - Invoice rounding
For multicurrency accounting: you can setup the rounding value for each currency in the table ExchangeRates, column DecimalPoints
document_info.text_beginTable: Transactions, Column: DocType
Transactions with DocType=10:beg
More info...
document_info.typeinvoice
itemsTable: Transactions
All rows with the same invoice number and transaction date are invoice's items (lines)
noteTable: Transactions, Column: DocType
Transactions with DocType=10:not.
More info...
parametersTable: Transactions, Column: DocType
Transactions with DocType=10:par:key
Key: any key text you wish
Value: is taken from column Description
More info...
payment_infoCalculated from journal
shipping_infoDelivery address if different from the invoice address (customer_info)
Table: Transactions, Column: DocType
Transactions with DocType=10:sadr
More info...
supplier_info.address1Menu: File-File and accounting properties, Address, Address 1
supplier_info.address2Menu: File-File and accounting properties, Address, Address 2
supplier_info.business_nameMenu: File-File and accounting properties, Address, Company
supplier_info.cityMenu: File-File and accounting properties, Address, City
supplier_info.countryMenu: File-File and accounting properties, Address, Country
supplier_info.courtesyMenu: File-File and accounting properties, Address, Courtesy
supplier_info.emailMenu: File-File and accounting properties, Address, Email
supplier_info.faxMenu: File-File and accounting properties, Address, Fax
supplier_info.first_nameMenu: File-File and accounting properties, Address, Name
supplier_info.fiscal_numberMenu: File-File and accounting properties, Address, Fiscal Number
supplier_info.last_nameMenu: FilevFile and accounting properties, Address, Family Name
supplier_info.mobileMenu: File-File and accounting properties, Address, Mobile
supplier_info.phoneMenu: File-File and accounting properties, Address, Phone
supplier_info.postal_codeMenu: File-File and accounting properties, Address, Zip
supplier_info.stateMenu: File-File and accounting properties, Address, Region
supplier_info.vat_numberMenu: File-File and accounting properties, Address, Vat Number
supplier_info.webMenu: File-File and accounting properties, Address, Web
transactionsTable: Transactions
All rows with the same invoice number and different transaction date, which are not considered invoice items, like payments transactions

 

 

 

Aiutaci a migliorare la documentazione

Sono benvenuti suggerimenti per come migliorare questa pagina.

Informaci quale tema necessita di una spiegazione migliore o come chiarire meglio un argomento.

Condividi questo articolo: Twitter | Facebook | LinkedIn | Email