Accéder directement au contenu
Créez un compte
ou
connectez-vous
Le logo de la documentation Stripe
/
Demander à l’IA
Créer un compte
Connectez-vous
Commencer
Paiements
Revenus
Plateformes et places de marché
Gestion des fonds
Ressources de développement
Aperçu
Billing
AperçuÀ propos des API Billing
Abonnements
    Aperçu
    Fonctionnement des abonnements
    Commencer
    Démarrage rapide
    Planifier une intégration
    Créer une intégration
    Cas d'usage
    À propos des abonnements
    Activer le mode de facturation
    Définitions d'événements pour les abonnements
    Droits d'accès
    Factures d'abonnements
    Programmes d'abonnement
    Modèles tarifaires récurrents
    Authentification forte du client (SCA)
    Configurer des abonnements
    Configurer les modes d’encaissement
    Intégrez une grille tarifaire
    Définir des cycles de facturation
    Gérer les abonnements
    Migrer des abonnements vers Stripe
    Définir les quantités de produits ou d'abonnements
    Abonnements présentant des postes à la périodicité différente
    Antidater des abonnements
    Définir des périodes d'essai
    Gérer les abonnements avec paiement différé
    Appliquer des bons de réduction
    Modifier les abonnements
    Gérer les modes de paiement des abonnements
      Prélèvement automatique ACH
      Amazon Pay
      Prélèvement automatique Bacs au Royaume-Uni
      Virement bancaire
      Prélèvement automatique BECS en Australie
      Cash App Pay
      PayPal
      Revolut Pay
      Cartes coréennes
      Kakao Pay
      Naver Pay
      Débit préautorisé au Canada
      Prélèvement SEPA dans l'UE
      iDEAL avec le prélèvement SEPA
      Bancontact avec le prélèvement SEPA
    Analyses
    Gérer les abonnements sur iOS
Invoicing
Facturation à l'utilisation
Devis
Gestion de la clientèle
Facturation avec d'autres produits
Récupération des recettes
Automatisations
Testez votre intégration
Fiscalité
Aperçu
Utiliser Stripe Tax
Gérer la conformité
Rapports
Aperçu
Sélectionner un rapport
Configurer des rapports
API de rapport
Rapports sur plusieurs comptes
Comptabilisation des revenus
Données
AperçuSchéma
Rapports personnalisés
Data Pipeline
Gestion des données
AccueilRevenusSubscriptionsManage subscription payment methods

Set up a subscription with PayPal

Learn how to create and charge for a subscription with PayPal.

Stripe sample

Check out the sample on GitHub or explore the demo.

Use this guide to set up a subscription using PayPal and Checkout.

A Checkout Session represents the details of a customer’s intent to purchase. Create a Checkout Session when a customer wants to start a subscription. After redirecting a customer to a Checkout Session, Stripe presents a payment form where they can complete their purchase. After they complete a purchase, Stripe redirects them back to your site.

Enable PayPal recurring payments

Stripe automatically enables recurring payments for most users when they activate PayPal payments in the Stripe Dashboard. However, due to PayPal’s policies and regional restrictions, you might need to manually enable PayPal recurring payments in the Dashboard.

Set up Stripe
Server-side

First, you need a Stripe account. Register now.

Use our official libraries for access to the Stripe API from your application:

Command Line
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# Available as a gem sudo gem install stripe
Gemfile
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
# If you use bundler, you can add this line to your Gemfile gem 'stripe'

Create recurring products and prices

Avertissement

The Prices API unifies how one-time purchases and subscriptions are modeled on Stripe. Existing integrations that don’t use the Prices API are still supported. However, some Checkout features only support Prices. See the migration guide to upgrade to the Prices API.

To use Checkout, you first need to create a Product and a Price. Different physical goods or levels of service must be represented by products. Each product’s pricing is represented by one or more prices.

For example, you can create a software product that has four prices: 10 USD/month, 100 USD/year, 9 eur/month, and 90 eur/year. This allows you to change and add prices without needing to change the details of your underlying products. You can either create a product and price through the API or through the Stripe Dashboard.

If your price is determined at checkout (for example, the customer sets a donation amount) or you prefer not to create prices upfront, you can create prices inline at Checkout Session creation.

Before you start configuring products, make sure you’re in a sandbox. Next, define the goods and services you plan to sell. To create a new product and price:

  • Go to the Products section in the Dashboard
  • Click Add product
  • Select “Recurring” when setting the price
  • Configure the pricing plan

You can define multiple pricing plans with different parameters for each recurring product. Each price has a generated ID that you can use as a reference during the checkout process.

Remarques

Products created in a sandbox can be copied to live mode so that you don’t need to re-create them. In the Product detail view in the Dashboard, click Copy to live mode on the upper right corner. You can only do this once for each product created in a sandbox. Subsequent updates to the test product are not reflected for the live product.

Create a Checkout Session
Client-side
Server-side

Add a checkout button to your website that calls a server-side endpoint to create a Checkout Session.

index.html
<html> <head> <title>Checkout</title> </head> <body> <form action="/create-checkout-session" method="POST"> <button type="submit">Checkout</button> </form> </body> </html>

Checkout Session parameters

See Create a Checkout Session for a complete list of parameters that you can use.

Create a Checkout Session with the ID of an existing Price. Make sure that mode is set to subscription and you pass at least one recurring price. You can add one-time prices in addition to recurring prices. After creating the Checkout Session, redirect your customer to the URL returned in the response.

Command Line
cURL
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:
\ -d "payment_method_types[]"="paypal" \ -d "line_items[][price]"=
{{PRICE_ID}}
\ -d "line_items[][quantity]"=1 \ -d "mode"="subscription" \ -d "success_url"="https://example.com/success?session_id={CHECKOUT_SESSION_ID}" \ -d "cancel_url"="https://example.com/cancel" \

When your customer successfully completes their payment, they’re redirected to the success_url, a page on your website that informs the customer that their payment was successful. Make the Session ID available on your success page by including the {CHECKOUT_SESSION_ID} template variable in the success_url as in the above example.

When your customer clicks on your logo in a Checkout Session without completing a payment, Checkout redirects them back to your website by navigating to the cancel_url. Typically, this is the page on your website that the customer viewed prior to redirecting to Checkout.

Checkout Sessions expire 24 hours after creation by default.

Avertissement

Don’t rely on the redirect to the success_url alone for detecting payment initiation, as:

  • Malicious users could directly access the success_url without paying and gain access to your goods or services.
  • Customers may not always reach the success_url after a successful payment—they might close their browser tab before the redirect occurs.

Confirm the payment is successful

Remarques

When a buyer successfully confirms a subscription on Stripe with PayPal, they receive a receipt from Stripe as well as from PayPal.

When your customer completes a payment, they’re redirected to the URL that you specified as the success_url. This is typically a page on your website that informs your customer that their payment was successful.

Use the Dashboard, a custom webhook, or a third-party plugin to handle post-payment events like sending an order confirmation email to your customer, logging the sale in a database, or starting a shipping workflow.

Successful payments appear in the Dashboard’s list of payments. When you click a payment, it takes you to the Payment details page. The Checkout summary section contains billing information and the list of items purchased, which you can use to manually fulfill the order.

Checkout summary

Remarques

Stripe can help you keep up with incoming payments by sending you email notifications whenever a customer successfully completes one. Use the Dashboard to configure email notifications.

You can use plugins like Zapier to automate updating your purchase fulfillment systems with information from Stripe payments.

Some examples of automation supported by plugins include:

  • Updating spreadsheets used for order tracking in response to successful payments
  • Updating inventory management systems in response to successful payments
  • Triggering notifications to internal customer service teams using email or chat applications

Test the integration

Test your PayPal integration with your test API keys by viewing the redirect page. You can test the successful payment case by authenticating the payment on the redirect page. The PaymentIntent will transition from requires_action to succeeded.

To test the case where the user fails to authenticate, use your test API keys and view the redirect page. On the redirect page, click Fail test payment. The PaymentIntent will transition from requires_action to requires_payment_method.

FacultatifAdding a one-time setup fee
Server-side

FacultatifCreate prices and products inline
Server-side

FacultatifExisting customers
Server-side

FacultatifPrefill customer data
Server-side

FacultatifHandling trials
Server-side

FacultatifTax rates
Server-side

FacultatifAdding coupons
Server-side

Voir aussi

  • Customize your integration
  • Manage subscriptions with the customer portal
Cette page vous a-t-elle été utile?
OuiNon
  • Besoin d'aide? Contactez le service d'assistance.
  • Rejoignez notre programme d'accès anticipé.
  • Consultez notre journal des modifications.
  • Des questions? Contactez l'équipe commerciale.
  • GML? Lire llms.txt.
  • Optimisé par Markdoc