#lanman9000_checkout-price-data
1 messages ยท Page 1 of 1 (latest)
๐ Welcome to your new thread!
โฒ๏ธ We'll be here soon! Typically we respond in a few minutes, but sometimes we might take a bit longer if the server is busy or if you have a particularly tricky question.
โฑ๏ธ We close idle threads, which makes them read-only. Once a thread is closed it won't be reopened, but you can always start a new thread if you have another question.
๐ This thread will always be available, even after it's closed. You can find it again using Discord's search, or you can save this link: https://discord.com/channels/841573134531821608/1465385852019413137
๐ Have more to share? Add more details, code, screenshots, videos, etc. below.
Yes, that is what the price_data parameter does when specifying checkout line items https://docs.stripe.com/api/checkout/sessions/create#create_checkout_session-line_items-price_data
when doing so, customers can't alter the prices or pick a different price, correct?
Correct, those are different Checkout features. price_data is for the person creating a Checkout Session to specify an ad hoc amount
when we sent a customer to the checkout, we want to specify the product, specify the quantity, then specify the pricing.
once that's done, we want to set that product, quantity, and price as a subscription that bills them for that same product, quantity, and price every month.
Hi ๐
I"m stepping in as my colleague needs to go.
thank you
during the first checkout .. we establish the product, the quantity, and the price for that product .. and that is what is set as the monthly subscription
Are you creating the Checkout Session for a one time purchase or are you creating the Subscription using the Checkout Session?
The way you are wording that is confusing to me
sorry. during the first checkout .. when the user is setting up their products .. they will select an initial quantity of the product. our portal will then direct them to stripe for checkout.
when they go to checkout, we want to send (via API) the product, the quantity, and a custom price.
once the customer checks out, a monthly subscription is established for the product, quantity, and price.
That's how Checkout Sessions in mode: "subscription" work. As long as the price_data you define includes the necessary recurring parameter, you create a Subscription and the payment processed during the Checkout Session is for the first Invoice of that Subscription.
perfect
This is much easier to understand if you code this in Test mode
You can write a very simple script to create a Checkout session and print the URL, then complete the checkout session using our test card so you can see the Invoice and Subscription created
if the customer wishes to update the subscription by changing the quantity .. do we need to send "price_data" during subscription quantity changes?
No. Using price_data will create an actual Price object.
Also, when you need to change the quantity, you are modifying the Subscription object. We have multiple guides for handling updates to Subscriptions here
It's really easiest to get a handle on this if you code a simulation using a Sandbox or Test mode
so when we specify price_data .. if I go to the product in the stripe dashboard .. it will show multiple prices? all of the prices that have been used with the price_Data parameter?
Yes
understood. thank you very much.
Wait a sec ... let me test that
Okay I misspoke. We d not show these prices on the dashboard
lanman9000_checkout-price-data