Placing a hold on a card Charges API

    Use the Charges API to authorize a payment now, capture funds later.

    Stripe supports two-step card payments so you can first authorize a charge, then wait to settle (capture) it later. When a charge is authorized, the funds are guaranteed by the card issuer and the amount held on the customer’s card for up to seven days. If the charge is not captured within this time, the authorization is canceled and funds released.

    Note that for in-person payments made with Terminal, you must capture within 24 hours.

    Authorize a payment

    To authorize a payment without capturing it, make a charge request that also includes the capture parameter with a value of false. This instructs Stripe to only authorize the amount on the customer’s card.

    If you need to cancel an authorization, you can release it by refunding the relevant Charge object.

    curl https://api.stripe.com/v1/charges \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -d amount=999 \
      -d currency=usd \
      -d description="Example charge" \
      -d source=tok_visa \
      -d capture=false
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    # Token is created using Checkout or Elements!
    # Get the payment token ID submitted by the form:
    token = params[:stripeToken]
    
    charge = Stripe::Charge.create({
        amount: 999,
        currency: 'usd',
        description: 'Example charge',
        source: token,
        capture: false,
    })
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    # Token is created using Checkout or Elements!
    # Get the payment token ID submitted by the form:
    token = request.form['stripeToken'] # Using Flask
    
    charge = stripe.Charge.create(
        amount=999,
        currency='usd',
        description='Example charge',
        source=token,
        capture=False,
    )
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    // Token is created using Checkout or Elements!
    // Get the payment token ID submitted by the form:
    $token = $_POST['stripeToken'];
    
    $charge = \Stripe\Charge::create([
        'amount' => 999,
        'currency' => 'usd',
        'description' => 'Example charge',
        'source' => $token,
        'capture' => false,
    ]);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    // Token is created using Checkout or Elements!
    // Get the payment token ID submitted by the form:
    String token = request.getParameter("stripeToken");
    
    Map<String, Object> params = new HashMap<>();
    params.put("amount", 999);
    params.put("currency", "usd");
    params.put("description", "Example charge");
    params.put("source", token);
    params.put("capture", false);
    Charge charge = Charge.create(params);
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    const stripe = require('stripe')('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    // Token is created using Checkout or Elements!
    // Get the payment token ID submitted by the form:
    const token = request.body.stripeToken; // Using Express
    
    (async () => {
      const charge = await stripe.charges.create({
        amount: 999,
        currency: 'usd',
        description: 'Example charge',
        source: token,
        capture: false,
      });
    })();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    // Token is created using Checkout or Elements!
    // Get the payment token ID submitted by the form:
    token := r.FormValue("stripeToken")
    
    params := &stripe.ChargeParams{
        Amount: stripe.Int64(999),
        Currency: stripe.String(string(stripe.CurrencyUSD)),
        Description: stripe.String("Example charge"),
        Capture: stripe.Bool(false),
    }
    params.SetSource(token)
    ch, _ := charge.New(params)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    // Token is created using Checkout or Elements!
    // Get the payment token submitted by the form:
    var token = model.Token; // Using ASP.NET MVC
    
    var options = new ChargeCreateOptions {
        Amount = 999,
        Currency = "usd",
        Description = "Example charge",
        Source = token,
        Capture = false,
    };
    var service = new ChargeService();
    Charge charge = service.Create(options);
    

    Capture the funds

    To settle an authorized charge, make a capture charge request. The total authorized amount is captured by default, and you cannot capture more than this. To capture less than the initial amount (e.g., $8 of a $10 authorization), pass the amount parameter. Partially capturing a charge automatically releases the remaining amount.

    curl https://api.stripe.com/v1/charges/ch_0iEA521hbh6KWMaR5iom/capture \
      -u sk_test_4eC39HqLyjWDarjtT1zdp7dc: \
      -X POST
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    charge = Stripe::Charge.capture('ch_0iEA521hbh6KWMaR5iom')
    
    # Set your secret key: remember to change this to your live secret key in production
    # See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.api_key = 'sk_test_4eC39HqLyjWDarjtT1zdp7dc'
    
    charge = stripe.Charge.capture('ch_0iEA521hbh6KWMaR5iom')
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    \Stripe\Stripe::setApiKey('sk_test_4eC39HqLyjWDarjtT1zdp7dc');
    
    $charge = \Stripe\Charge::retrieve('ch_0iEA521hbh6KWMaR5iom');
    $charge->capture();
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    Stripe.apiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    Charge charge = Charge.retrieve("ch_0iEA521hbh6KWMaR5iom");
    charge.capture();
    
    // Set your secret key: remember to change this 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 charge = stripe.Charges.capture('ch_0iEA521hbh6KWMaR5iom')
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    stripe.Key = "sk_test_4eC39HqLyjWDarjtT1zdp7dc"
    
    ch, _ := charge.Capture("ch_0iEA521hbh6KWMaR5iom", nil)
    
    // Set your secret key: remember to change this to your live secret key in production
    // See your keys here: https://dashboard.stripe.com/account/apikeys
    StripeConfiguration.ApiKey = "sk_test_4eC39HqLyjWDarjtT1zdp7dc";
    
    var service = new ChargeService();
    Charge charge = service.Capture("ch_0iEA521hbh6KWMaR5iom")
    

    Card statements from some issuers do not distinguish between authorizations and captured (settled) charges, which can sometimes lead to confusion for your customers. In addition, authorized charges can only be captured once. If you partially capture a charge, you cannot perform another capture for the difference. Depending on your requirements, you may be better served by saving customer’s card details for later and creating charges as needed.

    Was this page helpful?

    Thank you for helping improve Stripe's documentation. If you need help or have any questions, please consider contacting support.

    On this page