#suggestion1837
1 messages · Page 1 of 1 (latest)
Proration will be applied to the one that is being changed. Are both items changed? Can you share an example request ID (req_xxx) of upcoming retrieval and its response?
request is
const items = [
{
id: stripeSubscription.items.data[0].id,
price: billingProductTarget.providerPriceId, // Switch to new price
quantity: (billingSubscription.seats ?? 1) + (extraSeats ?? 0),
},
];
const invoice = await this.stripeClient.invoices.retrieveUpcoming({
customer: stripeSubscription.customer as string,
subscription: stripeSubscription.id,
subscription_items: items,
subscription_billing_cycle_anchor: 'now',
subscription_proration_behavior: 'always_invoice',
// subscription_proration_date: proration_date,
coupon: discountEligiblity.coupon,
});
Can you share the request ID (req_xxx) and its response, not the code? Here’s how you can find it: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support site provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_U3pIVXgBrc29Wv
How about the response?
The quanity was updated to 1 to 3 and the proration looks correct to me. What is the behaviour that you expected?
The quantity changes from 1 to 3, and it appears that proration is applied to the original 1 item. Can this be reversed to apply to the 2 additional items instead?
Based on the response above, the proration is applied to additional 2 items with the amount of $124.80
I think proration price is 38.4 so total is 105.6
proration_details: {
credited_items: {
invoice: 'in_1NqUQ3IX9E6NiiqiXvRDDA76',
invoice_line_items: ['il_1NqUPUIX9E6NiiqiSaRZCMMw'],
},
},
quantity: 1,
subscription: 'sub_1NqUQ3IX9E6Niiqitz0gjWyL',
subscription_item: 'si_OdlxpG6Pft0ny6',
tax_amounts: [],
tax_rates: [],
type: 'invoiceitem',
unit_amount_excluding_tax: '-1920',
quantity is 1 , why is not 2?
The one you shared here is for unused line item in the old one. You should look for this line item with quantity 3
ah i got it