In GET/business-partners/{id}
and GET/customers/{id}
requests, you can include an expand
query parameter to get more information about certain nested objects. For example, when you make a GET/business-partners/{id}
, the response includes the following object which you can expand to view more.
"to_Customer": {
"__deferred": {
"uri": "http://107.23.145.245:50000/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_BusinessPartner('122')/to_Customer"
}
}
Expand a Single Object
To expand the nested object, add the expand
query parameter: GET/business-partners/{id}/expand=to_Customer
.
The response includes the expanded object:
"to_Customer": {
"NielsenRegion": "",
"CreationDate": "1529020800000",
"IndustryCode2": "",
"CreatedByUser": "RAMANA",
"Customer": "57",
"IndustryCode1": "",
"to_CustomerCompany": {
"__deferred": {
"uri": "http://107.23.145.245:50000/sap/opu/odata/sap/API_BUSINESS_PARTNER/A_Customer('57')/to_CustomerCompany"
}
}
Expand a Sub-object
Notice that the to_Customer
includes the to_CustomerCompany
that can also be expanded. You can expand sub-objects with a request like GET/business-partners/{id}/expand=to_Customer/to_CustomerCompany
.
Expand Multiple Objects
Expand multiple objects by including a comma-separated list in the query parameter. Do not add spaces between commas. For example, GET/business-partners/{id}/expand=to_Customer,to_Supplier
.