#Wik
1 messages · Page 1 of 1 (latest)
Hi there!
Can you clarify what you mean by "I'm copying a subscription between two Stripe accounts"?
Our comapny has two Stripe accounts: A and B. A customer has a subscription in A, now we want to copy it to B. We need to keep the proration behaviour from the subscription that exists in account A.
And what do you mean by "proration behaviour"?
👋 taking over for my colleague. Let me catch up.
just to clarify something, proration behavior is not something that is stored on the subscription object. meaning that if you do a change on the subscription (upgrade/downgrade, change quantity, etc.) and you apply a proration this would only apply to this specific change
yes go ahead
Let's say there is a monthly subscription that was started on the 1st of November. It has collection_method = send_invoice. On 15th November, I want to copy it to the other account. I want the date when the user will be sent invoice to remain unchanged. I want the new subscription to have the correct start_date = 1st November.
For subscriptions with collection_method = charge_automatically, I do it the following way and it works correctly. But when I do it foe send_invoice, I can see that there was an additional invoice for the time between now and backdate_start_date. I do not want to create any invoice for that period of time. User should only be invoiced for the next period, starting on 1st December. Example subscription that was incorrectly copied over: sub_1LzduLJA8pMPzFjlv4jDGj80
billing_cycle_anchor: subscription.current_period_end.to_i,
backdate_start_date: subscription.current_period_start.to_i,
proration_behavior: "none",
collection_method: au_stripe_subscription.collection_method,
days_until_due: au_stripe_subscription.days_until_due,
trial_end: au_stripe_subscription.trial_end,
plan: subscription.plan_id,
coupon: coupon_id,
cancel_at_period_end: subscription.cancel_at_period_end
)```
why not just start the subscription on the next cycle?
I'm thinking of a solution here
I'm not sure if I understand
The users paid for access for the whole cycle
Their subscription has to be active in the new stripe account as they have to have access to the app
I think I figured it out; I can create the subscription in the new account with auto collection method and then update it to send invoice
sorry again, I got side-tracked with all the other discord threads
I'm terribly sorry,
what I meant is that since you already have given access to your customer for your subscription for that cycle you can really start with the next cycle with the new subscription
this is a workaround that can work but you'd have to give the user a free trial until the end of the cycle so they don't get billed
But I'll be deleting the subscription from the other account
I think not; since I set billing_cycle_anchor in the future and backdate_start_date in the past, I believe they'll only be charged (invoiced) on 1st december, e.g. sub_1LzevIJA8pMPzFjlS4guf2Hv
Hey, taking over here. Let me know if there's any follow-up Qs I can answer!