Invoice items

List all invoice items

GET /api/invoice-items?invoice_id={invoice_id}

Invoice items can only be retur­ned for a par­ti­cu­lar invoice.
The­re­fore invoice_id is a man­datory parameter.

<?xml version="1.0" encoding="UTF-8"?>
<invoice-items type="array">
    <invoice-item>
        ...
    <invoice-item>
    <invoice-item>
        ...
    <invoice-item>
</invoice-items>

Get a sin­gle item

GET /api/invoice-items/{id}
<?xml version="1.0" encoding="UTF-8"?>
<invoice-item>
    <id type="integer">1</id>
    <article_id type="integer">123</article_id>
    <invoice_id type="integer">1</invoice_id>
    <position type="integer">1</position>
    <unit>Stück</unit>
    <quantity type="float">5.2</quantity>
    <unit_price type="float">10.0</unit_price>
    <tax_name>MwSt</tax_name>
    <tax_rate type="float">19.0</tax_rate>
    <title>Business cards</title>
    <description>Wonderful 4c business cards</description>
    <total_gross type="float">61.88</total_gross>
    <total_net type="float">52.0</total_net>
</invoice-item>

Create item

POST /api/invoice-items

Invoice items can only be crea­ted for invoices with draft sta­tus (DRAFT).

XML ele­ment Descrip­tion Type Default value Man­datory
invoice_id ID of the invoice INT yes (except for crea­tion of an invoice)
article_id ID of the arti­cle INT
unit Unit ALNUM
quan­tity Quan­tity FLOAT 0.0
unit_price Price per unit FLOAT 0.0
tax_name Name of the tax ALNUM Value taken from the set­tings
tax_rate rate of taxation FLOAT Value taken from the set­tings
title Title ALNUM
descrip­tion Descrip­tion ALNUM

The line item is added to eve­nu­tell alre­ady exis­ting positions.

<invoice-item>
    <invoice_id>1</invoice_id>
    <unit>piece</unit>
    <quantity>5.2</quantity>
    <unit_price>10.0</unit_price>
    <tax_name>MwSt</tax_name>
    <tax_rate>19.0</tax_rate>
    <title>Business cards</title>
    <description>Wonderful 4c business cards</description>
</invoice-item>
<?xml version="1.0" encoding="UTF-8"?>
<invoice-item>
    <id type="integer">1</id>
    <article_id />
    <invoice_id type="integer">1</invoice_id>
    <created>2007-12-13T12:12:00+01:00</created>
    <position type="integer">1</position>
    <unit>Piece</unit>
    <quantity type="float">5.2</quantity>
    <unit_price type="float">10.0</unit_price>
    <tax_name>MwSt</tax_name>
    <tax_rate type="float">19.0</tax_rate>
    <title>Business cards</title>
    <description>Wonderful 4c Business cards</description>
    <total_gross type="float">61.88</total_gross>
    <total_net type="float">52.0</total_net>
</invoice-item>

Edit item

PUT /api/invoice-items/{id}

Here the same para­me­ters apply as for crea­ting, howe­ver, the asso­cia­ted invoice (invoice_id) can not be chan­ged.
Invoice items can be edi­ted only for invoices with draft sta­tus (DRAFT).

<invoice-item>
    <unit>hour</unit>
    <quantity>8.5</quantity>
</invoice-item>

Delete item

DELETE /api/invoice-items/{id}

When dele­ting an invoice item, posi­tion of the remai­ning posi­ti­ons is reas­si­gned (wit­hout chan­ging the sorting) to fill the resul­ting gap.
Invoice items can be dele­ted only for invoices with draft sta­tus (DRAFT).