#NFTBOI-sub-trial-payment

1 messages · Page 1 of 1 (latest)

wicked sable
#

Hey there. What are you expecting to charge for immediately if there's an initial free trial?

keen fulcrum
#

trial is for upgraded package but i wanna charge for selected package

#

im giving free trial for upgraded package but i wanna charge for the current package as well

wicked sable
#

Sounds like you'll want 2 separate line items when creating the subscription then. Do you have an example API request you've tried?

keen fulcrum
#

$sub_result = $stripe->subscriptions->create([
'customer' => strval($customer),
'items' => [['price' => strval($price_id)]],
'billing_cycle_anchor' => 'now',
'trial_period_days' => 15,
]);

wicked sable
#

How is your pricing/plans modelled in Stripe?

keen fulcrum
#

here's a simplified version for u to understand
{
"PlayBookAI": [
{
"type": "year",
"price": 249
},
{
"type": "month",
"price": 299
}
],
"PlayBook+": [
{
"type": "year",
"price": 149
},
{
"type": "month",
"price": 199
}
],
"PlayBook": [
{
"type": "free",
"price": 0
}
]
}

wicked sable
#

And are they created as Product/Prices in Stripe?

#

You can't achieve what you want with a single item (like the API request you shared). You're going to need to pass in multiple

keen fulcrum
#

yes they are created that way.

#

but i wanna charge for a single price

#

right now

#

trial is just a complement

#

it will expire automatically after 15 days

wicked sable
#

Yep, so you'll need to add 2 separate price_xxx IDs to your items array when creating the subscription

#

it will expire automatically after 15 days
That won't happen automatically, you'll need to schedule that