1

I use the paymentIntent API this way:

intent = stripe.PaymentIntent.create(
    amount=1000,
    currency='eur',
    customer=stripe_customer_id,
    payment_method=stripe_payment_method_id,
    off_session=True,
    confirm=True,
    receipt_email=customer.email,
)

I have created a product in the dashboard. The dashboard provides a priceID which looks like this: price_1LT0RKGPl0rdJavu7TKMB4F7.

Is it possible in the paymentIntent to use this priceID or anything that can be related to my product previously created in the dashboard instead of the amount value required in the paymentIntent?

Basically, I would like something like this:

intent = stripe.PaymentIntent.create(
    amount=price_1LT0RKGPl0rdJavu7TKMB4F7,
    currency='eur',
    customer=stripe_customer_id,
    payment_method=stripe_payment_method_id,
    off_session=True,
    confirm=True,
    receipt_email=customer.email,
)
Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
BoumTAC
  • 3,531
  • 6
  • 32
  • 44

1 Answers1

2

That's not possible, PaymentIntents are a lower level/more custom API that simply take a raw amount you pass from your own code.

You can use the Price with other higher-level integrations which make use of your Stripe Price+Product catalogue. They end up creating PaymentIntents indirectly for you, and you would do the payment that way. Any of of these are options:

karllekko
  • 5,648
  • 1
  • 15
  • 19