#brolych.

1 messages · Page 1 of 1 (latest)

willow sparrowBOT
next hemlock
#

Hi there!

#

How can I help?

frozen elbow
#

My business model follows this logic:
We have workspaces with members, x free members and each additional one Y $ / per user / per month
Workspaces can have multiple products, each product billed based on their usage

I want the user to pay for one invoice including everything (even if the user adds a product in the middle of the month, one payment should be settled for all products at the end of the subscription cycle)

What logic should we follow to achieve that

next hemlock
#

That sounds like a graduated pricing to me. Something like this:

frozen elbow
#

We are using graduated pricing, and we have our price id, all the products follow the same price id, in our case the workspace is the customer, our issue is to figure out how to manage multiple products under the same subscription since they all use the same price id but each one of them have their our usage metering, and how to achieve a one payment invoice billed at the same time

next hemlock
#

our issue is to figure out how to manage multiple products under the same subscription since they all use the same price id
Can you clarify what's the issue exactly? I'm not sure I follow.

willow sparrowBOT
frozen elbow
#

Okay so we have one graduated pricing product

In our platform a workspace can have multiple products each one having a dedicated usage and all of them following the same graduated pricing
Using them current configuration each product is billed at the end of its corresponding cycle, we want the user to pay for all of them at the same time.

smoky prairie
#

usually you do that by adding multiple products to the same subscription so they all bill together

frozen elbow
#

we tried that approach but the thing is all the products follow the same price id and we're not able to add multiple items with the same price id under the same subscription

smoky prairie
#

then you'd have to model this using multiple Price objects in Stripe instead

frozen elbow
#

I didn't really get that, if you mean inside the price array we tried adding multiple object but we have to use the same price id and that's what is blocking us, we can't add multiple price objects with the same price id

#

and we're using the quantity parameter to track the usage

smoky prairie
#

you create different Price objects

#

it might be easier to help if you share some exact code of what you did and what you tried, since words can be a little hard to follow and code is better

frozen elbow
#

can we set a meet or get on a call as it's not really coding related it's more of a concept problem

smoky prairie
#

no, but happy to help here

#

if you mean inside the price array we tried adding multiple object but we have to use the same price id and that's what is blocking us, we can't add multiple price objects with the same price id
that sounds like purely a coding question since you reference a specific error message. Like I said, the solution is to use multiple Price objects

#

as it mentions in the docs :

const subscription = await stripe.subscriptions.create({
  customer: '{{CUSTOMER_ID}}',
  items: [
    {
      price: 'price_CBXbz9i7AIOTzr',
    },
    {
      price: 'price_IFuCu48Snc02bc',
      quantity: 2,
    },
  ],
});

for example

and you create Prices either in the Dashboard or in the API. You can create multiple Price objects that have the same details(amounts,graduated pricing settings) if you need to, they don't have to be unique in terms of properties, but they need to be separate objects

frozen elbow
#

Exactly, the problem is I cannot create a new price since my users should be able to dynamically add new products following the same price id, otherwise I'll have to create a new price id for each product

smoky prairie
#

'll have to create a new price id for each product
that may just be what you have to do in the end

frozen elbow
#

can we achieve that we multiple subscription but generating one invoice for the user encapsulating all the subscriptions?

smoky prairie
#

no, since each Subscription sub_xxx creates its own Invoice each month

frozen elbow
#

is there a limit on how many price ids can be generated under the same product?

smoky prairie
#

no

frozen elbow
#

so it's a common practice to create a new price id (with the same details as the original one) for each new product being added by our users?

smoky prairie
#

not common, usually you'd only create a new Price if there are actually different details (like choose-your-own-pricing), if there's already a Price with the right amount you want to charge, you could use that

willow sparrowBOT
silver yew
#

@north cave What's the question?

north cave
#

hey, I just want to clarify a bit what was talked previously in the thread, just to know how to continue with the implementation

#

to recap the issue that we were facing, is that we only need one priceId (since the details will remain the same), every customer has his own customerId and subscriptionId, however when trying to issue new subscriptionItems in this same subscription, we are not able to use this already generated priceId, thus forcing us to create new priceIds (even though the details are still the same)

#

this approach is a bit hectic, and we were hoping to maybe find a cleaner solution

silver yew
#

however when trying to issue new subscriptionItems in this same subscription, we are not able to use this already generated priceId
Why? Is there an error?

north cave
#

It is returning an error where it says cannot "Cannot add multiple subscription items with the same plan"

silver yew
#

Seems expeccted to me. You'd jsut increase the quantity of the existing item with the same plan_xxx/price_xxx ID

north cave
#

I can't increase the quantity since its a metered usage billing, not a licensed one

silver yew
#

Then you'll need to create a new Price/Plan with the same values/settings

#

You can't have multiple items with the same ID

north cave
#

the issue here is that my application allows for multiple products inside the same workspace. The subscription is on the workspace level and the subscription item is on the product level. The proposed solution is that I create a new Price/Plan every time I want to create a new subscription item

silver yew
#

Sorry, I don't undersand how your business/application is configured. But those are the limitations that you need to work within

north cave
#

Are you guys sure though that there is no limit for the number of plans that I can create inside the same product?

#

Also I think there is a limitation on the number of subscription items that we can issue inside the subscription, which will also limit us in terms of application logic

north cave
#

Here I am failing to understand something (maybe its something related to our logic and thats why I am having a hard time to understand). For example other saas like DigitalOcean, offers unlimited amount of resources, and are all billed at the same time under the same cycle (which means its the same subscription). Could you please help me understand better, since I might have something very wrong in my implementation approach

#

In the example of Digital Ocean you are also billed on the usage of the platform, so its something very similiar to our usecase

silver yew
#

I don't know anythign about Digital Ocean or their billing system. In reality they may have built their own billing system and don't even use Stripe. It's not relevant really

#

All I know is that you will need to model your billing implementation to work with our APIs, and that is that each Subscription item requires a unique plan_/price_ ID

north cave
#

I mentioned it because all their tutorials are on Stripe... But anyway I am having a hard time finding the correct implementation, and was hoping for some clarification by coming to the support...