#MarkoBoras
1 messages · Page 1 of 1 (latest)
Hi there, you mean you want to create an ad-hoc product for Checkout?
These are my requirements:
-
- Single game 1-4 quantity, 5 per person
I have many different cases but I just need guidance for first one. These are my requirements. User can select “Single game” where he can choose 1-4 players(he’ll choose that in my app) where each person is 5$. He can also choose multiple single games so end result can be like this.
- 3players * 5$ * 3single games = 45$
I am curious what's the best way to handle this
How should I create product?
OK, so it looks you want to create ad-hoc product
https://stripe.com/docs/api/checkout/sessions/create?lang=java#create_checkout_session-line_items-price_data you can create a ad-hoc price/product through the price_data hash when creating a checkout session
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
let me check
i was afk
Ok I am now viewing this
I am using node js for my backend
Do I still need to create some product in stripe dashboard
or I create everything when I am creating checkout?
Yup so you line_items would be something like
line_items: [
{
price_data: {
unit_amount: 1000,
currency: 'USD',
product_data: {
name: "Test",
}
},
quantity: 1
}
],
niceee
let me try it
so then I don't have to create any product in dashboard at all?
I can do everything through api calls?
No, you can create product through API.
If you want to create reusable product, you should use prodcuts API https://stripe.com/docs/api/products/create?lang=java#create_product
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Thanks ,an
This is what I needed
can I also add upsells in creation of checkout through api?
for payment mode
Hey! Taking over for my colleague.
hi hi
Can you give an example please to make sure I understand you correctly.
so I figured how to dinamycally create products
and I want to add upsell in checkout
this is example
Upsell
- Book entire arena for 9 or less people - pay additional 50€
- Book entire arena for 10 or more people - free
nevermind about this requirement
can i add upsell in checkout
You should be using metered prices for that
but these prices are for Subscriptions.
You can do this in your integration by adding new price dynamically when creating the Checkout Session by your integration