调至内容部分
创建账户或登录
Stripe 文档徽标
/
询问人工智能
创建账户登录
开始
付款
销售收入
平台和交易市场
资金管理
开发人员资源
API 和 SDK帮助
概览收款升级您的集成
线上付款
概览查找您的用例
使用 Payment Link
使用预制结账页面
    概览
    快速入门指南
    Checkout 的运作机制
    自定义外观样式
    收集额外信息
    收税
    动态更新结账流程
    管理产品目录
    订阅
    管理支付方式
    让客户用本地货币支付
    添加折扣、追加销售和可选商品
    设置未来付款
    支付过程中保存付款详情
    付款后
    从传统 Checkout 迁移
    迁移 Checkout 来使用 Prices
使用 Elements 构建自定义集成
构建应用内集成
使用 Managed Payments
经常性付款
线下支付
Terminal
支付方式
添加支付方式
管理支付方式
用 Link 更快结账
支付操作
分析
余额和结算时间
合规和安全
货币
拒付
争议
欺诈预防
Radar 欺诈保护
提现
收据退款与取消
高级集成
自定义支付流程
灵活收单
Off-Session Payments
多处理商编排
超越支付功能
成立公司
加密货币
智能体商务 (Agentic Commerce)
机器支付
Financial Connections
Climate
验证身份
美国
简体中文
首页付款Use a prebuilt checkout page

Checkout 的运作机制

Learn how to use Checkout to collect payments on your website.

Checkout is a low-code payment integration that creates a customizable form for collecting payments.

Checkout’s built-in features allow you to reduce your development time. It supports more than 40 payment methods, including Link, which lets your customers save their payment method for faster checkout. You can accept payments by embedding Checkout directly into your website, redirecting customers to a Stripe-hosted payment page, or creating a customized checkout page with Stripe Elements. Checkout supports payments for both one-time purchases and subscriptions.

You can also customize Checkout and access additional functionality with Checkout Sessions and the Stripe Dashboard. For a complete list of features, see its built-in and customizable features.

Checkout lifecycle

  1. When customers are ready to complete their purchase, your application creates a new Checkout Session.
  2. The Checkout Session provides a URL that redirects customers to a Stripe-hosted payment page.
  3. Customers enter their payment details on the payment page and complete the transaction.
  4. After the transaction, a webhook fulfills the order using the checkout.session.completed event.

Low-code integration

Checkout requires minimal coding and is the best choice for most integrations because of its prebuilt features and customization options. You can integrate Checkout by creating a Checkout Session and collecting customer payment details. Collect payments by redirecting customers to a Stripe-hosted payment page.

Compare Checkout to other Stripe payment options to determine the best one for you. Checkout displays a payment form to collect customer payment information, validates cards, handles errors, and so on.

功能

支持数字钱包和 Link内置
响应性移动设计内置
满足 SCA 要求内置
CAPTCHA内置
PCI 合规内置
银行卡验证内置
错误消息内置
可调数量内置
自动收税内置
国际语言支持内置
Adaptive Pricing内置
收税自定义
用颜色、按钮和字体自定义品牌自定义
可选项目自定义
全球支付方式自定义
订阅的追加销售自定义
自定义域名(仅限 Stripe 托管页面)自定义
邮件发送收据自定义
添加折扣自定义
自定义成功页面自定义
恢复废弃的购物车自定义
用 Link 自动填充支付详情自定义
收集税号自定义
收集配送信息自定义
收集电话号码自定义
设置订阅计费周期的日期自定义

Custom branding

You can set fonts, colors, icons, and field styles for your Stripe-hosted Checkout page using the Branding settings in the Dashboard. For more information, see Customize your integration.

Custom domains

If you use Stripe’s custom domain feature, you can serve Stripe-hosted Checkout pages on a subdomain of your custom domain. Custom domains are a paid feature. For information, see Pricing and fees.

Checkout Session

The Checkout Session is a programmatic representation of what your customers see on the checkout page. After creating a Checkout Session, redirect your customers to its URL to complete the purchase. When customers complete their purchase, you can fulfill their orders by configuring an event destination to process Checkout Session events. This code snippet from the quickstart guide is an example of how to create a Checkout Session in your application.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price]"=
"{{PRICE_ID}}"
\ -d "line_items[0][quantity]"=1 \ -d mode=payment \ --data-urlencode success_url="https://example.com/success"

One-time and recurring payments

Allow customers to make one-time payments or subscribe to a product or service by setting the mode parameter in a Checkout Session.

模式Purchase type
支付方式One-time purchases
Subscription
  • Recurring purchases
  • Mixed cart: Recurring purchases with one-time purchases

Mixed cart

Create a mixed cart in Checkout that lets your customers purchase Subscription items and one-time purchase items at the same time. To create a mixed cart, set the mode parameter to subscription and include the Price IDs, or price_data, for each line_item in the line_items array. Price IDs come from Price objects created using the Stripe Dashboard or API and allow you to store information about your product catalog in Stripe.

You can also use price_data to reference information from an external database where you’re hosting price and product details without storing product catalog information on Stripe. For more information, see Build a subscriptions integration.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price]"={{RECURRING_PRICE_ID}} \ -d "line_items[0][quantity]"=1 \ -d "line_items[1][price]"={{ONE_TIME_PRICE_ID}} \ -d "line_items[1][quantity]"=1 \ -d mode=subscription \ --data-urlencode success_url="https://example.com/success"

Payment methods

You can view, enable, and disable different payment methods in the Stripe Dashboard at any time. Stripe enables certain payment methods for you by default. We might also enable additional payment methods after notifying you. View our complete list of payment methods.

Save payment details and default payment methods

比较 Customers v1 与 Accounts v2 的参考文件

如果您的 Connect 平台使用客户配置账户,请参阅我们的指南,将代码中对 Customer 和事件的引用替换为相应的 Accounts v2 API 参考文件。

You can save payment details for future use by sending an API parameter when you create a Checkout Session. Options to save payment details include:

  • Single payment: If your Checkout Session uses payment mode, set the payment_intent_data.setup_future_usage parameter.
  • Subscription payment: If your Checkout Session uses subscription mode, Stripe saves the payment method by default.
  • Multiple saved payment methods: If a customer has multiple payment methods saved, you can store a default payment method to the Customer object’s default_payment_method field. However, these payment methods don’t appear for return purchases in Checkout.

Guest customers

The Customer object represents a customer of your business. It stores their information and associates them with their subscriptions and payments. Checkout Sessions that don’t use existing Customers or create new ones are associated with guest customers instead.

有效期

By default, a Checkout Session expires after 24 hours.

You can set a custom expiration time for a Checkout Session by setting the expires_at parameter. It can be anywhere from 30 minutes to 24 hours after Checkout Session creation.

You can also expire a Checkout Session.

Complete a transaction

To automate business flows after a transaction occurs, register an event destination and build a webhook endpoint handler. Consider the following events and automations to enable:

  • Process the checkout.session.completed event to fulfill orders when a customer completes their purchase.
  • Process the checkout.session.expired event to return items to your inventory or send users a cart abandonment email when they don’t make a purchase and their cart expires.

另请参阅

  • Checkout quickstart
  • Fulfill your orders
  • Collect taxes in Checkout
  • Manage limited inventory with Checkout
  • Automatically convert to local currencies with Adaptive Pricing
此页面的内容有帮助吗?
是否
  • 需要帮助?联系支持。
  • 在 Discord 上与 Stripe 开发人员聊天。
  • 查看我们的更改日志。
  • 有问题?联系销售。
  • LLM? Read llms.txt.
  • Powered by Markdoc
相关指南
No-code options to accept payments on Stripe
Prebuilt checkout page
Learn about payment methods