Hi @Vaibhav Reddy Thanks for reaching out. Please refer this doc https://learn.microsoft.com/en-us/rest/api/billing/ to use the rest api calls related to billing and to fetch the all the subscriptions and its associated management ids use this rest api call https://learn.microsoft.com/en-us/rest/api/managementgroups/entities/list?tabs=HTTP
Let me know incase of further queries, I would be happy to assist you.
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.