Skip to main content
AllDevToolsHub
Back to all patterns

Stripe Payment Intent ID

Validation

Validates a Stripe Payment Intent ID (pi_XXXXXXXX...).

/^pi_[A-Za-z0-9]{24,32}$/

How it works

Payment Intents are the modern Stripe charging primitive. The pi_ prefix distinguishes them from older ch_ charges. Use both regexes in a webhook handler that supports both flows.

Test Cases

Should Match

  • pi_3LdhRf2eZvKYlo2C0XK6T6Vt
  • pi_1Hkjk4LgIcRBVwYr3vBlAcZl

Should NOT Match

  • ch_3LdhRf2eZvKYlo2C0XK6T6Vt
  • pi_short

Quick Summary

Validates Stripe Payment Intent IDs of the form pi_ followed by 24–32 alphanumeric characters.