#Hugues
1 messages ยท Page 1 of 1 (latest)
Hi ๐
What specifically are you confused about?
where to locate the secret key to connect my Booking platform
I created a separate thread for you
i see the SK_ but im not sure if that's the right one or not
Where do you specify the total amount (the Product? which property?) vs where do you specify the monthly payment amount (the Price? which property?)
- You don't specify a total. The total is calculated from the line items
- You don't specify the monthly payment. That is calculated from the Price records.
For example: If you have one price for $20/month and another for $10/month and a Customer subscribes to both of them, the monthly invoice will be for a total of $30.
So, if I have a single line item of $300, this is my total amount. Then, if I have a single Price structure for monthly payments and its unit price is $10, then it will require 30 monthly payments?
No
That is not how subscriptions work
A line item must correspond to a Price. That Price must have a recurring amount. That is an amount and a frequency.
It sounds like you are trying to bill in installments, which is not something Subscriptions automatically do without more configuration
We have a product called a Subscription Schedule that may be a better fit for your use case. https://stripe.com/docs/billing/subscriptions/subscription-schedules/use-cases#installment-plans
Thanks, I'll check that up.
Taking your example, if you had a recurring Price object with an amount of $10 and a frequency of monthly, and you wanted to collect a total of $300, you would create a phases array of a single phase with that Price ID and iterations of 30 for 30 months.
e.g.
stripe.SubscriptionSchedule.create(
customer='{{CUSTOMER_ID}}',
start_date="now",
end_behavior="cancel",
phases=[{"items": [{"price": '{{YOUR_PRICE_HERE}}', "quantity": 1}], "iterations": 30}],
)
This would invoie the customer identified by the {{CUSTOMER_ID}} $10 every month, for 30 months, and then stop.