#Hugues

1 messages ยท Page 1 of 1 (latest)

crisp runeBOT
summer mantle
#

Hi ๐Ÿ‘‹
What specifically are you confused about?

honest vector
#

where to locate the secret key to connect my Booking platform

summer mantle
honest vector
#

i see the SK_ but im not sure if that's the right one or not

burnt peak
summer mantle
#
  1. You don't specify a total. The total is calculated from the line items
  2. 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.

burnt peak
#

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?

summer mantle
#

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

burnt peak
#

Thanks, I'll check that up.

summer mantle
#

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.