#Apk
1 messages · Page 1 of 1 (latest)
How are you creating payment? In most cases there are options to define products and price dynamically.
I'm still working out implementation, but I'm using Stripe Connect to create accounts for my clients (mostly car dealerships), who will then sell services/products to their customers.
Using a self-hosted landing page that redirects to a stripe-hosted checkout page.
The idea is that on my website, a user can type in whatever they want for the line items, with whatever dollar amount and tax rate they wish. For example, one person might write "Replaced TPMS on front-right tire" and charge $63 for it.
Another line on the same order might be "core charge $15" and another, "Tech Labor $75".
In practice, these users generally will just type up everything on 1 line and assign whatever dollar amount they want to it. Sometimes we have good ones who will be more specific and properly list items with descriptions and individual dollar amounts.
What I want to avoid is having to create a thousand "products" every time someone types in something new. I effect I just want the line items to be free-form from the user's perspective, never actually having to "pick" a specific product from any sort of list.
So basically I just don't want "products" I just want completely arbitrary line items with arbitrary prices to be plugged into an order/checkout. Can that be done?
If you're creating your own payment intents, you can always set whatever amount you want, that's up to you
You only need to consider product/price data when using Subscriptions or Checkout etc with amounts we calculate for you
Using Checkout you can define price_data ad hoc, including the product_data
https://stripe.com/docs/api/checkout/sessions/create#create_checkout_session-line_items-price_data
With subscriptions, the price can be dynamic with price_data too, but you must include a defined product ID inside that:
https://stripe.com/docs/api/subscriptions/create#create_subscription-items-price_data
What is the difference between creating line items on a session versus creating a payment intent?
Whether you intend to build a custom payment flow vs using Stripe Checkout
vs building your own UI using our Elements, eg: https://stripe.com/docs/payments/payment-element
So if I'm creating a "checkout session" and define all the LineItems with "price_data", and subsequent "product_data" inline, am I effectively just spamming my account (or my client's account) with new "products" every time, or do they not persist?
And even if they do persist, is there any harm in just always making new products and prices inline like this, never actually using or referencing existing ones by ID?
Hi there 👋 taking over, as my colleague needs to step away
To answer your questions: each time you use price_data in Checkout, you are creating a Price/Product in-line with Checkout. Those persist beyond the Checkout Session and can be reused on your account. You should create these ahead of time if you don't want to create them on the fly like that
If you are able to read messages prior to being added here, I was trying to explain my scenario
I want my users/clients to be able to input anything they want into a textbox and have that be the "product", and then any arbitrary dollar amount they want, and have that be the product's "price".
I don't want them to have to define products and prices themselves
Gotcha. You can't really do that in Checkout without creating new Products and Prices each time they input the price name and product name
This is a scenario where service advisors at car dealerships will just type whatever they want into a line and whatever amount they want. "Tech hours" today might be 5 bucks each, tomorrow 6 bucks each. They may write "Fixed front-right brake rotor" today and charge $500, tomorrow type "Replaced left front control arm" and charge another arbitrary amount.
So if I was creating products and prices in-line, always brand new, forever, never ever ever re-using a product ID, would I run into any problems? Can I have a billion random products in an account without issue"
Correct, you can have as many as you want
So theoretically I could accomplish my scenario by sort of cheating the system and letting my users type whatever they want for product names and whatever they want for prices, just always making them inline when creating a checkout session?
Without running into any real issue
Yep. You would need to create a text box for them to type in before they get redirected to Checkout, then pass the contents of those text boxes to the API call that creates the Checkout session.
Awesome, thank you.
If I'm using Stripe Connect, and sending a customer to one of my client/user's pages, would these (sort of) phony products exist on the user's account or on the parent account?
You choose based on the "charge type" you are using (e.g. one of either (a) Direct Charges, (b) Destination Charges, or (c) Separate Charges and Transfers): https://stripe.com/docs/connect/charges#types
I want the charges to be kept more or less entirely on my user's accounts, as opposed to mine. They way they are responsible for disputes, refunds, etc. But I still want to know about it on my account for reporting/analytics, etc.
I believe at this time we don't intend to take a cut of our customer's profits, so we would just want "Direct Charges" then, right?
Yup! That's exactly right