#Keika
1 messages ยท Page 1 of 1 (latest)
Hello ๐
Can you expand a bit more on the context?
Hi, yes of course
it's a follow up on my question here
so now I'm trying to create a subscription for a user that will pay me "out of band". So I understand how to change the invoice, but I first need to create the subscription so that the invoice gets created automatically.
In trying the create the subscription, as my Customer is brand new and doesn't have a payment method on file, I get the error:
This customer has no attached payment source or default payment method. Please consider adding a default payment method.
that's from calling the subscriptions/create API
Can you try passing in collection_method: send_invoice when you create a subscription?
https://stripe.com/docs/api/subscriptions/create#create_subscription-collection_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 I will try that, I saw it in the docs, but I wasn't sure if it was a good idea
ok, it's moving forward:
If invoice collection method is 'send_invoice', you must specify 'days_until_due'.
Yeah some parameters might change based on the collection method
ok, I did that too
and it worked
subscription is created
Now question, is the invoice sent to the customer when that happens?>
I believe we do send it to the customer
ah, can I prevent that from happening? ๐
Hmm good question ๐
I don't think there's a way to do that
Let me think if there's a workaround
thanks
in the same flow, I will get the invoice, set it as PAID, with paid_out_of_band = true
If you switch back to charge_automatically collection method and tweak the payment_behavior then you should see a different behavior
https://stripe.com/docs/api/subscriptions/create#create_subscription-payment_behavior
Can you try setting collection_method: charge_automatically and payment_behavior to allow_incomplete
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 did try allow incomplete just before
huh interesting
What if you change it to default_incomplete
but not with charge automatically, let me try that please
sure!
This customer has no attached payment source or default payment method.
โฌ๏ธ I get this error
with both payment_behavior?
Can you share the request IDs for these requests?
actually you know what? Im checking the Invoice in the Dashboard, and the invoice created for the successful Subscription creation is in Draft
does Stripe send draft invoices?
We don't send draft invoices, no.
We send it once they've been finalized ๐
so I think we're good here ๐
so long as the invoice isn't sent by email, I can do the rest
Awesome! ๐ Glad I could help
thanks for your help!
NP! ๐ Happy to help
Good luck