#yuvi00001

1 messages · Page 1 of 1 (latest)

small violetBOT
ruby oasis
#

hello! you cannot create a Subscription for a one_time product. Did you mean that you want to add a one_time price to a Subscription?

warm dew
#

yeah, how can we do that

#

meaning that subscription will never expire, also can i add a metered subscription to it ?

#

*additionally

ruby oasis
#

which means the next billing cycle, you won't see that one-time product being invoiced

#

meaning that subscription will never expire, also can i add a metered subscription to it ? - i don't really understand this, can you perhaps try rephrasing?

warm dew
ruby oasis
#

e.g. mon - sun (current billing cycle), next mon - next sun (next billing cycle) for a weekly subscription

warm dew
ruby oasis
#

yes, you can add multiple items to a subscription if the billing interval matches - it must all be monthly, or all be yearly

#

you cannot have monthly and yearly in the same subscription

warm dew
#

do one time chargeable product have a billing cycle ? if yes , what is there default billing cycle ? and can we change it ?

ruby oasis
#

one time chargable is not really impacted by that limitation, you can add them in that parameter i mentioned before

warm dew
#

so if their billing interval wont get match, the second item will not get added

ruby oasis
#

what's the first item?

warm dew
#

first item is a "one-time" chargeable product
second item would be to add a metered price item to it

ruby oasis
#

this would be the way i would go about it, i would let the customer decide upfront what they're going to buy

if they're going to only buy the one-time product - create a Checkout Session with mode=payment
If they're going to buy the one-time product with a recurring product - create a Checkout Session with mode=subscription

#

does that work for you?

warm dew
#

actually, Im converting some existing customers to this plan ,
since the payment is one-time, so the plan term would be "forever", by which they will be credited
lets say 10 units per month ,
if they exhaust their 10 units before the next monthly cycle , I'd be charging them anything over given 10units with a metered item that I want to add in the subscription.

#

this is the overview

ruby oasis
#

then they should always go with the one-time product and the recurring metered product

#

they're only charged for the recurring metered product if you bill them for their usage

small violetBOT
warm dew
#

?

somber pine
#

do you have the request ID req_xxx for the error?

warm dew
#

here is the request_log_url if this is what youre asking
request_log_url: 'https://dashboard.stripe.com/test/logs/req_6BZ9NYx5WJBgdD?t=1680770407',

somber pine
#

you can see that you are using items:[...]

#

you should be using add_invoice_items but you can see that you're not despite what you mentioned above

#

maybe you didn't save the code file after editing it? or didn't restart/deploy the server with the new code?

warm dew
#

ahhh, honest mistake !!

#

let me re iterate this

somber pine
#

yes you have to pass items as well

#

you need both

#

items is the recurring items, the thing the customer is subscribing to

#

add_invoice_items is for additional one-time charges

warm dew
#

okay, so now i've added a metered price item to "items" that i want to attach to the subscription
items: [{ price: "price_1MVvrvSDGA5oE739ap6Z7o9h" }], add_invoice_items: [{ price: priceID, quantity: quantity }],

somber pine
#

the error seems self expanatory

#

like you create the subscription and you pass price_1MVvrvSDGA5oE739ap6Z7o9h as the recurring Price to use and also charge for price_1MtnKUSDGA5oE7390qEqON9V as a one-time amount. That's all fine.
then you update the subscription and pass price_1MVvrvSDGA5oE739ap6Z7o9h again, and you can't change/update the subscription to use the same Price it was already using.

I'm not sure what you were trying to do.