You need to sign in to do that
Don't have an account?
gtuerk_greensaas
API User cannot access Order Items
I have provisioned an API Integration User user with the Salesforce API Integration User profile and granted a Permission Set to access Standard Objects, including Account, Contact, Order and Product (Product2). Queries against Order Products (OrderItems) fail with an unsupported type, although these are granted appropriate permissions in the Permission Set. The same query resolves correctly with a System Admin account. If this is a product limitation with the use of the API Integration User license, please route appropriately to the Product team
https://INTENTIONALLY_OBSCURED.sandbox.my.salesforce.com/services/data/v55.0/query/?q=SELECT+name,(select+id+from+orderitems)+from+order+where+id='8018I000001zbmDQAQ'
"message": "\nSELECT name,(select id from orderitems) from order where id='8018I000001zbmDQAQ'\n ^\nERROR at Row:1:Column:29\nDidn't understand relationship 'orderitems' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.",
"errorCode": "INVALID_TYPE"
https://pow--dev1.sandbox.my.salesforce.com/services/data/v55.0/query/?q=SELECT+name,status+from+order+where+id='8018I000001zbmDQAQ'
{
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Order",
"url": "/services/data/v55.0/sobjects/Order/8018I000001zbmDQAQ"
},
"Name": null,
"Status": "Fulfilled"
}
]
}
https://INTENTIONALLY_OBSCURED.sandbox.my.salesforce.com/services/data/v55.0/query/?q=SELECT+name,(select+id+from+orderitems)+from+order+where+id='8018I000001zbmDQAQ'
"message": "\nSELECT name,(select id from orderitems) from order where id='8018I000001zbmDQAQ'\n ^\nERROR at Row:1:Column:29\nDidn't understand relationship 'orderitems' in FROM part of query call. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.",
"errorCode": "INVALID_TYPE"
https://pow--dev1.sandbox.my.salesforce.com/services/data/v55.0/query/?q=SELECT+name,status+from+order+where+id='8018I000001zbmDQAQ'
{
"totalSize": 1,
"done": true,
"records": [
{
"attributes": {
"type": "Order",
"url": "/services/data/v55.0/sobjects/Order/8018I000001zbmDQAQ"
},
"Name": null,
"Status": "Fulfilled"
}
]
}
Also check below references for Order Items object permissions.
https://help.salesforce.com/s/articleView?id=sf.cpq_order_permissions.htm&type=5
https://help.salesforce.com/s/articleView?id=000394000&type=1
Please mark as Best Answer if above information was helpful.
Thanks,