#DOWNTOWN DUNKARONI - inventory limits

1 messages · Page 1 of 1 (latest)

analog fable
#

Unfortunately we don't currently support inventory limits like that. Can you tell me a bit more about your integration and what you are trying to do?

If you are using something like Checkout we have some tools that you can use to make sure that you don't oversell but you or another service would have to track inventory.

outer vault
#

Sure, thanks for the reply!

Essentially the company sells tickets for events and would have to set an upper limit for how many they can sell, ie 400 for instance (due to venue capacity).

As for project structure, I've followed this tutorial to create products using Sanity CMS: https://www.sanity.io/guides/building-ecommerce-sites-with-the-stripe-api

TL:DR; I pull the data in from Sanity w/ an eventQuery.js component, then I use a hook from use-shopping-cart to add products to the cart.js (see screenshot)

Sanity.io

In this tutorial, we'll make a no-frills "merch store" for a personal blog using the Stripe API, Next.js, and Sanity. We'll leverage Stripe's fantastic checkout platform to redirect our customers to Stripe's servers for their checkout process.

#

The way I was thinking of handling inventory was to create a stock limit number as a CMS field for the given event. Someone on the Sanity slack channel suggested the following:

"You probably could handle the quantity of tickets within Sanity. It would have to be something like a number field within a singleton. You'd then have to check the total tickets allowed vs. the total tickets sold before allowing Stripe to complete a sale."

However I'm pretty new to this and am not sure how I would go about checking the total tickets allowed vs tickets sold

analog fable
#

Gotcha. So from the Stripe side you are looking to find out how many tickets you have sold per Checkout Session or something so that you can properly update your remaining ticket count?

outer vault
#

In an ideal world, I set the maximum number of tickets an event can have within Sanity (as a number, ie 400), and then Stripe will decide whether or not to execute a payment depending on whether or not the total number of sales is ≤400

analog fable
#

Unfortunately Stripe does not have the functionality to do that at the moment. To do this with Stripe now, your integration will need to decide whether you have enough tickets and whether or not to initiate a payment based on that

#

Like the way that I have typically seen this done before is that you know you still have ten tickets, so when a user starts your checkout process, you reserve a couple of tickets for them for a bit. Then have a timeout window so that if the user doesn't complete the purchase there you cancel their PaymentIntent or Checkout Session and release those tickets for other users to buy

outer vault
#

But with that method how would you prevent overselling? Considering a potential situation where 10-50 people might be trying to check out at once for the last 20 tickets for example

urban moss
#

Hello 👋 Taking over for @analog fable here as they have to step away soon.
Give me a moment to catch up

outer vault
#

All good! Thanks hanzo main

urban moss
#

So like Pompey suggested, it'd depend on your integration really.

One way I've seen companies handle these things is by introducing queuing that times out along with placing a hold on user's payment method.

If they do manage to secure a ticket, you'd capture the full amount. otherwise, it'd just go back to their payment method.

outer vault
#

what do you mean by "it'd just go back to their payment method" ?

#

Also as an Aside, is inventory management (limiting stock) something Stripe is planning on adding down the line? I'm a little surprised that something like queuing timeouts would be added without coupling that w/ being able to limit the stock

urban moss
#

Also as an Aside, is inventory management (limiting stock) something Stripe is planning on adding down the line? I'm a little surprised that something like queuing timeouts would be added without coupling that w/ being able to limit the stock
I'm not sure actually, you'd likely want to chat with our support team about that
https://support.stripe.com/?contact=true

outer vault
#

Would "capturing the funds" be something that you would be able to do via the Payments dashboard?

outer vault