#usama_schedule-invoice2
1 messages ¡ Page 1 of 1 (latest)
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.
- usama_schedule-invoice, 59 minutes ago, 5 messages
- usamarashad_api, 2 days ago, 3 messages
đ Welcome to your new thread!
â˛ď¸ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
âąď¸ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
đ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1235657146776027239
đ Have more to share? Add more details, code, screenshots, videos, etc. below.
@lost hull do you have actionable details? I did share the exact API to use earlier: https://docs.stripe.com/api/invoices/finalize so what exactly is the problem, what error do you get, what does your code look like?
usama_schedule-invoice2
This is the code I have written : // Create the subscription schedule with phases
const subscriptionSchedule = await stripe.subscriptionSchedules.create({
customer: customer.stripeID.toString(),
start_date: startDate,
end_behavior: "release",
phases: phases.map((phase, index) => ({
items: [
{
price: prices[index],
quantity: phase.quantity,
},
],
iterations: 1,
})),
});
// Get the customer default payment method
const paymentMethods = await stripe.customers.listPaymentMethods(customer.stripeID.toString(), { type: "card" });
// Add the payment method to the schedule
let sub = await stripe.subscriptionSchedules.update(subscriptionSchedule.id, { default_settings: { default_payment_method: paymentMethods.data[0].id } });
Okay, so where are you using the API I recommended to use? What have you tried?
cc @lost hull are you around? I'm sorry but we try to help in real time here