Happy Business Starts Here

Valued Scholar

ZOQL - Get ultimate parent account number from a child account

Hi,

 

I am currently investigating a way to send a POST request with a ZOQL query string and an account number to get a reponse containg the ultimate parent account number

 

Is there a way to get this in a single request?

 

Also, we are hoping to use this number to bring back an HPM page so the user can update their payment information, but we need to ensure it updates the correct account. Do the Payment Pages support this functionality?

 

Thanks!

1 REPLY 1
Highlighted
Zuora Alumni

Re: ZOQL - Get ultimate parent account number from a child account

 Hi @ayonge,

 

POST call per requested, you can provide the child tenant's ID in the query, and you will receive the ultimate parent ID.

 

docs: https://www.zuora.com/developer/api-reference/#operation/Action_POSTquery

 

endpoint: 

 

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

 

Request Body:

{
  "queryString": "select ParentId from Account where Id = '2c92c0f963da67f80163dc5b16d631e3'"
}

Response:

{
    "records": [
        {
            "ParentId": "2c92c0f963da67f70163dc5a61972eb8",
            "Id": "2c92c0f963da67f80163dc5b16d631e3"
        }
    ],
    "size": 1,
    "done": true
}

Or, you can use GET call as well, you will see "parentId" under "basicinfo" in the JSON returned.

 

GET call with endpoint:

 

https://rest.apisandbox.zuora.com/v1/accounts/2c92c0f963da67f80163dc5b16d631e3

 

docs: https://www.zuora.com/developer/api-reference/#operation/GET_Account

 

Hope this helps, thank you!

 



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

Tags (3)