invalid_number HTTP 402 Stripe Declines

Stripe Error: invalid_number –

The 'invalid_number' error is triggered by the Stripe API when it encounters an incorrect or invalid card number during payment processing. This error does not indicate a problem with your server or application but rather a specific issue with the provided card details.

Official documentation ↗

Root Causes

1.

Incorrect Card Number

The card number entered is not valid or recognized by Stripe.

2.

Card Expiration Date Mismatch

The expiration date of the provided card does not match the one stored in Stripe.

Resolution

1.Verify Card Details

Double-check that the card number and expiration date are correct.

2.Update Payment Method

Ask the customer to update their payment method with a valid card number.

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 does the 'invalid_number' error mean?

The 'invalid_number' error indicates that the card number provided is incorrect or not recognized by Stripe.

How do I resolve the 'invalid_number' error?

To resolve this issue, verify the card details and update the payment method with a valid card number.

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