#glenb.
1 messages · Page 1 of 1 (latest)
This looks like a complicated scenario, can you simply the description and help me understand what you want to achieve?
Ok, give me a minute to draft something
A customer subscribes a token on the 5th and is charged $50 which recurs monthly. (Item 1)
On the 10th he adds another token to the subscription (Item 2) and is charged $50 for the new token and $5 (estimate) prorata for the Item 1, with the anchor date now set to the 10th for both items (quantity 2)
He then cancels one of the items (Item 2) which reduces the quantity to 1, but my system allows him to use Item 2 until the 10th (because he paid to the 10th).
There is now 1 item (Item 1) on the subscription, however my system has 2 items (Item 1 & 2) which can be used until the 10th.
Scenario 1: The user decides to undo cancelling Item 2 (EG: he clicks ‘Undo cancellation’) so it will remain part of the subscription. I simply adjust the quantity of the subscription by +1 (ie: subscription item quantity = 2) with no charge as it is paid to the 10th. Easy!
Scenario 2: The user now adds a new item (Item 3) to the subscription on the 15th, so the stripe subscription updates the anchor date to the 15th, charging the existing item (Item 1) as prorata so they both (Items 1 & 3) renew on the 15th. No problem. Then the user decides to undo cancelling the item (as per Scenario 1). I can’t simply increase the quantity by 1 (so it is quantity: 3) because the renew date is no longer the 10th. I need a way to charge the customer prorata for the new renewal date (15th).
To simplify the question, how can I use the API to calculate a prorata charge for an item which is paid to the 10th and now needs to be extended to the 15th?
Thanks for the explanation. Although there's no API dedicated for proration, there's an upcoming invoice API that you can use to preview the upcoming invoice based on some changes to a subscription. https://stripe.com/docs/api/invoices/upcoming#upcoming_invoice Can you take a look and see if this solves the problem?
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.