Creating subscriptions requires a customer, which represents the customer purchasing your product. Because the price you created charges on a monthly basis, you need to add a stored payment method to the customer so future payments are successful. You do this by setting the payment method you just collected at the top level of the Customer object and as the default payment method for invoices:
This returns a
Customer object. You can see the default payment method in the
After creating the customer, store the
id value in your own database so you can use it later. The next step also requires this ID.