# The Off-Session Payments API

Create your own payment flow for recurring and unscheduled payments.

The Off-Session Payments API is in private preview. [Request access](https://docs.stripe.com/payments/off-session-payments.md#request-access).

## 运作机制

With a single API request, you can initiate an off-session payment and let Stripe handle retries for you. With Smart Retries, you configure a retry strategy that uses AI inference to choose the best times to retry failed payments and increase the chance of success.

```curl
curl -X POST https://api.stripe.com/v2/payments/off_session_payments \
  -H "Authorization: Bearer <<YOUR_SECRET_KEY>>" \
  -H "Stripe-Version: 2026-04-22.preview" \
  --json '{
    "amount": {
        "value": 1000,
        "currency": "usd"
    },
    "customer": "{{CUSTOMER_ID}}",
    "payment_method": "{{PAYMENT_METHOD_ID}}",
    "cadence": "recurring",
    "metadata": {},
    "retry_details": {
        "retry_strategy": "best_available"
    }
  }'
```

See the [integration section](https://docs.stripe.com/payments/off-session-payments/integrate-with-off-session-payments.md) to learn how the Off-Session Payments API can fit into your existing business.

## 兼容的 API

The Off-Session Payments API is a Checkout compatible API. You can use it with payment details that you save with [Stripe Checkout](https://docs.stripe.com/payments/checkout.md), which uses the Checkout Sessions API, or with an advanced integration that uses the Payment Intents API or Setup Intents API. These APIs serve different use cases, depending on how you structure your checkout flow and how much control you require.

- Use the [Checkout Sessions API](https://docs.stripe.com/api/checkout/sessions.md) to handle collection and setup of payment information with a prebuilt payment form that presents the customer’s complete checkout flow. With the Checkout Sessions API, you can save a payment for future use [with a payment](https://docs.stripe.com/payments/checkout/save-during-payment.md?payment-ui=stripe-hosted#save-payment-method) or [without an initial payment](https://docs.stripe.com/payments/checkout/save-and-reuse.md), depending on your payment flow. Build a [checkout page with the Checkout Sessions API](https://docs.stripe.com/payments/quickstart.md).

- Use the [Payment Intents API](https://docs.stripe.com/api/payment_intents.md) to implement the payment step only, but with more control. Unlike the Checkout Sessions API, which requires line item details, you only pass in the final amount you want to charge. Use this for advanced payment flows where you want to manually compute the final amount. Build an [advanced integration with the Payment Intents API](https://docs.stripe.com/payments/advanced.md).

- Use the [Setup Intents API](https://docs.stripe.com/api/setup_intents.md) to save a customer’s payment details without an initial payment. Use this when you want to onboard customers now, set them up for payments, and charge them in the future. Use this integration to set up recurring payments, or to create one-time payments with a final amount determined later, often after the customer receives your service. Build an [advanced integration with the Setup Intents API](https://docs.stripe.com/payments/save-and-reuse.md?payment-ui=elements).

## Compliance

在保存客户的支付详情时，您需要负责遵守所有适用的法律、法规和卡组织规则。如果您想要保存客户的支付方式以供将来使用，则通常会适用于这些要求，例如在结账流程中向他们显示客户的支付方式以供将来购物使用，或者在他们不主动使用您的网站或应用程序时向他们扣款。在您的网站或应用程序中添加条款，说明您计划如何保存支付方式的详细信息，并允许客户选择加入。

当您保存支付方式时，仅能将其用于您在条款中明确规定的特定用途。若要在客户离线时向其支付方式扣款，并将其保存为未来购买的可选方式，请务必事先明确获取客户对此特定用途的同意。例如，可添加一个“保存我的支付方式以便未来使用”的复选框来征得客户同意。

要在客户离线时向客户收款，请确保您的条款包括以下内容：

- 客户同意您代其对指定的交易发起一次或一系列付款。
- 预期的付款时间和频率（例如，收款是计划的分期付款、订阅付款还是计划外充值）。
- 如何确定付款金额。
- 如果支付方式是用于支付订阅服务，那即同意您的取消政策。

请务必让客户书面同意这些条款并做好记录。

## Request access 

### Interested in getting early access to the Off-Session Payments API?

Enter your email address below, and our team will contact you soon.

```bash
curl https://docs.stripe.com/preview/register \
  -X POST \
  -H "Content-Type: application/json" \
  -H "Referer: https://docs.stripe.com/payments/off-session-payments" \
  -d '{"email": "EMAIL", "preview": "off_session_payments_private_preview"}'
```
