The Aqilla REST API can be used to access different companies.
This is allowed in two different forms. Either by including a company tag in the xml body or by including it in the URL.
Updating Company-specific Document
POST: UPDATING AN EXISTING DOCUMENT.
Only supports company in the URL.
API Request: POST > URL +
?company.name=You Company Name
|
POST / API update request
|
POST /wsapi/2.5/Documents/Purchase Invoice/Purchase Invoice - Details/PI_C reference?company.name=You Company Name
|
For example, if you are using the API to approve or post a purchase invoice and need to specify the company.
Creating Company-specific Document
This is an example of entering a Sales Invoice (Services) document in a specified company.
Supported by Company Tag (<company name=""/>) and URL tag
?company.name=You Company Name
<company name="Demo Ltd"/>
|
API Request
|
PUT https://www.aqilla.net/InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details
Content-Type: application/xml
|
|
Body
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataentry>
<company name="REST Demo Holdings"/>
<entity>
<returnattribute name="Document Reference"/>
<attribute name="Customer Code">MIC001</attribute>
<attribute name="Document Date">01 Feb 2020</attribute>
</entity>
<subordinates>
<returnattribute name="VAT Amount"/>
<entity>
<returnattribute name="Gross"/>
<attribute name="Description">Inspect Googling Hatch</attribute>
<attribute name="Units">Each</attribute>
<attribute name="Qty">4</attribute>
<attribute name="Unit Price">200</attribute>
<attribute name="VAT Rate">Standard</attribute>
<attribute name="Account">P2110</attribute>
</entity>
<entity>
<returnattribute name="Gross"/>
<attribute name="Description">Moisten Globule</attribute>
<attribute name="Units">Each</attribute>
<attribute name="Qty">12</attribute>
<attribute name="Unit Price">55</attribute>
<attribute name="VAT Rate">Standard</attribute>
<attribute name="Account">P2110</attribute>
</entity>
</subordinates>
</dataentry>
|
Response
|
200 OK
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<dataentry>
<entity sguid="LGZQbKWwBRt6Y0o6dDbF4K8pvW">
<returnattribute ubk="1" name="Document Reference">INV_S000001</returnattribute>
<attachments/>
</entity>
<subordinates>
<entity sguid="xjOJkxDI13rM1LDQi5kEkxyAn4" id="1" sequence="1">
<returnattribute name="VAT Amount">160.00</returnattribute>
<returnattribute name="Gross">960.00</returnattribute>
<attachments/>
</entity>
<entity sguid="jWOnyzlHoVZQoLy5HV13GRezqr" id="2" sequence="2">
<returnattribute name="VAT Amount">132.00</returnattribute>
<returnattribute name="Gross">792.00</returnattribute>
<attachments/>
</entity>
</subordinates>
</dataentry>
|