invalid_pin HTTP 402 Stripe Declines

Stripe Error: invalid_pin –

The Stripe API returns an invalid_pin error code when the provided PIN does not match the stored value for a card, triggering this error at the API level during payment processing. This does not indicate a network issue or server-side problem.

Official documentation ↗

Root Causes

1.

Incorrect PIN

The customer entered an incorrect PIN when prompted.

2.

PIN mismatch

The provided PIN does not match the stored value for the card.

Resolution

1.Resubmit payment with correct PIN

Ensure the customer enters the correct PIN.

2.Verify card details

Check if the card details are accurate and up-to-date.

Code Examples


            stripe.api_key = 'YOUR_STRIPE_API_KEY'
charge = stripe.Charge.create(amount=100, currency='usd', source='tok_visa')
          

            const stripe = require('stripe')('YOUR_STRIPE_API_KEY');
const charge = await stripe.charges.create({amount: 100, currency: 'usd', source: 'tok_visa'});
          

            require_once('/path/to/Stripe.php');
$charge = \
Stripe::charges()->create(['amount' => 100, 'currency' => 'usd', 'source' => 'tok_visa']);
          

            curl -X POST https://api.stripe.com/v1/charges -u YOUR_STRIPE_API_KEY: -d "amount=100&currency=usd&source=tok_visa"
          

FAQ

What causes the invalid_pin error?

The invalid_pin error is caused by entering an incorrect PIN.

How do I resolve the invalid_pin error?

To resolve this issue, ensure you enter the correct PIN and verify your card details.

Can the invalid_pin error be prevented?

Yes, prevent this error by ensuring accurate and up-to-date card information.

Independent reference. Always verify against the official Stripe Declines documentation.