#yuvi00001
1 messages · Page 1 of 1 (latest)
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?
yeah, how can we do that
meaning that subscription will never expire, also can i add a metered subscription to it ?
*additionally
the one time price should be added here : https://stripe.com/docs/api/subscriptions/create#create_subscription-add_invoice_items
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?
what would be the billing cycle here ?
e.g. mon - sun (current billing cycle), next mon - next sun (next billing cycle) for a weekly subscription
like we can add multiple items to a subscription, in which billing cycle of items should match (monthly or yearly )
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
do one time chargeable product have a billing cycle ? if yes , what is there default billing cycle ? and can we change it ?
one time chargable is not really impacted by that limitation, you can add them in that parameter i mentioned before
hmm, Im asking this because i want to add metered ( monthly ) item to this subscription
so if their billing interval wont get match, the second item will not get added
what's the first item?
first item is a "one-time" chargeable product
second item would be to add a metered price item to it
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?
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
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
hey, I tried adding the priceID as mentioned in this document.
add_invoice_items: [{ price: priceID, quantity: quantity }], but im getting the same error .
StripeInvalidRequestError: The price specified is set to type=one_timebut this field only accepts prices withtype=recurring.
is there something that Im missing
?
do you have the request ID req_xxx for the error?
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',
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?
ahhh, honest mistake !!
let me re iterate this
now i get an exception for missing item
https://dashboard.stripe.com/test/logs/req_XTjrc433wQ3a8W?t=1680771061
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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
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 }],
Sign in to the Stripe Dashboard to manage business payments and operations in your account. Manage payments and refunds, respond to disputes and more.
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.