javascriptreactjsstripe-payments

Is it possible to get the zipcode from a Stripe payment/card element?


I'm using the Stripe react library's CardElement (source) and was wondering if there's any way to fetch the zip code a user enters from the Stripe flow after submission, possibly off the PaymentIntent or elsewhere? After reading the docs (and considering the whole point of Stripe is to insulate the payment data) I'm assuming not but wanted to be sure.

I did see you can provide a default value for your payment element. So is the only/best solution to request a zip code separately before the Stripe flow, store it off, and then use it as the default value when then loading the Stripe element?


Solution

  • Stripe does not expose the customer's ZIP code through its payment or card element. This is due to security and privacy reasons. Stripe follows strict PCI-DSS compliance guidelines, which prioritize the protection of sensitive payment information.

    If you require the customer's ZIP code for your business purposes, you can include a separate input field in your checkout flow to collect the ZIP code from the customer.