#menkui-subscription-draftinvoice
1 messages · Page 1 of 1 (latest)
Hello menkuichan_73425, we'll be with you shortly! Below are links to other discussions we've had with you in the past week in case you want to review that information. If your question is related to one of these previous discussions, please provide a comprehensive summary of the current state and what you need help with now. We help many users simultaneously, so a summary allows us to resolve your issue as soon as possible.
• menkuichan_73425, 0 days ago, 5 messages
• menkuichan_73425, 0 days ago, 8 messages
• menkuichan_73425, 1 days ago, 12 messages
• menkuichan_73425, 1 days ago, 9 messages
@glossy anvil hello! Can you explain your question. You said "like this" with a URL. Sorry there are a lot of people to help, please try and share the relevant context upfront instead
Sorry, it finally created invoice for my test subscription. But it takes more than 1h, so I worried and wrote here.
Thanks for trying to help me :))
My
code:
```const customerId = 'some_customer_id';
const paymentMethods = await stripe.paymentMethods.list({
customer: customerId,
type: 'card',
});
const paymentMethod = paymentMethods.data[0];
const subscription = await stripe.subscriptions.create({
customer: customerId,
items: [{price: 'some_subscription_id'}],
default_payment_method: paymentMethod.id,
trial_end: trialEndDate,
billing_cycle_anchor: billingCycleAnchorDate,
expand: ['latest_invoice.payment_intent'],
});```
It's impossible that this code would create an Invoice in draft
But it happened! I opened Stripe dashboard and noticed that my payment has Draft invoice.
But it was in draft status for 1h and then successfully charged my test user.
no that's impossible. It's either not that code, or you're talking about a different Invoice like the one after the trial or something
Yes, u're right, I meant invoice after the trial.
okay then that's expected, those Invoices always stay open for an hour or two! You can listen to the invoice.created Event and then call the Finalize Invoice API https://stripe.com/docs/api/invoices/finalize