Stripe Subscriptions with email Invoices

Viewed 176

I'm trying to create an app where clients can choose the price for the product and subscribe to it. However creating subscription from code: stripe.Subscription.create(customer=customer_id, items=[{'price': price_id}]) gives me This customer has no attached payment source or default payment method. error. My question is, can I somehow create a subscription and send the payment to email for customers to pay manually? Perfectly, that payment method would be saved for the subscription to renew automatically.

1 Answers

You will need to pass the payment_behavior parameter if you're attempting to create a Subscription without aa payment method (as is the case here).

If you would prefer an invoice to be e-mailed to the customer for payment, then pass the collection_method parameter.

stripe.Subscription.create(
  payment_behavior='default_incomplete',
  collection_method='send_invoice',
  customer=customer_id,
  items=[{'price': price_id}]
)
Related