Happy Business Starts Here

Parent ID query

Rolando
Support SME

Parent ID query

Is there a way to get a Parent ID for an account easily? I need to access it programmatically via either your SOAP or REST api.

 





If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

1 ACCEPTED SOLUTION

Accepted Solutions
Rolando
Support SME

Re: Parent ID query

For SOAP, you can use the Account object to query the "ParentId" field: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Account

 

For REST, you can use ACTIONS to query the ParentId: https://www.zuora.com/developer/API-Reference/#operation/Action_POSTquery

 

For example:

https://rest.apisandbox.zuora.com/v1/action/query

{
"queryString": "select AccountNumber, AutoPay, ParentId from Account where Id = '2c92c0f85c2056a4015c324278243b57'"
}

 

You can also look up the child accounts from the parent ID using the same logic above. 

 

Using SOAP, you can run the same query as follows:

 

<ns1:query>
<ns1:queryString>Select Id, AccountNumber From Account where ParentId = '2c92c0f85018069e01501b80843d2974'</ns1:queryString>
</ns1:query>

 

Same logic should work for REST as well.

 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post

1 REPLY 1
Rolando
Support SME

Re: Parent ID query

For SOAP, you can use the Account object to query the "ParentId" field: https://knowledgecenter.zuora.com/DC_Developers/G_SOAP_API/E1_SOAP_API_Object_Reference/Account

 

For REST, you can use ACTIONS to query the ParentId: https://www.zuora.com/developer/API-Reference/#operation/Action_POSTquery

 

For example:

https://rest.apisandbox.zuora.com/v1/action/query

{
"queryString": "select AccountNumber, AutoPay, ParentId from Account where Id = '2c92c0f85c2056a4015c324278243b57'"
}

 

You can also look up the child accounts from the parent ID using the same logic above. 

 

Using SOAP, you can run the same query as follows:

 

<ns1:query>
<ns1:queryString>Select Id, AccountNumber From Account where ParentId = '2c92c0f85018069e01501b80843d2974'</ns1:queryString>
</ns1:query>

 

Same logic should work for REST as well.

 






If you found my answer helpful, please give me a kudo ↑
Help others find answers faster by accepting my post as a solution √

View solution in original post