Sideloading
Retrieve related entities in a single request.
Sideloading lets you retrieve related items as part of a single request, instead of calling .info for each relationship.
How it works
Relationships are always represented by a type/id object. For example, a book entry references a company:
{
"Data": {
"Id": "0d6822be-8559-488a-b348-eea0dd4a735b",
"DocumentNo": 1904001,
"CompanyDetail": {
"Company": {
"Type": "Companies",
"Id": "32ebe925-23cc-4a3e-8b36-8b2b33780fc1"
},
"RemarkPayment": null,
"RemarkCompany": null
}
}
}To sideload a relationship, add an Include parameter to the JSON body, containing the dot-notation path of the relationship property:
{
"FolderId": "83f26e75-f474-4b09-a1d3-aa698e18fbf0",
"DaybookId": "87f48c7e-54d1-48d2-aed7-447e6003bc67",
"StartMonth": 1, "StartYear": 2019,
"EndMonth": 12, "EndYear": 2019,
"Include": "CompanyDetail.Company"
}The related entities are returned in an Included property, indexed by object type:
{
"Data": [ ... ],
"Included": {
"Companies": [
{
"Id": "32ebe925-23cc-4a3e-8b36-8b2b33780fc1",
"SearchKey": "HORUS",
"Name": "Horus Software",
"Address": "Quai des ardennes, 9"
}
]
}
}To resolve a relationship, use its Type to find the right collection in Included, then its Id to find the entity.
Multiple relationships
Pass several paths as a comma-separated value:
"Include": "CompanyDetail.Company,Daybook,Folder"Supported endpoints
Sideloading is currently supported on:
book-entries.listaccount-histories.listcompanies.listinvoices.sales.outstanding.list
If you need it on another endpoint, contact us at [email protected].
Updated about 1 hour ago