service_not_allowed HTTP 402 Stripe Declines

Stripe Error: service_not_allowed –

The service_not_allowed error occurs when the Stripe API attempts to process a payment but is denied due to an unknown reason. This error does not indicate a technical issue with your application or infrastructure, but rather a problem with the payment method or account.

Official documentation ↗

Root Causes

1.

Unknown Reason

The card issuer has declined the transaction for an unspecified reason.

2.

Insufficient Funds

The card has insufficient funds to cover the payment amount.

Resolution

1.Verify Card Information

Check that the card details are correct and up-to-date.

2.Contact Card Issuer

Reach out to the card issuer to inquire about the decline reason.

Code Examples


            stripe.api_key = 'YOUR_STRIPE_API_KEY'
try:
	charge = stripe.Charge.create(amount=100, currency='usd', source='tok_visa')
except stripe.error.CardError as e:
	print(e)
          

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

            $stripe = new Stripe('YOUR_STRIPE_API_KEY');
try {
	$charge = $stripe->charges->create(['amount' => 100, 'currency' => 'usd', 'source' => 'tok_visa']);
} catch (Exception $e) {
	print($e);
}
          

            curl -X POST https://api.stripe.com/v1/charges \
-H 'Authorization: Bearer YOUR_STRIPE_API_KEY' \
-H 'Content-Type: application/x-www-form-urlencoded' \
-d 'amount=100&currency=usd&source=tok_visa'
          

FAQ

What does 'service not allowed' mean?

The card was declined for an unknown reason.

How do I resolve a service_not_allowed error?

Verify card information and contact the card issuer to inquire about the decline reason.

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