#cm
1 messages · Page 1 of 1 (latest)
Could you please clarify what "inline" means here? Are these Price objects persisted somewhere, or are they ephemeral? When testing with inline prices, we're not seeing a new Price object get persisted to the relevant Product the Checkout Session is created for. Maybe that's expected, but I wsa hoping to get some clarification if possible.
Its persistent. It simply creates a new Price object on your account, which can be referenced later
Do you have a request ID for the Checkout Session that is showing this behavior? Here's how you can find a request ID: https://support.stripe.com/questions/finding-the-id-for-an-api-request
Find help and support for Stripe. Our support center provides answers on all types of situations, including account information, charges and refunds, and subscriptions information. Get your questions answered and find international support for Stripe.
req_W3Q2JOLyy62vxG
As you can see in the body of that request, we used price_data to create an inline price with a unit_amount of 999999.
No Price for that amount exists under the referenced Product (even after successfully completing the checkout process).
I do see a Price ID under the customer's "Recent Activity" that links to a Price object, but I'm mostly curious why this isn't showing up under the product (not a showstopper for us, just curious).
No worries! So, if you make a retrieve call to get the Checkout Session object and expand line_items.data.price.product you should be able to see both the newly created Price and the Product associated with it. These fields aren't available in the response without using expansion: https://stripe.com/docs/api/expanding_objects
Complete reference documentation for the Stripe API. Includes code snippets and examples for our Python, Java, PHP, Node.js, Go, Ruby, and .NET libraries.
Once we get this question ironed out, I'll circle back to the ones you brought up in your original post. It just makes it easier and less messy to tackle one complex question at a time
Got it, thank you!
you should be able to see both the newly created Price and the Product associated with it
Sorry, I suppose I could have been more clear there. If I create a Checkout Session with an inline Price for a Product that already exists, why isn't the resultant Price object persisted under the preexisting Product?
I see that the Price exists, I'm just curious why it doesn't appear to be reachable from something like:
Stripe::Price.list({ product: '<product_id>' })
Ah, right. So Prices and Product exist independently of each other for the most part. The only time you'd see a Price nested under a Product is if you set a default_price: https://stripe.com/docs/products-prices/manage-prices?dashboard-or-api=api