#suggestion1837

1 messages · Page 1 of 1 (latest)

oblique hareBOT
warped lily
#

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?

grizzled tapir
#

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,
});

warped lily
grizzled tapir
#

req_U3pIVXgBrc29Wv

warped lily
#

How about the response?

grizzled tapir
warped lily
#

The quanity was updated to 1 to 3 and the proration looks correct to me. What is the behaviour that you expected?

grizzled tapir
#

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?

warped lily
#

Based on the response above, the proration is applied to additional 2 items with the amount of $124.80

grizzled tapir
#

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?

warped lily
#

The one you shared here is for unused line item in the old one. You should look for this line item with quantity 3

grizzled tapir
#

ah i got it