Restricting purchases on Product overall quantity not on SKU quantity - stripe-payments

I want to be able to restrict my orders to a limit on the product quantity and not it's different SKUs.
For instance, say I have a bus route with tickets for each stop. My bus can hold 24 passengers. I want to sell fare on my bus for each of my 24 seats but each stop can be a different price.
I'm having trouble figuring out how to do this in Stripe.
I am thinking I can try and do a metafield with overall quantity in the product and find a way to check against that before accepting an order?

Related

Stripe: Can I create a single "1 month free" promo code for multiple products?

I've been reading though the Stripe documentation but can't figure out if it's possible to have a single promotion code for multiple products, to give a 1-month discount, for products which have both monthly and yearly pricing.
Our product setup is like this:
Basic tier product
Monthly price (upsells to yearly price)
Yearly price
Plus tier product
Monthly price (upsells to yearly price)
Yearly price
I’d like to set up a single promotion code to give to customers, to discount the price of one month, regardless of the product they choose and whether they select monthly or yearly billing.
If I set up a 100% discount coupon then I can apply it to both products, but then if the user chooses annual billing, it discounts the price of the entire year (we only want to discount the price of one month).
If we set up fixed-amount discount coupons, then I'd need to create different promotion codes for each product (we only want to give customers a single code).
Maybe this simply isn't possible with Stripe, but it seems like quite a reasonable/common use case, so wanted check.
Any help much appreciated!
Unfortunately this is not possible with a single Stripe coupon. You would need to create at least two different coupons: one for the basic tier product worth one month, and one for the plus tier worth one month.

Choosing the right Stripe subscription model if pricing depends on another numerical attribute

I have little experience with payment gateways, and am trying to figure out how to synthesize the type of subscription billing that I am looking for: the monthly price gets rebalanced once a year, based on another attribute (a number that can get as high as seven or eight digits).
So, for example, the monthly subscription price as of January 1st will be a % of a user's credit card debt balance as of Dec 15th in the prior year. But the debt balance can get very high / does not have a cap.
I looked at the Stripe documentation to figure out of there's a way to do this. The only thing I could come up with is to use unit_amount in metered pricing and tying this to the credit balance. In other words, I would grab the debt balance number and use it as the unit_amount, and then apply a %. But then I need to also forward bill, so I trick the logic into shifting by a month, which seem impractical.
Alternatively, I am not sure I could do this with per seat pricing (e.g. $1 in debt = 1 seat). But I assume there's a max to the number of seats (i.e. someone cannot have, say 1m seats). I just couldn't determine this from the documentation...
That's what I was thinking, anyway. Perhaps there's a better way?
You've got a couple different options here:
At the start of the year you update the Subscription to a new price based on the calculations of the customer's credit card debt balance by specifying items[0].price_data. Setting items[0].price_data (see the api ref) allows you to create an "in-line price" that as part of the updating the Subscription, so you don't have to create one separately through a separate API request. If you haven't seen Stripe's docs on how to update the price of a Subscription you can see an example here, and you'll likely want to read about proration_behavior as well.
You have a single Price where 1 seat = $1 in debt, and you control how much you want to charge by changing the number of seats for the Subscription. I don't think Stripe has a limitation to the number of seats (as long as it's a valid integer), but they do have a limitation on the maximum amount you can charge which you can read about here. For USD the maximum charge amount is $999,999.99, so the maximum quantity would be you could specify for a $1 price is 999,999.
You could look into using metered pricing, but given that you don't want to bill at the end of the billing cycle the other two options seem better.
I think the first option (updating the price year by year) is your best one, but definitely try all of them out in test mode and take a look at how the Invoices look to see which one you like best.

How do I decrement quantity by line in Excel?

New user on Stack Overflow, apologies for my lack of Excel knowledge.
Essentially I have a spreadsheet with all of our customer orders including order number, item SKU, and quantity sold on that order (see pic for example). To estimate profit margin on each of the lines, I'm trying to assign a vendor cost to the orders for each of the vendors.
For example, if we ordered 150 of SKU ABC1 from Vendor1 and 200 of SKU AB1 from Vendor2, I want to assign the cost of Vendor1 to as many orders of that SKU that equal 150, then finish with cost from Vendor 2 for the rest. This will give us an estimate of how much margin we're making by vendor.
Is each order specific to a Vendor? For example, Order 1 is for Vendor 1, Order 2 is for Vendor 3, etc.
If so, you could add the vendor to each order and then use a VLOOKUP to lookup the cost of the SKU for the given vendor. Then it should just be COST * QTY.
Also new here; otherwise, I would have just left a comment.

Define a limit on which a stripe subscription invoice is effective or not

I've been using Stripe to start subscriptions for my clients recently and I have a specific issue.
I have a metered price for a product that's let's say 0.09€ per item (an SMS in that case) on a monthly cycle. Since you pay on Stripe for your invoices, I'd like to define an amount limit to have this invoice sent or not. For example, let's say this amount is 10€ and the the pending invoice amount at the end of the month for a user is 5€, I'd like to carry these 5€ over the next month.
I read about the billing_thresholds.amount_gte which does basically the opposite of what I need from what I understand.
Is this possible?

How to handle purchase order in every sales order in Odoo?

Can Odoo handle purchase orders in every sales order that the items are not yet received by the warehouse?
I have this situation where customer 1 and customer 2 order the same products which are not yet in stocks (on-hand-qty = 0). So Odoo will automatically generate a purchase order to buy the items to the vendor and the company will also purchase enough stocks to compensate for the two customers? Now with 45 days lead time until the products will be receiving in the warehouse.
Example:
Item in warehouse = 0
Customer 1 buy 50 units of an item on the same day but different store.
Customer 2 buy 50 units of the same item on the same day but different store.
The company buys 200 units of the same item Since the lead time for the vendor to deliver the product is 45 days now there is Customer 3 which buys the same product on the same day but different stores but only buys 50.
Now in Odoo, it will generate 4 PO ( 3 for the Customer 1,2,3 and 1 for the company) How to make it 2 3 PO instead of 4? since it will compensate the number of items from the company's order but it will wait for 45 days? then another Customer 4 will buy the same items...etc. It will be a series of RFQ that are not necessary to do automatically.

Resources