GET /api/recurrings
<?xml version="1.0" encoding="UTF-8"?> <recurrings type="array" page="1" per_page="100" total="2"> <recurring> ... </recurring> <recurring> ... </recurring> </recurrings>
GET /api/recurrings/?label=foo
Lists all recurring with “foo in the label text. Upper and lower case are ignored.
The following filter parameters are available:
Parameter | Description |
---|---|
client_id | ID of the client |
contact_id | ID of the contact |
name | The Name of the recurring |
payment_type | Payment type (eg. CASH, BANK_TRANSFER, PAYPAL, …). More than one payment type could be given as a comma separated list. Theses payment types will be logically OR-connected. You can find a overview of all payment types at API documentation of payments. |
cycle | Interval (DAILY, WEEKLY, MONTHLY, YEARLY). |
label | Free text search in label text |
intro | Free text search in introductory text |
note | Free text search in explanatory notes |
tags | Comma separated list of tags |
GET /api/recurrings/{id}
<?xml version="1.0" encoding="UTF-8"?> <recurring> <id type="integer">2</id> <created type="datetime">2012-03-02T16:17:41+01:00</created> <client_id type="integer">33234</client_id> <contact_id type="integer" /> <template_id type="integer" /> <email_template_id type="integer" /> <currency_code>EUR</currency_code> <title>Invoice</title> <name>Monthly fee</name> <cycle_number>1</cycle_number> <cycle>MONTHLY</cycle> <action>EMAIL</action> <hour type="integer">16</hour> <start_date type="date">2012-03-03</start_date> <end_date type="date">2012-10-11</end_date> <last_creation_date type="date">2012-05-25</last_creation_date> <next_creation_date type="date">2012-06-01</next_creation_date> <iterations type="integer">0</iterations> <counter type="integer">9</counter> <address /> <due_days type="integer">0</due_days> <discount_rate type="float">1.1</discount_rate> <discount_days type="integer">7</discount_days> <intro>We are pleased to offer you the following items into account:<</intro> <note>Thank you for your order!</note> <total_gross type="float">107.1</total_gross> <total_net type="float">90.0</total_net> <net_gross>NET</net_gross> <reduction>10</reduction> <total_gross_unreduced type="float">119.0</total_gross_unreduced> <total_net_unreduced type="float">100.0</total_net_unreduced> <quote type="float">1.0000</quote> <ultimo type="integer">1</ultimo> <label /> <supply_date_type>SUPPLY_TEXT</supply_date_type> <supply_date>[Dates.month]</supply_date> <email_sender /> <email_subject /> <email_message /> <email_filename /> <email_bcc /> <letter_color>0</letter_color> <letter_duplex>1</letter_duplex> <letter_paper_weight>90</letter_paper_weight> <payment_types /> <offer_id>777</offer_id> <confirmation_id /> </recurring>
cycle can have the following values:
– DAILY
– WEEKLY
– MONTHLY
– YEARLY
action can have the following values:
– CREATE
– COMPLETE
– EMAIL
– MAIL
supply_date_type can have the following values:
– SUPPLY_DATE (supply date as date)
– DELIVERY_DATE (delivery date as date)
– SUPPLY_TEXT (supply date as free text)
– DELIVERY_TEXT (delivery date as free text)
net_gross can have the following values:
– NET
– GROSS
The accepted payment types are separated by comma. You can find a list of all payment types at payments documentation.
Recurring items can be accessed separately.
POST /api/recurrings
Creates a recurring
XML element | Description | Type | Default value | Mandatory |
---|---|---|---|---|
client_id | ID of the client | INT | yes | |
contact_id | ID of the contact | INT | ||
template_id | ID of the template | INT | ||
email_template_id | ID of the email template | INT | ||
title | Document title | ALNUM | ||
address | the address | ALNUM | Pass an empty value to use the current customer address. | |
supply_date | supply/delivery date | MIXED (DATE/ALNUM) | ||
supply_date_type | type of supply/delivery date | ALNUM (“SUPPLY_DATE”, “DELIVERY_DATE”, “SUPPLY_TEXT”, “DELIVERY_TEXT”) | ||
due_days | Due days | INT | due days taken from the settings | |
discount_rate | Cash discount | FLOAT | Value from the settings | |
discount_days | Cash discount days | INT | Value from the settings | |
name | Name of the recurring | ALNUM | ||
label | Label text to describe the project | ALNUM | ||
intro | Introductory text | ALNUM | Default value taken from the settings | |
note | Explanatory notes | ALNUM | default value taken from the settings | |
reduction | Reduction (absolute or percent: 10/10%) | ALNUM | ||
currency_code | Currency | ISO currency code | Default currency | |
net_gross | Price basis (gross or net prices) | ALNUM (“NET”, “GROSS”) | Default value taken from the settings | |
quote | Currency quote (for conversion into standard currency) | FLOAT | 1.0000 | |
payment_types | List (separated by comma) of all accepted payment types. | FLOAT | Default value taken from the settings | |
action | Action to be executed (CREATE, COMPLETE, EMAIL, MAIL) | ALNUM | CREATE | |
cycle_number | Number of intervals. For example, 3 for “every 3 months” | INT | 1 | |
cycle | Interval (DAILY, WEEKLY, MONTHLY, YEARLY) | ALNUM | MONTHLY | |
hour | Time of Day (hour) | INT | 2 | |
start_date | Start date | DATE | tomorrow | |
end_date | End date | DATE | ||
next_creation_date | Date of the next creation | DATE | start_date | |
email_sender | Sender when sending e-mail. If you pass an empty value, the sender will be used from the settings. | ALNUM | ||
email_subject | Subject when sending e-mail. If you pass an empty value, the subject will be used from the settings. | ALNUM | ||
email_message | Message text when sending e-mail. If you pass an empty value, the message will be used from the settings. | ALNUM | ||
email_filename | Filename of the invoice when sending e-mail. If you pass an empty value, the filename will be used from the settings. | ALNUM | ||
email_bcc | Specifies whether to set the sender in BCC. | BOOL | ||
letter_color | Determines whether to use color printing. | BOOL | 0 | |
letter_duplex | Determines whether to use duplex printing. | BOOL | 1 | |
letter_paper_weight | Determines the paper weight in grams. Possible values are 80 or 90. | INT | 90 | |
offer_id | The ID of the estimate, if the recurring was created from an estimate. | INT | ||
confirmation_id | The ID of the confirmation, if the recurring was created from a confirmation. | INT | ||
free_text_id | The ID of the free text to set title, label, intro and note. | INT |
The remaining properties of the account are automatically calculated.
Recurring items (recurring-items) can be specified directly at creation. Please find a documentation of the XML elements at Create recurring items, but the XML element recurring_id need not be specified with.
<recurring> <client_id>1</client_id> <start_date>2011-11-18</start_date> <note>Thank you for your order</note> <recurring-items> <recurring-item> <unit>Piece</unit> <unit_price>1.23</unit_price> <quantity>1.5</quantity> <title>Model</title> </recurring-item> <recurring-item> <unit>hour</unit> <unit_price>90</unit_price> <quantity>8</quantity> <title>Work</title> </recurring-item> </recurring-items> </recurring>
<?xml version="1.0" encoding="UTF-8"?> <recurring> <id type="integer">1234</id> <client_id type="integer">1</client_id> <created type="datetime">2007-12-13T12:12:00+01:00</created> <start_date type="date">2011-11-18</start_date> ... </recurring>
PUT /api/recurrings/{id}
Updates a recurring with the given parameters.
Recurring items could not be edited at the recurring. Please use the appropriate resource instead.
<recurring> <name>Monthly fee</name> </recurring>
DELETE /api/recurrings/{id}
Deletes a recurring with all items.