Estimate items

List all esti­mate items

GET /api/offer-items?offer_id={offer_id}

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

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

Get a sin­gle item

GET /api/offer-items/{id}
<?xml version="1.0" encoding="UTF-8"?>
<offer-item>
    <id type="integer">1</id>
    <article_id type="integer">123</article_id>
    <offer_id type="integer">1</offer_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>VAT</tax_name>
    <tax_rate type="float">19.0</tax_rate>
    <title>Business cards</title>
    <description>Beatiful business cards</description>
    <total_gross type="float">61.88</total_gross>
    <total_net type="float">52.0</total_net>
    <optional>0</optional>
</offer-item>

Create item

POST /api/offer-items

Esti­mate items can only be crea­ted for esti­ma­tes with draft sta­tus (DRAFT).

XML ele­ment Descrip­tion Type Default value Man­datory
offer_id ID of the esti­mate INT yes (nex­cept for crea­tion of an esti­mate)
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
optio­nal Spe­ci­fies whe­ther this is an optio­nal posi­tion (=1). The price will not be inclu­ded in the total. INT

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

<offer-item>
    <offer_id>1</offer_id>
    <unit>Piece</unit>
    <quantity>5.2</quantity>
    <unit_price>10.0</unit_price>
    <tax_name>VAT</tax_name>
    <tax_rate>19.0</tax_rate>
    <title>Business cards</title>
    <description>Wonderful business cards</description>
    <optional>1</optional>
</offer-item>
<?xml version="1.0" encoding="UTF-8"?>
<offer-item>
    <id type="integer">1</id>
    <article_id />
    <offer_id type="integer">1</offer_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>VAT</tax_name>
    <tax_rate type="float">19.0</tax_rate>
    <title>Business cards</title>
    <description>Wonderful business cards</description>
    <total_gross type="float">61.88</total_gross>
    <total_net type="float">52.0</total_net>
    <optional>1</optional>
</offer-item>

Edit item

PUT /api/offer-items/{id}

Here the same para­me­ters apply as for crea­ting, howe­ver, the asso­cia­ted esti­mate (offer_id) can not be chan­ged.
Esti­mate items can be edi­ted only for esti­ma­tes with draft sta­tus (DRAFT).

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

Delete item

DELETE /api/offer-items/{id}

When dele­ting an esti­mate 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.
Esti­mate items can be dele­ted only for esti­ma­tes with draft sta­tus (DRAFT).