#richard-xata-subscription
1 messages · Page 1 of 1 (latest)
I think you can, but I really need to test this
the idea is that you can pause the collection and the behavior could be set to keep_as_draft and set resumes_at to something like 5min after
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
in that time you could get the latest_invoice and update it
it will still be 2 steps but in that case you wouldn't have to generate a new invoice
Oh sorry should I have said. Tried that first of all.
latest_invoice.status == 'finalized' and it errored saying you cannot update a finalized invoice.
I also want to attempt to take the money synchronously so I can try and handle 3ds
I think a good goal might be: Do less API calls.
It's not ideal that I'm currently at 3. Can you create, finalize and pay and invoice in one?
errored saying you cannot update a finalized invoice.
Yep, this just launched in the Dashboard. Still in beta for API: https://stripe.com/docs/invoicing/invoice-edits
Learn how to edit invoices after finalization.
Can you create, finalize and pay and invoice in one?
Not currently, no
It says: You can’t, however, revise a void invoice or one that your customer has already paid
so maybe no good either? (but thank you!)
So given the constraint of: 'Synchronous for 3DS', the best we can do is 4 API calls?
Any advance on 4?
What is the constraint? Sorry, haven't had opportunity to capture the full context of what you're trying to do
My understanding it's possible that when the upgrade happens 3DS might be triggered. Since the customer is present in my UI I'd like to synchronously check if they need to 3DS at the moment they upgrade their subscription.
Yep, you'd check the status field on latest_invoice.payment_intent returned in the subscription update call
How do the description/metadata fields apply here?
How do the description/metadata fields apply here?
what do you mean sorry?
Your original Q:
I'm want to update a subscription and charge our customer immediately. But I'd also like to control the description & metadata of the invoice.
yes that's right
what is your question? How do they apply? Apply to what?
You cannot pass invoice description / metadata on the subscription update call?
No, you'd update them on the latest_invoice ID returned after the update call
Correct
You could pass payment_behavior: 'default_incomplete' in your update call and then the PI will require explicit confirmation from you (and Invoice will be in an updatable state): https://stripe.com/docs/api/subscriptions/update#update_subscription-payment_behavior
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
interesting
That possibly that would get us to 3 API calls.
I think I want allow_incomplete for my subscriptions really though
I mean...ideally it would be cool to be allowed to pass some invoice data when using proration_behavior: always_invoice
Yep, fair!
I think maybe 4 api calls might be the way :\
I mean obviously with 4 calls I'm opening us to risk that if a middle call fails things will end up in a weird state.
In those cases you'd chain them in that if 1 fails, the others aren't attempted
I mean
what if the last one fails?
now I've edited their subscription but not finailized the invoice?
Then you'd implement retries with our client libs: https://stripe.com/docs/error-low-level#idempotency
Most of them have a stripe.setMaxNetworkRetries(2) configurable param
ok thanks - I'll se it
Does the billing team have any plans to allow me to do it one?
Hi! I'm taking over this thread.
Can you clarify what you mean by "to allow me to do it one"?
@primal mulch have you read the thread?
Yes, are you asking about "create, finalize, and pay and invoice in one API call"?
If you want to suggest that as a feature request, you can contact Stripe support directly here: https://support.stripe.com/contact
If you read up a bit higher. It's actually on the subscription.update call
although consolidating invoices would be good too
It's 4 API requests back to back is the best solution so far
Unfortunately I'm not really sure whether this is on the roadmap currently but making a feature request here for your use case will definitely get us closer to that any which way.
Can I just link to here to explain or do I need to write out again?
I think writing a more concise summary of what you are aiming for would be better. You can link to this thread or copy the contents but that might be harder for us to turn in to an actionable request
Awesome! Thank you for your feedback