调至内容部分
创建账户
或
登录
Stripe 文档徽标
/
询问人工智能
创建账户
登录
开始
付款
财务自动化
平台和交易市场
资金管理
开发人员工具
开始
付款
财务自动化
开始
付款
财务自动化
平台和交易市场
资金管理
概览探索所有产品
开始构建
开始开发
项目示例
关于 API
    API 一览
    Payment Intents API
    Setup Intents API
    支付方式
    产品和价格
    Older API
      收款
        迁移到新的 API
        接受银行卡付款
        保存卡
        冻结银行卡内的资金
        用 Connect 收款
      来源
    发布阶段
Build with LLMs
在无代码的情况下使用 Stripe
设置 Stripe
创建账户
网页端管理平台
移动端管理平台
迁移到 Stripe
管理欺诈风险
了解欺诈
Radar 欺诈保护
管理争议
验证身份
首页开始About the APIsOlder APIsCharges

注意

该页尚未提供此语言版本。我们正在加紧将我们的文档翻译成更多语言,很快将为您提供译文。

Placing a hold on a cardCharges API

复制页面

Legacy API

The content of this section refers to a Legacy feature. Use the Payment Intents API instead.

The Charges API doesn’t support the following features, many of which are required for credit card compliance:

  • Merchants in India
  • Bank requests for card authentication
  • Strong Customer Authentication

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 card issuer guarantees the funds and holds the amount on the customer’s card for, usually, up to 7 days, or 2 days for in-person payments using Terminal. The payment_method_details.card.capture_before attribute on the charge indicates the time when the authorization expires.

If the charge isn’t captured within this time, the authorization is canceled and funds released.

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.

注意

Only some payment methods support separate authorization and capture. For example, card payments, Afterpay, and Klarna support separating these steps. With payment methods that don’t support this functionality, like ACH or iDEAL, you can’t capture manually. Refer to the full list of payment methods that support manual capture.

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

Command Line
curl
curl https://api.stripe.com/v1/charges \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "amount"=999 \ -d "currency"="usd" \ -d "description"="Example charge" \ -d "source"="tok_visa" \ -d "capture"="false"

Capture the funds

To settle an authorized charge, make a capture charge request. The total authorized amount is captured by default, and you can’t capture more than this. To capture less than the initial amount (for example, 8 USD of a 10 USD authorization), pass the amount parameter. Partially capturing a charge automatically releases the remaining amount.

Command Line
cURL
curl -X POST https://api.stripe.com/v1/charges/{{CHARGE_ID}}/capture \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"

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 can’t 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.

此页面的内容有帮助吗?
是否
需要帮助?联系支持。
加入我们的早期使用计划。
查看我们的更改日志。
有问题?联系销售。
LLM? Read llms.txt.
Powered by Markdoc