This API provides access to invoice data in the ForestCRM system.
This API provides the following services:
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/invoices
Request HTTP method: GET
Request parameters:
If no parameters are supplied, all invoices for the tenant are returned. Any combination of parameters are allowed; they are 'AND'-ed.
GET https://app.forestcrm.hu/api/xml/demo/invoices?companyId=5206
Response conforms the attached XSD.
Notes:
<invoices> <invoice id="30"> <updated>2011-10-25T22:37:17+02:00</updated> <company id="5206">VIP Inc.</company> <opportunity id="121">Consulting</opportunity> <imported>false</imported> <invoice_no>IU-12345/2010</invoice_no> <description>Plans;</description> <amount> <value>15000</value> <currency>USD</currency> </amount> <delivery_date>2010-12-29</delivery_date> <invoice_date>2010-12-21</invoice_date> <due_date>2010-12-29</due_date> <paid_date>2011-01-03</paid_date> <paid_date_user_editable>true</paid_date_user_editable> </invoice> <invoice id="38"> <updated>2011-11-01T20:17:03+02:00</updated> <company id="5206">VIP Inc.</company> <opportunity id="121">Project management</opportunity> <imported>true</imported> <invoice_no>IU-27462/2010</invoice_no> <description>1st Phase</description> <amount> <value>5000</value> <currency>USD</currency> </amount> <delivery_date>2010-12-31</delivery_date> <invoice_date>2010-12-31</invoice_date> <due_date>2011-01-31</due_date> <paid_date /> <paid_date_user_editable>false</paid_date_user_editable> </invoice> </invoices>
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/invoices
Request HTTP method: POST
Request parameters:
true
, modifications to this invoice via UI get disabled. Boolean; optional, defaults to false
. Setting it to true
helps keeping the source system and Forest in sync. See also paid_date_user_editable
.true
users can modify paid_date
of this invoice via the UI, regardless of the setting of imported
. Boolean; optional, defaults to true
. Intended for systems that can export invoices but cannot set matching payment date later.POST https://app.forestcrm.hu/api/xml/demo/invoices
Header:
Content-Type: application/json
Body:
{ "invoice": { "invoice_no": "A23445/2011", "imported": true, "amount": 10000, "description": "1st Phase", "opportunity_id": "566", "delivery_date": "2011-03-26", "invoice_date": "2011-03-26" "due_date": "2011-04-26" } }
If the company could be created the response is of status code 200 and the body contains the the ID of the invoice created in XML format:
<invoice> <id type="integer">14914</id> </invoice>
Errors are reported with a status code (422) and the response body contains the errors in XML format.
The request format is:
https://app.forestcrm.hu/api/xml/<API KEY>/invoices/<invoice ID>or
https://app.forestcrm.hu/api/xml/<API KEY>/invoices/<invoice ID>?external_ref
Request HTTP method: PUT
Request parameters:
true
, modifications to this invoice via UI get disabled (boolean). Boolean; optional. Setting it to true
helps keeping the source system and Forest in sync. See also paid_date_user_editable
.invoice_no
is not empty, otherwise optional.invoice_date
and must be present with it.invoice_date
. No partial payments.true
users can modify paid_date
of this invoice via the UI, regardless of the setting of imported
. Boolean; optional. Intended for systems that can export invoices but cannot set matching payment date later.Note that the requested attributes get updated (overwritten), missing attributes don't change.
PUT https://app.forestcrm.hu/api/xml/demo/invoices/14914
Header:
Content-Type: application/json
Body:
{ "invoice": { "paid_date": "2011-05-02" } }
If the invoice could be updated the response is of status code 200.
Errors are reported with a status code (422) and the response body contains the errors in XML format.