Issuing
Spending controls
 

Spending controls

 

Learn how to set rules on cards and cardholders to control spend.

Spending controls can be used to block businesses categories (e.g., bakeries, gambling) or set spending limits (e.g., 100 USD/authorization or 3,000 USD/month). They can be applied to Cards and/or Cardholders either by setting the spending_controls object at creation or by updating it later.

If you’re using spending controls and Real-time authorizations together, spending controls run first and decline a purchase before the issuing_authorization.request is sent, resulting in a declined issuing_authorization.created event.

field type description
allowed_categories array List of categories of authorizations to allow. All other categories will be blocked.
blocked_categories array List of categories of authorizations to decline. All other categories will be allowed.
spending_limits array List of objects that specify amount-based rules.

Spending limits

Additional tips and fees can be posted at a later time causing the spending limit to be exceeded.

If there are overlapping spending limits (e.g., 100 USD per authorization for a cardholder and 50 USD per authorization for that cardholder’s card), the most restrictive spending control will apply.

To limit the amount of money that can be spent, set spending_limits within the spending_controls object to a list of objects with the following structure.

field type description
amount integer Maximum spend, in the currency of the card. Amounts in other currencies are converted to the card’s currency when evaluating this control.
interval enum Time interval to which the amount applies. See the Card spending_controls for the possible values.
categories array (optional) List of categories this limit applies to. Omitting this field will apply the limit to all categories.

Examples

The following examples demonstrate different uses of spending controls for cards and cardholders.

Limit a cardholder's monthly spend across all of their cards

curl https://api.stripe.com/v1/issuing/cardholders/ich_1Cm3paIyNTgGDVfzBqq1uqxR \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d "spending_controls[spending_limits][0][amount]"=300000 \ -d "spending_controls[spending_limits][0][interval]"=monthly
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Issuing::Cardholder.update( 'ich_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { spending_limits: [{ amount: 300000, interval: 'monthly', }], }, } )
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.issuing.Cardholder.modify( 'ich_1Cm3paIyNTgGDVfzBqq1uqxR', spending_controls={ 'spending_limits': [{ 'amount': 300000, 'interval': 'monthly', }], }, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Issuing\Cardholder::update( 'ich_1Cm3paIyNTgGDVfzBqq1uqxR', [ 'spending_controls' => [ 'spending_limits' => [[ 'amount' => 300000, 'interval' => 'monthly', ]], ], ] );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Cardholder cardholder = Cardholder.retrieve("ich_1Cm3paIyNTgGDVfzBqq1uqxR"); CardholderUpdateParams params = CardholderUpdateParams.builder() .setSpendingControls( CardholderUpdateParams.SpendingControls.builder() .addSpendingLimit( CardholderUpdateParams.SpendingControls.SpendingLimit.builder() .setAmount(300000L) .setInterval(CardholderUpdateParams.SpendingControls.SpendingLimit.Interval.MONTHLY) .build()) .build()) .build(); cardholder.update(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const cardholder = await stripe.issuing.cardholders.update( 'ich_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { spending_limits: [{ amount: 300000, interval: 'monthly', }], }, } );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.IssuingCardholderParams{ SpendingControls: &stripe.IssuingCardholderSpendingControlsParams{ SpendingLimits: []*stripe.IssuingCardholderSpendingControlsSpendingLimitParams{ { Amount: stripe.Int64(300000), Interval: stripe.String(string(stripe.IssuingSpendingLimitIntervalMonthly)), }, }, }, } ch, _ := cardholder.Update("ich_1Cm3paIyNTgGDVfzBqq1uqxR", params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CardholderUpdateOptions { SpendingControls = new CardholderSpendingControlsOptions { SpendingLimits = new List<CardholderSpendingControlsSpendingLimitOptions> { new CardholderSpendingControlsSpendingLimitOptions { Amount = 300000, Interval = "monthly", }, }, }, }; var service = new CardholderService(); service.Update("ich_1Cm3paIyNTgGDVfzBqq1uqxR", options);

Limit the spend and allowed categories for a card

curl https://api.stripe.com/v1/issuing/cards/ic_1Cm3paIyNTgGDVfzBqq1uqxR \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d "spending_controls[allowed_categories][0]"=automated_fuel_dispensers \ -d "spending_controls[spending_limits][0][amount]"=8000 \ -d "spending_controls[spending_limits][0][interval]"=per_authorization
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Issuing::Card.update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { allowed_categories: ['automated_fuel_dispensers'], spending_limits: [{ amount: 8000, interval: 'per_authorization', }], }, } )
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.issuing.Card.modify( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', spending_controls={ 'allowed_categories': ['automated_fuel_dispensers'], 'spending_limits': [{ 'amount': 8000, 'interval': 'per_authorization', }], }, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Issuing\Card::update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', [ 'spending_controls' => [ 'allowed_categories' => ['automated_fuel_dispensers'], 'spending_limits' => [[ 'amount' => 8000, 'interval' => 'per_authorization', ]], ], ] );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Card card = Card.retrieve("ic_1Cm3paIyNTgGDVfzBqq1uqxR"); CardUpdateParams params = CardUpdateParams.builder() .setSpendingControls( CardUpdateParams.SpendingControls.builder() .addAllowedCategory(CardUpdateParams.SpendingControls.AllowedCategory.AUTOMATED_FUEL_DISPENSERS) .addSpendingLimit( CardUpdateParams.SpendingControls.SpendingLimit.builder() .setAmount(8000L) .setInterval(CardUpdateParams.SpendingControls.SpendingLimit.Interval.PER_AUTHORIZATION) .build()) .build()) .build(); card.update(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const card = await stripe.issuing.cards.update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { allowed_categories: ['automated_fuel_dispensers'], spending_limits: [{ amount: 8000, interval: 'per_authorization', }], }, } );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.IssuingCardParams{ SpendingControls: &stripe.IssuingCardSpendingControlsParams{ AllowedCategories: []*string{ stripe.String("automated_fuel_dispensers"), }, SpendingLimits: []*stripe.IssuingCardSpendingControlsSpendingLimitParams{ { Amount: stripe.Int64(8000), Interval: stripe.String(string(stripe.IssuingSpendingLimitIntervalPerAuthorization)), }, }, }, } ca, _ := card.Update("ic_1Cm3paIyNTgGDVfzBqq1uqxR", params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CardUpdateOptions { SpendingControls = new CardSpendingControlsOptions { AllowedCategories = new List<string> { "automated_fuel_dispensers", }, SpendingLimits = new List<CardSpendingControlsSpendingLimitOptions> { new CardSpendingControlsSpendingLimitOptions { Amount = 8000, Interval = "per_authorization", }, }, }, }; var service = new CardService(); service.Update("ic_1Cm3paIyNTgGDVfzBqq1uqxR", options);

Limit a card's weekly spend for specific categories

curl https://api.stripe.com/v1/issuing/cards/ic_1Cm3paIyNTgGDVfzBqq1uqxR \ -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \ -d "spending_controls[spending_limits][0][amount]"=4000 \ -d "spending_controls[spending_limits][0][interval]"=weekly \ -d "spending_controls[spending_limits][0][categories][0]"=fast_food_restaurants
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' Stripe::Issuing::Card.update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { spending_limits: [{ amount: 4000, interval: 'weekly', categories: ['fast_food_restaurants'], }], }, } )
# Set your secret key. Remember to switch to your live secret key in production! # See your keys here: https://dashboard.stripe.com/account/apikeys stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc' stripe.issuing.Card.modify( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', spending_controls={ 'spending_limits': [{ 'amount': 4000, 'interval': 'weekly', 'categories': ['fast_food_restaurants'], }], }, )
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); \Stripe\Issuing\Card::update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', [ 'spending_controls' => [ 'spending_limits' => [[ 'amount' => 4000, 'interval' => 'weekly', 'categories' => ['fast_food_restaurants'], ]], ], ] );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; Card card = Card.retrieve("ic_1Cm3paIyNTgGDVfzBqq1uqxR"); CardUpdateParams params = CardUpdateParams.builder() .setSpendingControls( CardUpdateParams.SpendingControls.builder() .addSpendingLimit( CardUpdateParams.SpendingControls.SpendingLimit.builder() .setAmount(4000L) .setInterval(CardUpdateParams.SpendingControls.SpendingLimit.Interval.PER_AUTHORIZATION) .addCategory(CardUpdateParams.SpendingControls.SpendingLimit.Category.FAST_FOOD_RESTAURANTS) .build()) .build()) .build(); card.update(params);
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc'); const card = await stripe.issuing.cards.update( 'ic_1Cm3paIyNTgGDVfzBqq1uqxR', { spending_controls: { spending_limits: [{ amount: 4000, interval: 'weekly', categories: ['fast_food_restaurants'], }], }, } );
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc" params := &stripe.IssuingCardParams{ IssuingCardSpendingControls: &stripe.IssuingCardSpendingControlsParams{ SpendingLimits: []*stripe.IssuingCardSpendingControlsSpendingLimitParams{ { Amount: stripe.Int64(4000), Interval: stripe.String(string(stripe.IssuingSpendingLimitIntervalPerAuthorization)), Categories: []*string{ stripe.String("fast_food_restaurants"), }, }, }, }, } ca, _ := card.Update("ic_1Cm3paIyNTgGDVfzBqq1uqxR", params)
// Set your secret key. Remember to switch to your live secret key in production! // See your keys here: https://dashboard.stripe.com/account/apikeys StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"; var options = new CardUpdateOptions { SpendingControls = new CardSpendingControlsOptions { SpendingLimits = new List<CardSpendingControlsSpendingLimitOptions> { new CardSpendingControlsSpendingLimitOptions { Amount = 4000, Interval = "per_authorization", Categories = new List<string> { "automated_fuel_dispensers", }, }, }, }, }; var service = new CardService(); service.Update("ic_1Cm3paIyNTgGDVfzBqq1uqxR", options);
Was this page helpful?
Questions? Contact us.
Developer tutorials on YouTube.
You can unsubscribe at any time. Read our privacy policy.