#logan100
1 messages · Page 1 of 1 (latest)
No, price ID can only be used in Checkout Session, Invoicing and Subscription
Payment Intent is only for payment and doesn't contain Price information
Which integration type do you use? Checkout Session, Invoicing or Subscription?
Checkout session, I create a checkout session with line items based on Price ID, and then I was trying to find the best way to handle these orders so that I know which price ID was originally used.
I will be setting up webhooks in the near future but as a quick fix I was hoping I could just query the payment intents and check those for ID
But maybe PaymentIntent isn't the best to query for this?
I have handled subscriptions in a similar way, when I create a subscription checkout session I have just been querying subs and checking the price ID. But I also need to get this working for single purchase products
Since Checkout Session is used, you will be able to Checkout Session retrieval API and expand line_items field to get the prices:
- Checkout Session retrieval API: https://stripe.com/docs/api/checkout/sessions/retrieve
- Expand an object: https://stripe.com/docs/api/expanding_objects
Oh I didn't know that would work like that, I think that should solve it. Thank you!
No problem! Happy to help 😄
In the spec of line_items field https://stripe.com/docs/api/checkout/sessions/object#checkout_session_object-line_items, it has an Expandable label beside that indicates it can be expanded with https://stripe.com/docs/api/expanding_objects