#cm

1 messages · Page 1 of 1 (latest)

covert knotBOT
eager folio
#

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

orchid marsh
#

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).

eager folio
#

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

#

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

orchid marsh
#

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>' })

eager folio
orchid marsh
#

Ahhhh, okay that makes sense. Thanks!

#

I need to run to lunch real quick, but I'll be back. Thank you for taking the time!