#bhanu365

1 messages ยท Page 1 of 1 (latest)

peak raptorBOT
solid palm
#

It sounds like you tried to set a one-time price as one of the subscription's items which is not allowed (as that error message says)

#

You can add one time prices in ways that get added to individual invoices but cannot set it as an item on the subscription

inland dove
#

I am using this code for the one-time but getting the same error
\Stripe\Subscription::create([
'customer' => $customer->id,
'add_invoice_items' => [[
'price' => $price_id
]],
'items' => [[
'price' => $price_id,
'quantity' => 1,
]],
'payment_behavior' => 'default_incomplete',
'payment_settings' => ['save_default_payment_method' => 'on_subscription'],
'expand' => ['latest_invoice.payment_intent'],
]);

solid palm
#

The ID will be of the form req_123

inland dove
#

req_OW8VZCY9NKy1Kb

solid palm
#

Thank you, checking in to that request

#

Ah so you included the price in both items and add_invoice_items, it should only be in add_invoice_items

#

And you will need at least one recurring price

#

Can you tell me about how you want this subscription to charge your users? Is there no recurring charge and you are you basically adding a bunch of one time fees to be charged at the end of the cycle?

inland dove
#

We have 2 subscription 6 months and 12 months
So we're offering to clients to pay by recurring payment or they can pay one-time

#

They can select from the drop-down

#

?

solid palm
#

That is helpful context. What happens after the six months? Does the subscription cancel, renew for another six months, or start renewing monthly?

inland dove
#

It will renew every month, If they want to cancel then they can cancel on our dashboard but there is no way to cancel automatically.

solid palm
#

You would make a 6-month recurring price and then could tell the schedule to charge for that once and then switch to the monthly price once that first cycle is over

peak raptorBOT
inland dove
#

As I described to you I don't want to cancel the subscription after 6 months or 12 months. We just want users can pay on a monthly basis or one-time but the subscription will continue if the user pays monthly means recurring for 6 months, after 6 months it doesn't mean the subscription will be canceled. Subscriptions will continue to renew every month. If user select one time then the subscription will renew on the plan of subscription like if they choose 6 month plan with one time payment then the subscription will renew every 6 month.

silver onyx
#

๐Ÿ‘‹ stepping in

#

So after 6 months the customer pays monthly, correct?

#

If they do your "one time up front for 6 months" option

inland dove
#

yes right

silver onyx
inland dove
#

So it can't be possible with add_invoice_items ?

silver onyx
#

You could do it with add_invoice_items if you combine that with a trial

#

So put the Sub on trial for 6 months and add an invoice item for the one time charge

#

That would work fine as well

inland dove
silver onyx
#

You always have to use at least one type: recurring Price with Subscriptions

inland dove
#

I'm still confused Could you clarify what actually need to do?

#

First thing we're not offering free trial

silver onyx
#

Sure but if you want to create a Sub that doesn't charge Monthly for 6 months but has a Monthly Price involved then you need a trial for those first 6 months

#

The way you do charge the customer for those first 6 months is to add an invoice_item when you create the Sub

inland dove
#

what is sub?

silver onyx
#

Subscription

inland dove
#

Ok so this is the case only if we offer free trail for first 6 month right? If Yes as I said we're not offering free trial

silver onyx
#

No.

#

The trial simply stops the recurring monthly billing.

#

Really you should go test this out.