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 clients with the term “AN123” in their offer number. It doesn’t matter if you use upper– or lowercase.
The following parameters can be used:
| Parameter | Description |
|---|---|
| client_id | ID of the client |
| offer_number | Estimate number |
| status | Status of the estimate (DRAFT, OPEN, WON, LOST, CANCELED, CLEARED). More than one statuses could be given as a comma separated list. Theses statuses will be logically OR-connected. |
| from | Only show estimates since this date (format YYYY-MM-DD) |
| to | Only show estimates to this date (format YYYY-MM-DD) |
| label | Free text search in label text |
| intro | Free text search in introductory text |
| note | Free text search in explanatory notes |
Get a single 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 & Co. KG
Hollertszug 26
57562 Herdorf
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>
status can have the following values:
- DRAFT
- OPEN
- WON
- LOST
- CANCELED
- CLEARED
In addition to the estimate combined taxes (taxes) will be returned.
Estimate items and comments can be accessed separately.
Create an estimate
POST /api/offers
Creates an estimate.
| XML element | Description | Type | Default value | Mandatory |
|---|---|---|---|---|
| client_id | ID of the client | INT | yes | |
| address | the address | ALNUM | Client’s address | |
| number_pre | Prefix | ALNUM | Value taken from the settings | |
| number | serial number | INT | next free number | |
| number_length | Minimum length of the estimate number (to be filled with leading zeros) | INT | Value taken from the settings | |
| date | Estimate date | DATE | today | |
| label | Label text to describe the project | ALNUM | ||
| intro | Introductory text | ALNUM | Value taken from the settings | |
| note | Explanatory notes | ALNUM | Value taken from the settings | |
| currency_code | Currency | ISO currency code | Default currency from the settings | |
| quote | Currency quote (for conversion into standard currency) | FLOAT | 1.0000 | |
| validity_date | Date of validtiy | DATE |
status at creation is always DRAFT.
The remaining properties are automatically calculated.
Estimate items (offer-items) can be specified directly at creation. Please find a documentation of the XML elements at Create estimate items, but the XML element offer_id need not be specified 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 estimate
PUT /api/offers/{id}
Updates an estimate with the given parameters.
An estimate can basically be edited in draft status (DRAFT) only.
Items and comments could not be edited at the estimate. Please use the appropriate resource instead.
<offer>
<date>2009-10-13</date>
</offer>
Delete estimate
DELETE /api/offers/{id}
Deletes an estimate with all documents (PDFs), items and comments.
Open pdf of an estimate
GET /api/offers/{id}/pdf
At this point, the parameter 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>
Complete estimate
PUT /api/offers/{id}/complete
Closes an estimate in the draft status (DRAFT) from. Here, the status of open (OPEN) is set and a PDF is generated and stored in the file system.
The optional paramter template_id determines which template is used to create a pdf.
If this parameter is not specified, the default template set is used.
<complete>
<template_id>123</template_id>
</complete>
Send an estimate by e-mail
POST /api/offers/{id}/email
Sends an estimate by e-mail.
| XML element | Description | Type | Default value | Mandatory |
|---|---|---|---|---|
| from | Sender | E-mail address of the current user | ||
| recipients | Recipients of the e-mail. There must be at least one xml note for “to”, “cc” and/or “bcc”. | XML note/EMAIL | yes | |
| subject | Subject of the e-mail (may include placeholders | ALNUM | Value taken from the settings | |
| body | Text of the e-mail (may include placeholders) | ALNUM | Value taken from the settings | |
| filename | Name of the PDF file (without .pdf) | ALNUM | offer_{id} | |
| attachments | Further files. Attachments can contain as many nodes on the “attachment” with the elements “filename”, “mimetype” 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>
Cancel estimate
PUT /api/offers/{id}/cancel
Mark estimate as won
PUT /api/offers/{id}/win
Mark estimate as lost
PUT /api/offers/{id}/lose
Angebot als abgerechnet markieren
PUT /api/offers/{id}/clear
English »
Deutsch