Estimates

List all estimates

GET /api/offers
<?xml version="1.0" encoding="UTF-8"?>
<offers type="array" page="1" per_page="100" total="2">
    <offer>
        ...
    </offer>
    <offer>
        ...
    </offer>
</offers>
GET /api/offers?offer_number=AN123

Shows all cli­ents with the term “AN123” in their offer num­ber. It doesn’t mat­ter if you use upper– or lowercase.

The fol­lo­wing para­me­ters can be used:

Para­me­ter Descrip­tion
client_id ID of the cli­ent
offer_number Esti­mate number
sta­tus Sta­tus of the esti­mate (DRAFT, OPEN, WON, LOST, CANCELED, CLEARED). More than one sta­tu­ses could be given as a comma sepa­ra­ted list. The­ses sta­tu­ses will be logi­cally OR-connected.
from Only show esti­ma­tes since this date (for­mat YYYY-MM-DD)
to Only show esti­ma­tes to this date (for­mat YYYY-MM-DD)
label Free text search in label text
intro Free text search in intro­duc­tory text
note Free text search in expla­natory notes

Get a sin­gle estimate

GET /api/offers/{id}
<?xml version="1.0" encoding="UTF-8"?>
<offer>
    <id type="integer">1</id>
    <client_id type="integer">123</client_id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <offer_number>AN123</offer_number>
    <number type="integer">123</number>
    <number_pre>AN</number_pre>
    <status>OPEN</status>
    <date type="date">2010-10-01</date>
    <address>Billomat GmbH &amp; Co. KG&#13;
Hollertszug 26&#13;
57562 Herdorf&#13;
Deutschland</address>
    <label>project 123</label>
    <intro>We are pleased to offer you the following items:</intro>
    <note>We are looking forward to your answer.</note>
    <total_gross type="float">119.0</total_gross>
    <total_net type="float">100.0</total_net>
    <currency_code>EUR</currency_code>
    <quote type="float">1.0000</quote>
    <taxes type="array">
        <tax>
            <name>VAT</name>
            <rate type="float">19.0</rate>
            <amount type="float">19.0</amount>
        </tax>
    </taxes>
    <validity_date>2010-10-31</validity_date>
</offer>

sta­tus can have the fol­lo­wing values:

  • DRAFT
  • OPEN
  • WON
  • LOST
  • CANCELED
  • CLEARED

In addi­tion to the esti­mate com­bi­ned taxes (taxes) will be retur­ned.
Esti­mate items and com­ments can be acces­sed separately.

Create an estimate

POST /api/offers

Crea­tes an estimate.

XML ele­ment Descrip­tion Type Default value Man­datory
client_id ID of the cli­ent INT yes
address the address ALNUM Client’s address
number_pre Pre­fix ALNUM Value taken from the set­tings
num­ber serial num­ber INT next free number
number_length Mini­mum length of the esti­mate num­ber (to be fil­led with lea­ding zeros) INT Value taken from the set­tings
date Esti­mate date DATE today
label Label text to describe the project ALNUM
intro Intro­duc­tory text ALNUM Value taken from the set­tings
note Expla­natory notes ALNUM Value taken from the set­tings
currency_code Cur­rency ISO cur­rency code Default cur­rency from the set­tings
quote Cur­rency quote (for con­ver­sion into stan­dard currency) FLOAT 1.0000
validity_date Date of validtiy DATE

sta­tus at crea­tion is always DRAFT.
The remai­ning pro­per­ties are auto­ma­ti­cally calculated.

Esti­mate items (offer-items) can be spe­ci­fied directly at crea­tion. Please find a docu­men­ta­tion of the XML ele­ments at Create esti­mate items, but the XML ele­ment offer_id need not be spe­ci­fied with.

<offer>
    <client_id>5</client_id>
    <date>2009-11-17</date>
    <offer-items>
        <offer-item>
            <unit>Piece</unit>
            <unit_price>1.23</unit_price>
            <quantity>1.5</quantity>
            <title>foo</title>
        </offer-item>
        <offer-item>
            <unit>Piece</unit>
            <unit_price>1.23</unit_price>
            <quantity>5</quantity>
            <title>bar</title>
        </offer-item>
    </offer-items>
</offer>
<?xml version="1.0" encoding="UTF-8"?>
<offer>
    <id type="integer">1234</id>
    <client_id type="integer">5</client_id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <offer_number>AN124</offer_number>
    <number type="integer">124</number>
    <number_pre>AN</number_pre>
    <date type="date">2009-11-17</date>
    ...
</offer>

Edit esti­mate

PUT /api/offers/{id}

Updates an esti­mate with the given para­me­ters.
An esti­mate can basi­cally be edi­ted in draft sta­tus (DRAFT) only.
Items and com­ments could not be edi­ted at the esti­mate. Please use the appro­priate resource instead.

<offer>
    <date>2009-10-13</date>
</offer>

Delete esti­mate

DELETE /api/offers/{id}

Dele­tes an esti­mate with all docu­ments (PDFs), items and com­ments.


Open pdf of an estimate

GET /api/offers/{id}/pdf

At this point, the para­me­ter format=pdf can also be used to open the PDF directly with MIME type “application/pdf”.

<pdf>
    <id type="integer">4882</id>
    <created type="datetime">2009-09-02T12:04:15+02:00</created>
    <offer_id type="integer">240</offer_id>
    <filename>offer_123.pdf</filename>
    <mimetype>application/pdf</mimetype>
    <filesize>70137</filesize>
    <base64file>{base64 encoded PDF}</base64file>
</pdf>

Com­plete estimate

PUT /api/offers/{id}/complete

Clo­ses an esti­mate in the draft sta­tus (DRAFT) from. Here, the sta­tus of open (OPEN) is set and a PDF is gene­ra­ted and stored in the file sys­tem.
The optio­nal par­am­ter template_id deter­mi­nes which tem­plate is used to create a pdf.
If this para­me­ter is not spe­ci­fied, the default tem­plate set is used.

<complete>
    <template_id>123</template_id>
</complete>

Send an esti­mate by e-mail

POST /api/offers/{id}/email

Sends an esti­mate by e-mail.

XML ele­ment Descrip­tion Type Default value Man­datory
from Sen­der EMAIL E-mail address of the cur­rent user
reci­pi­ents Reci­pi­ents of the e-mail. There must be at least one xml note for “to”, “cc” and/or “bcc”. XML note/EMAIL yes
sub­ject Sub­ject of the e-mail (may include placeholders ALNUM Value taken from the set­tings
body Text of the e-mail (may include placeholders) ALNUM Value taken from the set­tings
file­name Name of the PDF file (wit­hout .pdf) ALNUM offer_{id}
attach­ments Fur­ther files. Attach­ments can con­tain as many nodes on the “attach­ment” with the ele­ments “file­name”, “mime­type” and “base64file”. XML note
<email>
    <from>info@billomat.com</from>
    <recipients>
        <to>info@billomat.com</to>
        <cc>mail@example.com</cc>
    </recipients>
    <subject>Your estimate</subject>
    <body>Dear sir or madam, ....</body>
    <filename>estimate</filename>
    <attachments>
        <attachment>
            <filename>drawing.pdf</filename>
            <mimetype>application/pdf</mimetype>
            <base64file>{base64 encoded file}</base64file>
        </attachment>
    </attachments>
</email>

Can­cel estimate

PUT /api/offers/{id}/cancel

Mark esti­mate as won

PUT /api/offers/{id}/win

Mark esti­mate as lost

PUT /api/offers/{id}/lose

Ange­bot als abge­rech­net markieren

PUT /api/offers/{id}/clear