Invoices
========

.. _InvoicesPaymentTypeDebut: 

InvoicesPaymentTypeDebut
------------------------

Invoice data for type debit

.. code-block:: json

 message InvoicesPaymentTypeDebit {
  string iban = 1;
  string bic = 2;
  string bankname = 3;
 }

+-------------+------------+--------------------------+
| Field       | Type       | Description              |
+=============+============+==========================+
| ``iban``    | ``string`` | Bank account IBAN number |
+-------------+------------+--------------------------+
| ``bic``     | ``string`` | Bank BIC number          |
+-------------+------------+--------------------------+
| ``bankame`` | ``string`` | Bank name                |
+-------------+------------+--------------------------+

.. _InvoicesPaymentTypeCredit:

InvoicesPaymentTypeCredit
-------------------------

Invoice data for type credit

.. code-block:: json

 message InvoicesPaymentTypeCredit {
  string card_number = 1;
  string card_owner = 2;
  string card_valid_until = 3;
  optional string card_issuer = 4;
 }

+----------------------+------------+---------------------------------------------+
| Field                | Type       | Description                                 |
+======================+============+=============================================+
| ``card_number``      | ``string`` | Credit card number                          |
+----------------------+------------+---------------------------------------------+
| ``card_owner``       | ``string`` | Credit card owner                           |
+----------------------+------------+---------------------------------------------+
| ``card_valid_until`` | ``string`` | Month and year until when the card is valid |
+----------------------+------------+---------------------------------------------+
| ``card_issuer``      | ``string`` | **Optional.** What company issued the card  |
+----------------------+------------+---------------------------------------------+

.. _InvoicesRoot:

InvoicesRoot
------------

Invoices root collection

.. code-block:: json

 message InvoicesRoot {
  string id = 1;
  string name = 2;
  string title = 3;
  Language language = 18;
  string email = 20;
  optional string email_cc = 21;
  optional string address = 23;
  optional string country = 22;
  bool send_printed_invoice = 24;
  InvoicesPaymentType payment_type = 25;
  optional InvoicesPaymentTypeDebit debit_data = 26;
  optional InvoicesPaymentTypeCredit credit_data = 27;
  ItemType item_type = 28;
  EffectivePermission effective_permission = 29;
  string dataroom_id = 30;
  optional string mandate_reference = 31;
 }

+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| Field                    | Type                          | Description                                                                   |
+==========================+===============================+===============================================================================+
| ``id``                   | ``string``                    |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``name``                 | ``string``                    |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``title``                | ``string``                    |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``language``             | ``Language``                  | See :ref:`Language <Language>`                                                |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``email``                | ``string``                    |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``email_cc``             | ``string``                    | **Optional**                                                                  |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``address``              | ``string``                    | **Optional**                                                                  |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``country``              | ``string``                    | **Optional**                                                                  |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``send_printed_invoice`` | ``bool``                      |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``payment_type``         | ``InvoicesPaymentType``       | see :ref:`InvoicesPaymentType <InvoicesPaymentType>`                          |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``debit_data``           | ``InvoicesPaymentTypeDebit``  | **Optional** see :ref:`InvoicesPaymentTypeDebit <InvoicesPaymentTypeDebit>`   |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``credit_data``          | ``InvoicesPaymentTypeCredit`` | **Optional** see :ref:`InvoicesPaymentTypeCredit <InvoicesPaymentTypeCredit>` |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``item_type``            | ``ItemType``                  | see :ref:`ItemType<ItemType>`                                                 |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``effective_permission`` | ``EffectivePermission``       | see :ref:`EffectivePermission<EffectivePermission>`                           |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``dataroom_id``          | ``string``                    |                                                                               |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+
| ``mandate_reference``    | ``string``                    | **Optional**                                                                  |
+--------------------------+-------------------------------+-------------------------------------------------------------------------------+

.. _InvoiceItem:

InvoiceItem
-----------

Interface for one invoice item

.. code-block:: json

 message InvoiceItem {
  string id = 1;
  string title = 2;
  bool is_first_invoice = 3;
  bool invoice_paper = 4;
  optional string comment = 5;
  google.protobuf.Timestamp invoice_from = 6;
  google.protobuf.Timestamp invoice_until = 7;
  google.protobuf.Timestamp invoice_date = 8;
  google.protobuf.Timestamp invoice_paid = 9;
  uint32 invoice_amount = 10;
  optional uint32 invoice_amount_open = 11;
  string currency = 12;
  ItemType item_type = 13;
  EffectivePermission effective_permission = 14;
  string name = 15;
  string dataroom_id = 16;
  optional string mandate_reference = 17;
  optional bool pdf_variant_exists = 18;
  optional bool pdf_variant_creatable = 19;
  optional string mime_type = 20;
 }

+---------------------------+-------------------------------+--------------+
| Field                     | Type                          | Description  |
+===========================+===============================+==============+
| ``id``                    | ``string``                    |              |
+---------------------------+-------------------------------+--------------+
| ``title``                 | ``string``                    |              |
+---------------------------+-------------------------------+--------------+
| ``is_first_invoice``      | ``bool``                      |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_paper``         | ``bool``                      |              |
+---------------------------+-------------------------------+--------------+
| ``comment``               | ``string``                    | **Optional** |
+---------------------------+-------------------------------+--------------+
| ``invoice_from``          | ``google.protobuf.Timestamp`` |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_until``         | ``google.protobuf.Timestamp`` |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_date``          | ``google.protobuf.Timestamp`` |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_paid``          | ``google.protobuf.Timestamp`` |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_amount``        | ``uint32``                    |              |
+---------------------------+-------------------------------+--------------+
| ``invoice_amount_open``   | ``uint32``                    | **Optional** |
+---------------------------+-------------------------------+--------------+
| ``currency``              | ``string``                    |              |
+---------------------------+-------------------------------+--------------+
| ``item_type``             | ``ItemType``                  |              |
+---------------------------+-------------------------------+--------------+
| ``effective_permission``  | ``EffectivePermission``       |              |
+---------------------------+-------------------------------+--------------+
| ``name``                  | ``string``                    |              |
+---------------------------+-------------------------------+--------------+
| ``dataroom_id``           | ``string``                    |              |
+---------------------------+-------------------------------+--------------+
| ``mandate_reference``     | ``string``                    | **Optional** |
+---------------------------+-------------------------------+--------------+
| ``pdf_variant_exists``    | ``bool``                      | **Optional** |
+---------------------------+-------------------------------+--------------+
| ``pdf_variant_creatable`` | ``bool``                      | **Optional** |
+---------------------------+-------------------------------+--------------+
| ``mime_type``             | ``string``                    | **Optional** |
+---------------------------+-------------------------------+--------------+