#sarvesh-subs-proration
1 messages · Page 1 of 1 (latest)
👋 how can I help?
Hi
we are creating subscription with billing_cycle_anchor by setting next billing date 1st of each next month. which is working fine BUT if we switch the plan to another plan then we are passing 'billing_cycle_anchor'=>'unchanged' but it charges for full amounth immdiately and not prorated
how to fix this?
Can you share an example request ID?
$subscription = $stripe->subscriptions->create([
'customer' => $stripeCustomerId,
'items' => [[
'price' => $stripePriceId,
]],
'billing_cycle_anchor' => $billingCycleAnchor, //Set billing cycle 1st day of next month
'metadata' => $metaData,
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
]);
$subscription = $stripe->subscriptions->update($subscriptionData['stripe_subscription_id'],[
'items' => [[
'id' => $subscriptionData['subscription_item_id'],
'price' => $stripePriceId,
]],
'metadata' => $metaData,
'billing_cycle_anchor'=>'unchanged',
'payment_behavior' => 'default_incomplete',
]);
the update subscription charge full amount even on 31 today. It should charge for remaining days in month unti 1st of each month
sub_1Oe9AAHbAvQl6Cwu54gs39Xr
this is todays example subscription id
what needs to do to fix it?
I'm looking, give me a few
Where exactly are you seeing it charge the full month amount?
https://dashboard.stripe.com/test/subscriptions/sub_1Oe9AAHbAvQl6Cwu54gs39Xr
I don't see an invoice for the full month amount being charged on 30th (when you updated)
sarvesh-subs-proration
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
that's the same link I shared above?
yes, so it was not created invoice as of today but it will charge on 1st of next month?
Yes, the prorated amount would be added to the next month invoice.
if you want to charge it at the time of the update then you'd need to set proration_behavior to always_invoice when you update the subscription
https://stripe.com/docs/api/subscriptions/update#update_subscription-proration_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.