#shaitan-Subscription
1 messages · Page 1 of 1 (latest)
Hi there, you need to attach a payment method to your customer before creating the subscription.
I added this:
step1. Create payment method via stripe elements
step2. create customer
step3. attached payment method to the customer
step4. now trying to create subscription?
anything i am doing wrong here?
This is how i am attaching the payment method to customer
Hello @eager cradle any help?
can you send me the request ID so I can take a look?
Thanks for the waiting, please give me a sec
OK, this customer doesn't have a invoice_settings.default_payment_method
so after attaching the payment method to customer, you can also se this payment method as the customer's nvoice_settings.default_payment_method
ok any api link for this?
https://stripe.com/docs/api/customers/update#update_customer-invoice_settings-default_payment_method
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Ok thank you so much @eager cradle
Hey there
Can we get the receipt url after creating the new subscrpition?
I would like to know we have to run the seperate api for this or we can get it in same api.
is it related to the invoices?
Yes
You can pass the subscription to the list invoices API (https://stripe.com/docs/api/invoices/list#list_invoices-subscription), and get the URL from the hosted_inovice_url https://stripe.com/docs/api/invoices/object#invoice_object-hosted_invoice_url
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
I have the invoice id, so you mean I have to call the reterive invoice to get the 'hosted_invoice_url'
Am i right?
Yes you are right
Welcome!