Symptoms
Is there a solution to programmatically find out the list of open invoices belonging to particular subscription (to identify the one which needs to be paid) using REST API Interface?
Resolution
At this moment such functionality is not implemented via specific single API call, however there is a way to get such information using several API calls:
1) You need to obtain Particular Account Token. For tests you can use browser developers tools while navigating in UX1.
There is also a way to generate token using public xml-rpc api call:
2) Then you need to Get all available Account Resources using generated token: GET https://Provider_CP/aps/2/resources/
Find Billing Application ID among the output
"id": "2b166141-ee28-475c-b091-14e1c75ae6ac",
"type": "http://www.parallels.com/products/automation/billing/1.8",
3) Use obtained Application ID to Get the list of unpaid invoices by the following invocation:
It will return an array of Invoice related data like below:
0 {…}
id 48
number 000018
isOrder false
orderType 20
statusId 340
date 2019-01-07T00:00:00.000Z
dueDate 2019-01-17T00:00:00.000Z
time 1546904706
currencyId USD
After that you can use obtained ID and Number to pay.