{"action":"opened","issue":{"url":"https://api.github.com/repos/killbill/killbill/issues/401","labels_url":"https://api.github.com/repos/killbill/killbill/issues/401/labels{/name}","comments_url":"https://api.github.com/repos/killbill/killbill/issues/401/comments","events_url":"https://api.github.com/repos/killbill/killbill/issues/401/events","html_url":"https://github.com/killbill/killbill/issues/401","id":109402426,"number":401,"title":"Add ability to query next invoice for a specific subscription","user":{"login":"sbrossie","id":246910,"avatar_url":"https://avatars.githubusercontent.com/u/246910?v=3","gravatar_id":"","url":"https://api.github.com/users/sbrossie","html_url":"https://github.com/sbrossie","followers_url":"https://api.github.com/users/sbrossie/followers","following_url":"https://api.github.com/users/sbrossie/following{/other_user}","gists_url":"https://api.github.com/users/sbrossie/gists{/gist_id}","starred_url":"https://api.github.com/users/sbrossie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sbrossie/subscriptions","organizations_url":"https://api.github.com/users/sbrossie/orgs","repos_url":"https://api.github.com/users/sbrossie/repos","events_url":"https://api.github.com/users/sbrossie/events{/privacy}","received_events_url":"https://api.github.com/users/sbrossie/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/killbill/killbill/labels/enhancement","name":"enhancement","color":"84b6eb"},{"url":"https://api.github.com/repos/killbill/killbill/labels/INVOICE","name":"INVOICE","color":"0b02e1"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-01T23:10:49Z","updated_at":"2015-10-01T23:10:49Z","closed_at":null,"body":"Our current invoice dryRun endpoint `/1.0/kb/invoices/dryRun`allows to fetch the following info:\r\n* 1. Next scheduled invoice:\r\n   * 1.a Given a `targetDate`, return the invoice associated to an account for that date\r\n   * 1.b Given a special `targetDate=upcomingInvoiceTargetDate`, compute the next upcoming invoice date for that account and return the associated invoice\r\n* 2. Invoice associated with subscription operation (creation, change, cancel)\r\n\r\nThis issue address the case 1.b for customers using `SUBSCRIPTION` or `BUNDLE` `billingAlignments`. In those cases, we would like the system to compute the targetDate date for a given subscription  or bundle.\r\n\r\n"}}