Document Header - Create, Read & Update
Document Header API Requests
The “www.” subdomain prefix can included and excluded from the URL used for the API Request. Examples below:
https://www.aqilla.net/InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details
https://aqilla.net/InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details
Try excluding “www.” from the URL if your API request fails to pull data.
Create document
The following endpoint URL style is used:
https://{server}/{instance name}/wsapi/2.5/Documents/{summary view}/{details view}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details
Create document - API Request |
XML
|
Body |
XML
|
Response |
XML
|
Create document line
See: Create Document Line
Attach file to document header or line
See: Attachments
Read Document
Document Endpoints and URLs.
https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/DocumentType
An entity can be retrieved by stating its PUBK as the last element of the URL thus:
https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details/INV_S000025
An entity can be retrieved using its GUID thus:
https://www.aqilla.net/ InstanceName/wsapi/2.5/n3xv1A4d2VTXbM6rX7uLAXZrd6
Documents can be read from summary views - e.g. Sales Invoice (Services) - or detail views - e.g. Sales Invoice (Services) - Details.
API Request
Summary Views |
XML
|
Response |
XML
|
The URL in this case can be qualified using:
page
pageSize
thus:
https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)?pageSize=1&Page=2
Read document - Detailed view
API Request |
XML
|
Response |
XML
|
Errors
The 404 Not Found error is returned if the requested entity is not found or the client lacks permissions to access it.
The 409 Conflict error is returned if more than one entity exists with the given PUBK.
Update Document
The following documents cannot be updated using the Aqilla API:
Payroll
Prepayment
Purchase Invoice Matching
Timesheets (Monthly)
The following endpoint URL styles are used:
https://{server}/{instance name}/wsapi/2.5/Documents/{summary view}/{details view}/{UBK}
e.g. https://www.aqilla.net/ InstanceName /wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details/INV_S000026
https://{server}/{instance name}/wsapi/2.5/{GUID}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/nkjsn88768gjx8733d
Update document - example
API REQUEST |
XML
|
Body |
XML
|
Response |
XML
|
Update document line
Promote Document
The following endpoint URL styles are used:
https://{server}/{instance name}/wsapi/2.5/Documents/{summary view}/{details view}/{UBK}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details/INV_S000025
https://{server}/{instance name}/wsapi/2.5/{GUID}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/nkjsn88768gjx8733d
Only a directly referenceable entity - i.e. one that can be addressed by a UBK or GUID - can be promoted.
Standard Aqilla promotion rules apply - e.g. you can't reject a document that has been posted
Entities are promoted by sending a POST request to a URL uniquely identifying the entity. If is is a container entity, subordinate entities are also promoted.
Promote document - example
API Request |
XML
|
Body |
XML
|
Response |
XML
|
Promote document line
The following endpoint URL styles are used:
https://{server}/{instance name}/wsapi/2.5/Documents/{summary view}/{details view}/sub/{line number}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Expenses/Expenses - Details/EXP000001/sub/3
https://{server}/{instance name}/wsapi/2.5/{GUID}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/8sggg986s6787g786sts33ds/sub
The line number may not be obvious to you. If you enter two lines and delete them both the next line will be line 3. It's always safest to use GUID's.
Entities are promoted by sending a POST request to a URL uniquely identifying the entity.
Promote document line - example
API Request |
CODE
|
body |
XML
|
Response |
XML
|
Delete Document
The following endpoint URL styles are used:
https://{server}/{instance name}/wsapi/2.5/Documents/{summary view}/{details view}/{UBK}
e.g. https://www.aqilla.net/ InstanceName/wsapi/2.5/Documents/Sales Invoices (Services)/Sales Invoice (Services) - Details/INV_S000026
https://{server}/{instance name}/wsapi/2.5/{GUID}
e.g. https://www.aqilla.net/ InstanceName /wsapi/2.5/nkjsn88768gjx8733d
Entities are deleted by sending a DELETE request to a URL uniquely identifying the entity. If is is a container entity, subordinate entities are also deleted.
Only a directly referenceable entity - i.e. one that can be addressed by a UBK or GUID - can be deleted. Deletion of subordinate entities (such as document lines) is considered modification of their parent entity and this may be introduced in a future version. Contact your Aqilla consultant or account manager if you think you need this.
Standard Aqilla deletion rules apply - e.g. you can't delete a document that has been posted.
Entities are deleted by sending a DELETE request to a URL uniquely identifying the entity. If is is a container entity, subordinate entities are also deleted. Attachments are deleted together with the entities they were attached to.
If the entity was found and successfully deleted, 204 No Content is returned with no body. If the entity was found but could not be deleted (typically because of it being read only or the user lacking the necessary permissions) 409 Conflict is returned. If the entity was not found 404 Not Found is returned. In the two last cases the encoding of the response body is application/xml.
Delete document - example
API Request |
XML
|
Response |
XML
|
Delete document line
See: Delete Document Line