Incomings

List all incoming invoices

GET /api/incomings
<!--?xml version="1.0" encoding="UTF-8"?-->
<incomings type="array" page="1" per_page="100" total="2">
    <incoming>
        ...
    </incoming>
    <incoming>
        ...
    </incoming>
</incomings>

You can filter the result by parameters:

GET /api/incomings?number=RE123

Lists all incomings with “RE123” in the incoming number. Upper and lower case are ignored.

The following filter parameters are available:

ParameterDescription
supplier_idID of the Suppliers
incoming_numberincoming number of the incoming
statusStatus (OPEN, PAID, OVERDUE). More than one statuses could be given as a comma separated list. Theses statuses will be logically OR-connected.
fromOnly show incomings since this date (format YYYY-MM-DD)
toOnly show incomings up to this date (format YYYY-MM-DD)
noteFree text search in notes
tagsComma separated list of tags

Aggregated list of incomings

GET /api/incomings?group_by=supplier

Incomings can also be found grouped together. The above example all incomings grouped by supplier.

The following values ​​are for parameter group_by are available:

ValueDescription
supplierSupplier
statusstatus of an incoming
dayday
weekweek (starts with monday)
monthmonth
yearyear

It can also be grouped according to several criteria. The desired values ​​are simply concatenated by commas (?group_by=supplier,year). The order of values ​​determines the order of aggregation.

The grouping parameters can also be combined with the other filters.

<!--?xml version="1.0" encoding="UTF-8"?-->
<incoming-groups type="array" currency_code="USD">
    <incoming-group>
        <total_gross type="float">347.28</total_gross>
        <total_net type="float">291.83</total_net>
        <supplier_id type="integer">476</supplier_id>
        <incoming-params>
            <supplier_id type="integer">476</supplier_id>
        </incoming-params>
    </incoming-group>
    <incoming-group>
        <total_gross type="float">1127.53</total_gross>
        <total_net type="float">947.50</total_net>
        <supplier_id type="integer">477</supplier_id>
        <incoming-params>
            <supplier_id type="integer">477</supplier_id>
        </incoming-params>
    </incoming-group>
</incoming-groups>

Get a single incoming

GET /api/incomings/{id}
<!--?xml version="1.0" encoding="UTF-8"?-->
<incoming>
    <id type="integer">1</id>
    <supplier_id type="integer">123</supplier_id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <number>123</number>
    <status>OPEN</status>
    <date type="date">2009-10-14</date>
    <due_date type="date">2009-10-24</due_date></incoming>
<address>Billomat GmbH & Co. KG
Hollertszug 26
57562 Herdorf
Deutschland</address>

    <note></note>
    <total_gross type="float">107.1</total_gross>
    <total_net type="float">90.0</total_net>
    <paid_amount type="float">20.0</paid_amount>
    <open_amount type="float">99.0</open_amount>
    <currency_code>EUR</currency_code>
    <quote type="float">1.0000</quote>
    <expense_account_number type="float">12345</expense_account_number>
    <label>invoice.pdf</label>
    <client_number>12345</client_number>
    <category>goods</category>

status can have the following values:

  • OPEN
  • OVERDUE
  • PAID

Comments and payments can be accessed separately.

Create an incoming

POST /api/incomings

Creates a new incoming.

XML elementDescriptionTypeDefault valueMandatory
supplier_idID of the SuppliersINTyes
addressthe sender addressALNUMSupplier’s address
numberinvoice numberALNUMyes
dateInvoice dateDATEyes
due_datedue dateDATE
noteExplanatory notesALNUM
total_netTotal net amountFLOAT
total_grossTotal gross amountFLOAT
currency_codeCurrencyISO currency codeSupplier’s currency
quoteCurrency quote (for conversion into standard currency)FLOAT1.0000
base64fileBase64 encoded PDF or image.BASE64FILE
expense_account_numberExpense account numberINT
labelLabel text to describe the incoming invoiceALNUM
client_numberYour customer numberALNUM
categoryCategoryALNUM

The remaining properties of the account are automatically calculated.

<incoming>
    <supplier_id>1</supplier_id>
    <number>RE124</number>
    <date>2009-11-18</date>
    <note>Phone bill</note>
</incoming>
<!--?xml version="1.0" encoding="UTF-8"?-->
<incoming>
    <id type="integer">1234</id>
    <supplier_id type="integer">1</supplier_id>
    <created type="datetime">2007-12-13T12:12:00+01:00</created>
    <number>RE124</number>
    <date type="date">2009-11-18</date>
    <note>Phone bill</note>
    ...
</incoming>

Edit incoming

PUT /api/incomings/{id}

Comments could not be edited at the invoice. Please use the appropriate resource instead.

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

Delete incoming

DELETE /api/incomings/{id}

Deletes an incoming with all documents (PDFs) and comments.

Open pdf of an incoming

GET /api/incomings/{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>
    <incoming_id type="integer">240</incoming_id>
    <filename>incoming_123.pdf</filename>
    <mimetype>application/pdf</mimetype>
    <filesize>70137</filesize>
    <base64file>{base64 encoded PDF}</base64file>
</pdf>