#hari-subscription-migration

1 messages · Page 1 of 1 (latest)

waxen gobletBOT
pearl jasper
#

hari-subscription-migration

topaz shadow
#

but is there a way to create the subscription without having it bill for the current period? or would that have to just be a trial?

pearl jasper
#

I mean that section says future right?

#

My guess is you passed a start_date in the past?

topaz shadow
#

yes

pearl jasper
#

I'm struggling to grasp the problem I'm sorry. You asked how to import so I shared the doc, then you said you read the doc but it doesn't work but the doc say to put a start_date in the future and you passed one in the past.
Why can't you fix it to pass a start_date in the future? What's preventing you from that

topaz shadow
#

Passing a future date doesn't create a subscription in an active state, which is the goal

#

i.e. the subscription is currently live, the user has just already paid for the current term

pearl jasper
#

thanks, that's what I needed really. You want to use backdate_start_date on Subscription creation (no SubscriptionSchedule) and pass proration_behavior: 'none' alongside `billing_cycle_anchor I think.

Example in PHP: $subscription = $stripe->subscriptions->create([ 'customer' => 'cus_123', 'items' => [ ['price' => 'price_123', 'quantity' => '1',], ], 'expand' => ['latest_invoice'], 'backdate_start_date' => strtotime('first day of this month'), 'billing_cycle_anchor' => strtotime('first day of next month'), 'proration_behavior' => 'none', ]);

topaz shadow
#

okay great, that worked, thanks!