# Wiederkehrende Preismodelle Erfahren Sie mehr über die Preismodelle, die Sie mit Abonnements verwenden können. Preismodelle sind Muster, die Ihr Unternehmen auf Stripe repräsentieren und aus den von Ihnen verkauften Produkten oder Diensten, deren Kosten, der für Zahlungen akzeptierten Währungen und dem Servicezeitraum für Abos bestehen. Um das Preismodell zu erstellen, verwenden Sie[Produkte](https://docs.stripe.com/api/products.md) (was Sie verkaufen) und[Preise](https://docs.stripe.com/api/prices.md) (wie viel und wie oft Sie Zahlungen für Ihre Produkte einziehen). | Preisgestaltung | Beschreibung | | ------------------------------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | [Pauschale](https://docs.stripe.com/products-prices/pricing-models.md#flat-rate) | Kundinnen und Kunden wählen eine Servicestufe (z. B. Basic, Starter oder Enterprise) und zahlen dafür eine Pauschale. | | [Pro Nutzer/in](https://docs.stripe.com/products-prices/pricing-models.md#per-seat) | Jede Preiseinheit entspricht einem/einer Nutzer/in. Beispiel: Ein Unternehmen kauft Software für seine Mitarbeiter/innen und jede/r Mitarbeiter/in benötigt eine Lizenz, um auf die Software zuzugreifen. | | [Gestaffelt](https://docs.stripe.com/products-prices/pricing-models.md#tiered-pricing) | Die Stückkosten ändern sich mit der Menge (volumenbasierte Preisgestaltung) oder der Nutzung (gestaffelte Preisgestaltung). | | [Nutzungsbasiert](https://docs.stripe.com/products-prices/pricing-models.md#usage-based-pricing) | Stellen Sie Ihren Kundinnen und Kunden Rechnungen basierend auf der Nutzung Ihres Produkts oder Ihrer Dienstleistung. Es umfasst Preismodelle mit Pauschalpreis und Zusatzgebühren, Pay-As-You-Go und Guthabenauflösung. | ## Pauschalpreise Viele SaaS-Unternehmen bieten ihren Kundinnen und Kunden eine Auswahl an eskalierenden Serviceoptionen an. Kundinnen und Kunden wählen eine Stufe und zahlen dafür eine Pauschale. Stellen Sie sich ein Unternehmen namens [Typographic](https://typographic.io/) vor, das einen Webfont-Dienst im Abonnement verkauft. Es bietet drei verschiedene Servicestufen an: Basic, Starter und Enterprise. Für jede Servicestufe bietet das Unternehmen einen monatlichen und jährlichen Preis an. ![](https://b.stripecdn.com/docs-statics-srv/assets/pricing_model-flat-rate.4f63dae2c4f7078ae10f30324539b0cc.png) Pauschalpreismodell In diesem Beispiel hat Typographic drei Produkte: `Basic`, `Starter` und `Enterprise`. Jedes Produkt verfügt über mehrere unterschiedliche Preise. Die Basic-Stufe bietet Preise von 10 USD pro Monat und 100 USD pro Jahr. Beide Preise gehören zum selben `Basic`-Produkt, sodass sie auf dem Zahlungsbeleg und Rechnung der Kundin bzw. des Kunden die gleiche Produktbeschreibung teilen. #### Dashboard Erstellen Sie zuerst das Produkt `Basic`. Informationen zu allen Möglichkeiten, ein Produkt zu erstellen, finden Sie im [Preisleitfaden](https://docs.stripe.com/products-prices/manage-prices.md#create-product). 1. Gehen Sie zu [Produktkatalog](https://dashboard.stripe.com/products). 1. Klicken Sie auf **+ Produkt erstellen**. 1. Geben Sie einen **Namen** für das Produkt an. 1. (Optional) Fügen Sie eine **Beschreibung** hinzu. Die Beschreibung erscheint beim Bezahlvorgang, im [Kundenportal](https://docs.stripe.com/customer-management.md) und in [Angeboten](https://docs.stripe.com/quotes.md). Erstellen Sie als Nächstes den monatlichen Preis für das Produkt `Basic`: 1. Klicken Sie auf **Weitere Preisoptionen**. 1. Wählen Sie **Wiederkehrend** aus. 1. Wählen Sie unter **Preismodell auswählen** die Option **Flatrate** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. 1. Klicken Sie auf **Weiter**, um den Preis zu speichern. 1. Wählen Sie als **Preismodell** die Option **Standard-Preisgestaltung** aus. 1. Wählen Sie **Wiederkehrend** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. Erstellen Sie als Nächstes den jährlichen Preis für das Produkt `Basic`: 1. Klicken Sie auf **+ Weiteren Preis hinzufügen**. 1. Wählen Sie **Wiederkehrend** aus. 1. Wählen Sie unter **Preismodell auswählen** die Option **Flatrate** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Jährlich** aus. 1. Klicken Sie auf **Weiter**. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu speichern. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. 1. Klicken Sie auf **+ Weiteren Preis hinzufügen**. 1. Wählen Sie für das **Preismodell** die Option **Standard-Preisgestaltung** aus. 1. Wählen Sie **Wiederkehrend** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Jährlich** aus. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu erstellen. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. #### API 1. Erstellen Sie ein Produkt für die Servicestufe `Basic`. ```curl curl https://api.stripe.com/v1/products \ -u "<>:" \ -d name=Basic ``` ```cli stripe products create \ --name=Basic ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") product = client.v1.products.create({name: 'Basic'}) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. product = client.v1.products.create({"name": "Basic"}) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $product = $stripe->products->create(['name' => 'Basic']); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ProductCreateParams params = ProductCreateParams.builder().setName("Basic").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Product product = client.v1().products().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const product = await stripe.products.create({ name: 'Basic', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.ProductCreateParams{Name: stripe.String("Basic")} result, err := sc.V1Products.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new ProductCreateOptions { Name = "Basic" }; var client = new StripeClient("<>"); var service = client.V1.Products; Product product = service.Create(options); ``` 1. Erstellen Sie den monatlichen Preis für das Produkt `Basic`. ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d product="{{PRODUCT_ID}}" \ -d unit_amount=1000 \ -d currency=usd \ -d "recurring[interval]"=month ``` ```cli stripe prices create \ --product="{{PRODUCT_ID}}" \ --unit-amount=1000 \ --currency=usd \ -d "recurring[interval]"=month ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 1000, currency: 'usd', recurring: {interval: 'month'}, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "product": "{{PRODUCT_ID}}", "unit_amount": 1000, "currency": "usd", "recurring": {"interval": "month"}, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'product' => '{{PRODUCT_ID}}', 'unit_amount' => 1000, 'currency' => 'usd', 'recurring' => ['interval' => 'month'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setProduct("{{PRODUCT_ID}}") .setUnitAmount(1000L) .setCurrency("usd") .setRecurring( PriceCreateParams.Recurring.builder() .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 1000, currency: 'usd', recurring: { interval: 'month', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Product: stripe.String("{{PRODUCT_ID}}"), UnitAmount: stripe.Int64(1000), Currency: stripe.String(stripe.CurrencyUSD), Recurring: &stripe.PriceCreateRecurringParams{ Interval: stripe.String(stripe.PriceRecurringIntervalMonth), }, } result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Product = "{{PRODUCT_ID}}", UnitAmount = 1000, Currency = "usd", Recurring = new PriceRecurringOptions { Interval = "month" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` 1. Erstellen Sie den jährlichen Preis für das Produkt `Basic`. ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d product="{{PRODUCT_ID}}" \ -d unit_amount=10000 \ -d currency=usd \ -d "recurring[interval]"=year ``` ```cli stripe prices create \ --product="{{PRODUCT_ID}}" \ --unit-amount=10000 \ --currency=usd \ -d "recurring[interval]"=year ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 10000, currency: 'usd', recurring: {interval: 'year'}, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "product": "{{PRODUCT_ID}}", "unit_amount": 10000, "currency": "usd", "recurring": {"interval": "year"}, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'product' => '{{PRODUCT_ID}}', 'unit_amount' => 10000, 'currency' => 'usd', 'recurring' => ['interval' => 'year'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setProduct("{{PRODUCT_ID}}") .setUnitAmount(10000L) .setCurrency("usd") .setRecurring( PriceCreateParams.Recurring.builder() .setInterval(PriceCreateParams.Recurring.Interval.YEAR) .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 10000, currency: 'usd', recurring: { interval: 'year', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Product: stripe.String("{{PRODUCT_ID}}"), UnitAmount: stripe.Int64(10000), Currency: stripe.String(stripe.CurrencyUSD), Recurring: &stripe.PriceCreateRecurringParams{ Interval: stripe.String(stripe.PriceRecurringIntervalYear), }, } result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Product = "{{PRODUCT_ID}}", UnitAmount = 10000, Currency = "usd", Recurring = new PriceRecurringOptions { Interval = "year" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` Wiederholen Sie diese Schritte, um die Produkte `Starter` und `Enterprise` und die zugehörigen Preise zu erstellen. Nachdem Sie dieses Preismodell erstellt haben, können Sie damit [Abonnements](https://docs.stripe.com/api/subscriptions.md) für Ihre Kundinnen und Kunden erstellen. ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d customer="{{CUSTOMER_ID}}" \ -d "items[0][price]"={{RECURRING_PRICE_ID}} ``` ```cli stripe subscriptions create \ --customer="{{CUSTOMER_ID}}" \ -d "items[0][price]"={{RECURRING_PRICE_ID}} ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") subscription = client.v1.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [{price: '{{RECURRING_PRICE_ID}}'}], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. subscription = client.v1.subscriptions.create({ "customer": "{{CUSTOMER_ID}}", "items": [{"price": "{{RECURRING_PRICE_ID}}"}], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'customer' => '{{CUSTOMER_ID}}', 'items' => [['price' => '{{RECURRING_PRICE_ID}}']], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addItem( SubscriptionCreateParams.Item.builder().setPrice("{{RECURRING_PRICE_ID}}").build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Subscription subscription = client.v1().subscriptions().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { price: '{{RECURRING_PRICE_ID}}', }, ], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.SubscriptionCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Items: []*stripe.SubscriptionCreateItemParams{ &stripe.SubscriptionCreateItemParams{Price: stripe.String("{{RECURRING_PRICE_ID}}")}, }, } result, err := sc.V1Subscriptions.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", Items = new List { new SubscriptionItemOptions { Price = "{{RECURRING_PRICE_ID}}" }, }, }; var client = new StripeClient("<>"); var service = client.V1.Subscriptions; Subscription subscription = service.Create(options); ``` ### Preisgestaltung pro Nutzer/in Bei der Per-Seat-Preisgestaltung handelt es sich um ein lineares Preismodell, bei dem die Anzahl der „Seats“ (zum Beispiel Softwarelizenzen) der Anzahl von Einheiten, z. B. der Nutzer, zugeordnet wird. Typographic, unser Beispielunternehmen, möchte ebenfalls einen Per-Seat-Plan anbieten. Die Kundinnen und Kunden von Typographic wählen aus, wie viele Seats sie nutzen möchten, und zahlen Typographic entsprechend diesem Betrag Gebühren. ![](https://b.stripecdn.com/docs-statics-srv/assets/pricing_model-per-seat.4cf434831d2b09622f8335cdd8ff70d5.png) Preismodell pro Nutzer/in Um dieses Szenario zu modellieren, erstellt Typographic ein Produkt mit einem Pauschalpreis, bei dem jede Einheit eine/n Nutzer/in darstellt. Wenn Typographic ein Abo für einen Kunden erstellt, gibt der Kunde/die Kundin die Anzahl der Nutzer/innen für dieses Abonnement an. #### Dashboard Erstellen Sie zuerst das Pro-Nutzer-Produkt. Informationen zu allen Möglichkeiten, ein Produkt zu erstellen, finden Sie im [Preisleitfaden](https://docs.stripe.com/products-prices/manage-prices.md#create-product). 1. Gehen Sie zu [Produktkatalog](https://dashboard.stripe.com/products). 1. Klicken Sie auf **+ Produkt erstellen**. 1. Geben Sie einen **Namen** für das Produkt an. 1. (Optional) Fügen Sie eine **Beschreibung** hinzu. Die Beschreibung erscheint während des Bezahlvorgangs, im [Kundenportal](https://docs.stripe.com/customer-management.md) und in [Angeboten](https://docs.stripe.com/quotes.md). Erstellen Sie als Nächstes den monatlichen Preis für das Produkt: 1. Wählen Sie **Wiederkehrend** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu speichern. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. 1. Wählen Sie **Standard-Preisgestaltung** als **Preismodell** und anschließend **Wiederkehrend** aus. 1. Geben Sie unter **Betrag** einen Preisbetrag ein. 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu speichern. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. So erstellen Sie ein Abonnement mit diesem Preis: 1. Rufen Sie die Seite **Abrechnung** > **Abonnements** auf. 1. Klicken Sie auf **+ Abonnement erstellen**. 1. Suchen Sie nach einem/einer Kund/in oder fügen Sie eine/n Kund/in hinzu. 1. Suchen Sie nach dem von Ihnen erstellten Produkt und wählen Sie den gewünschten Preis aus. 1. (Optional) Wählen Sie **Steuer automatisch einziehen**, um Stripe Tax zu verwenden. 1. Klicken Sie auf **Abo starten**, um das Abonnement sofort zu starten, oder auf **Abonnement planen**, um das Abonnement nach einem weiteren Zeitplan zu starten. #### API 1. Erstellen Sie das Pro-Nutzer-Produkt. ```curl curl https://api.stripe.com/v1/products \ -u "<>:" \ -d name=Per-seat ``` ```cli stripe products create \ --name=Per-seat ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") product = client.v1.products.create({name: 'Per-seat'}) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. product = client.v1.products.create({"name": "Per-seat"}) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $product = $stripe->products->create(['name' => 'Per-seat']); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ProductCreateParams params = ProductCreateParams.builder().setName("Per-seat").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Product product = client.v1().products().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const product = await stripe.products.create({ name: 'Per-seat', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.ProductCreateParams{Name: stripe.String("Per-seat")} result, err := sc.V1Products.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new ProductCreateOptions { Name = "Per-seat" }; var client = new StripeClient("<>"); var service = client.V1.Products; Product product = service.Create(options); ``` 1. Erstellen Sie einen Preis für die monatliche Gebühr. ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d product="{{PRODUCT_ID}}" \ -d unit_amount=1000 \ -d currency=usd \ -d "recurring[interval]"=month ``` ```cli stripe prices create \ --product="{{PRODUCT_ID}}" \ --unit-amount=1000 \ --currency=usd \ -d "recurring[interval]"=month ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 1000, currency: 'usd', recurring: {interval: 'month'}, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "product": "{{PRODUCT_ID}}", "unit_amount": 1000, "currency": "usd", "recurring": {"interval": "month"}, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'product' => '{{PRODUCT_ID}}', 'unit_amount' => 1000, 'currency' => 'usd', 'recurring' => ['interval' => 'month'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setProduct("{{PRODUCT_ID}}") .setUnitAmount(1000L) .setCurrency("usd") .setRecurring( PriceCreateParams.Recurring.builder() .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ product: '{{PRODUCT_ID}}', unit_amount: 1000, currency: 'usd', recurring: { interval: 'month', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Product: stripe.String("{{PRODUCT_ID}}"), UnitAmount: stripe.Int64(1000), Currency: stripe.String(stripe.CurrencyUSD), Recurring: &stripe.PriceCreateRecurringParams{ Interval: stripe.String(stripe.PriceRecurringIntervalMonth), }, } result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Product = "{{PRODUCT_ID}}", UnitAmount = 1000, Currency = "usd", Recurring = new PriceRecurringOptions { Interval = "month" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` 1. Wenn Sie das [Abonnement](https://docs.stripe.com/api/subscriptions.md) erstellen, geben Sie eine `quantity` an, um die Anzahl der Nutzerlizenzen zu berechnen. ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d customer="{{CUSTOMER_ID}}" \ -d "items[0][price]"={{per_seat_price_id}} \ -d "items[0][quantity]"=12 ``` ```cli stripe subscriptions create \ --customer="{{CUSTOMER_ID}}" \ -d "items[0][price]"={{per_seat_price_id}} \ -d "items[0][quantity]"=12 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") subscription = client.v1.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { price: '{{per_seat_price_id}}', quantity: 12, }, ], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. subscription = client.v1.subscriptions.create({ "customer": "{{CUSTOMER_ID}}", "items": [{"price": "{{per_seat_price_id}}", "quantity": 12}], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'customer' => '{{CUSTOMER_ID}}', 'items' => [ [ 'price' => '{{per_seat_price_id}}', 'quantity' => 12, ], ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addItem( SubscriptionCreateParams.Item.builder() .setPrice("{{per_seat_price_id}}") .setQuantity(12L) .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Subscription subscription = client.v1().subscriptions().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { price: '{{per_seat_price_id}}', quantity: 12, }, ], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.SubscriptionCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Items: []*stripe.SubscriptionCreateItemParams{ &stripe.SubscriptionCreateItemParams{ Price: stripe.String("{{per_seat_price_id}}"), Quantity: stripe.Int64(12), }, }, } result, err := sc.V1Subscriptions.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", Items = new List { new SubscriptionItemOptions { Price = "{{per_seat_price_id}}", Quantity = 12 }, }, }; var client = new StripeClient("<>"); var service = client.V1.Subscriptions; Subscription subscription = service.Create(options); ``` ## Stufenpreise Preise können so gestaffelt werden, dass sich die Stückkosten je nach Menge oder Nutzung ändern. Verwenden Sie Stufen, wenn Sie nichtlineare Preise benötigen und sich `quantity` oder die [Nutzung](https://docs.stripe.com/api/billing/meter-event.md) ändert. Sie können auch die gestaffelte Preisgestaltung mit Grundgebühren kombinieren, um [nutzungsbasierte Preismodelle](https://docs.stripe.com/products-prices/pricing-models.md#usage-based-pricing) zu erstellen. Typographic möchte beispielsweise Kundinnen und Kunden, die mehr Schriftarten pro Monat verwenden, niedrigere Preise anbieten. Die folgenden gestaffelten Preisgestaltungen zeigen zwei verschiedene Möglichkeiten, die Preise mit zunehmender Nutzung anzupassen: volumenbasiert und gestaffelte Preisgestaltung. Um diese Ansätze der gestuften Preisgestaltung zu demonstrieren, verwenden wir die folgenden Stufen: | | Anzahl der Schriftarten | Preis pro Stufe | | ------------ | ----------------------- | --------------- | | Stufe 1 | 1 bis 5 | 7 USD | | Zweite Stufe | 6 bis 10 | 6.5 USD | | Dritte Stufe | 11+ | 6 USD | ### Volumenbasierte Preise Bei der volumenbasierten Preisgestaltung wird der Abonnement-Artikel anhand der Nutzungsmenge am Ende des Zeitraums abgerechnet. Die gesamte `quantity` (oder `usage`) wird mit dem Stückpreis der Stufe multipliziert. Da der Staffelpreis auf die gesamte `quantity` (oder `usage`) angewendet wird, kann die Summe beim Berechnen des Endpreises geringer ausfallen. Beispielsweise wird einem Kunden/einer Kundin mit 5 Schriftarten 35 USD (5 × 7 USD) berechnet. Wenn er/sie im folgenden Monat 6 Schriftarten verwendet, werden alle Schriftarten zum `6-10`-Tarif abgerechnet. In diesem Monat werden ihr/ihm 39 USD (6 × ) berechnet. | Menge und Nutzung am Ende des Zeitraums | Stückkosten | Monatliche Gesamtkosten | | --------------------------------------- | ----------- | ----------------------- | | 1 | 7 USD | 7 USD | | 5 | 7 USD | 35 USD | | 6 | 6.5 USD | 39 USD | | 20 | 6 USD | 120 USD | | 25 | 6 USD | 150 USD | #### Dashboard 1. Gehen Sie zum [Produktkatalog](https://dashboard.stripe.com/products). 1. Klicken Sie auf **+ Produkt erstellen**. 1. Geben Sie einen **Namen** für das Produkt an. 1. (Optional) Fügen Sie eine **Beschreibung** hinzu. Die Beschreibung erscheint während des Bezahlvorgangs, im [Kundenportal](https://docs.stripe.com/customer-management.md) und in [Angeboten](https://docs.stripe.com/quotes.md). Erstellen Sie als Nächstes den monatlichen Preis für das Produkt: 1. Klicken Sie auf **Weitere Preisoptionen**. 1. Wählen Sie **Wiederkehrend** aus. 1. Wählen Sie unter **Preismodell auswählen** die Optionen **Gestaffelte Preisgestaltung** und **Volumen** aus. 1. Erstellen Sie unter **Preis** drei Stufen: | | Erste Einheit | Letzte Einheit | Pro Einheit | Pauschalpreis | | ------------ | ------------- | -------------- | ----------- | ------------- | | Stufe 1 | 1 | 5 | 7 USD | 0 USD | | Zweite Stufe | 6 | 10 | 6.5 USD | 0 USD | | Dritte Stufe | 11 | ∞ | 6 USD | 0 USD | 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu speichern. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. #### API Erstellen Sie die Stufen so, dass sie dem Beispiel entsprechen, und legen Sie den Wert von `tiers_mode` auf `volume` fest: ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d nickname="Font Volume Pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ -d currency=usd \ -d "recurring[interval]"=month \ -d "recurring[usage_type]"=metered \ -d product="{{PRODUCT_ID}}" \ -d tiers_mode=volume \ -d billing_scheme=tiered \ -d "expand[0]"=tiers ``` ```cli stripe prices create \ --nickname="Font Volume Pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ --currency=usd \ -d "recurring[interval]"=month \ -d "recurring[usage_type]"=metered \ --product="{{PRODUCT_ID}}" \ --tiers-mode=volume \ --billing-scheme=tiered \ -d "expand[0]"=tiers ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ nickname: 'Font Volume Pricing', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], currency: 'usd', recurring: { interval: 'month', usage_type: 'metered', }, product: '{{PRODUCT_ID}}', tiers_mode: 'volume', billing_scheme: 'tiered', expand: ['tiers'], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "nickname": "Font Volume Pricing", "tiers": [ {"unit_amount": 700, "up_to": 5}, {"unit_amount": 650, "up_to": 10}, {"unit_amount": 600, "up_to": "inf"}, ], "currency": "usd", "recurring": {"interval": "month", "usage_type": "metered"}, "product": "{{PRODUCT_ID}}", "tiers_mode": "volume", "billing_scheme": "tiered", "expand": ["tiers"], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'nickname' => 'Font Volume Pricing', 'tiers' => [ [ 'unit_amount' => 700, 'up_to' => 5, ], [ 'unit_amount' => 650, 'up_to' => 10, ], [ 'unit_amount' => 600, 'up_to' => 'inf', ], ], 'currency' => 'usd', 'recurring' => [ 'interval' => 'month', 'usage_type' => 'metered', ], 'product' => '{{PRODUCT_ID}}', 'tiers_mode' => 'volume', 'billing_scheme' => 'tiered', 'expand' => ['tiers'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setNickname("Font Volume Pricing") .addTier(PriceCreateParams.Tier.builder().setUnitAmount(700L).setUpTo(5L).build()) .addTier(PriceCreateParams.Tier.builder().setUnitAmount(650L).setUpTo(10L).build()) .addTier( PriceCreateParams.Tier.builder() .setUnitAmount(600L) .setUpTo(PriceCreateParams.Tier.UpTo.INF) .build() ) .setCurrency("usd") .setRecurring( PriceCreateParams.Recurring.builder() .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .setUsageType(PriceCreateParams.Recurring.UsageType.METERED) .build() ) .setProduct("{{PRODUCT_ID}}") .setTiersMode(PriceCreateParams.TiersMode.VOLUME) .setBillingScheme(PriceCreateParams.BillingScheme.TIERED) .addExpand("tiers") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ nickname: 'Font Volume Pricing', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], currency: 'usd', recurring: { interval: 'month', usage_type: 'metered', }, product: '{{PRODUCT_ID}}', tiers_mode: 'volume', billing_scheme: 'tiered', expand: ['tiers'], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Nickname: stripe.String("Font Volume Pricing"), Tiers: []*stripe.PriceCreateTierParams{ &stripe.PriceCreateTierParams{UnitAmount: stripe.Int64(700), UpTo: stripe.Int64(5)}, &stripe.PriceCreateTierParams{UnitAmount: stripe.Int64(650), UpTo: stripe.Int64(10)}, &stripe.PriceCreateTierParams{ UnitAmount: stripe.Int64(600), UpToInf: stripe.String("inf"), }, }, Currency: stripe.String(stripe.CurrencyUSD), Recurring: &stripe.PriceCreateRecurringParams{ Interval: stripe.String(stripe.PriceRecurringIntervalMonth), UsageType: stripe.String(stripe.PriceRecurringUsageTypeMetered), }, Product: stripe.String("{{PRODUCT_ID}}"), TiersMode: stripe.String(stripe.PriceTiersModeVolume), BillingScheme: stripe.String(stripe.PriceBillingSchemeTiered), } params.AddExpand("tiers") result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Nickname = "Font Volume Pricing", Tiers = new List { new PriceTierOptions { UnitAmount = 700, UpTo = 5 }, new PriceTierOptions { UnitAmount = 650, UpTo = 10 }, new PriceTierOptions { UnitAmount = 600, UpTo = PriceTierUpTo.Inf }, }, Currency = "usd", Recurring = new PriceRecurringOptions { Interval = "month", UsageType = "metered" }, Product = "{{PRODUCT_ID}}", TiersMode = "volume", BillingScheme = "tiered", Expand = new List { "tiers" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` ### Gestaffelte Preisgestaltung Die gestaffelte Preisgestaltung ähnelt der Volumenpreisgestaltung, hierbei wird aber die Nutzung pro Stufe abgerechnet, anstatt einen einzigen Preis für die Gesamtnutzung anzuwenden. Die `quantity` wird mit dem Betrag für jede Stufe multipliziert und die Summen für jede Stufe werden addiert. Beispielsweise führen 5 Schriftarten zum selben Zahlungsbetrag wie die volumenbasierte Preisgestaltung – insgesamt 35 USD bei 7 USD pro Schriftart. Dies ändert sich, sobald die Nutzung die erste Stufe überschreitet. Ein Kunde / eine Kundin mit mehr als 5 Schriftarten zahlt 7 USD pro Schriftart für die ersten 5 Schriftarten, dann für die Schriftarten 6 bis 10 und schließlich 6 USD pro Schriftart danach. Einer Kundin/einem Kunden mit 6 Schriftarten wird mit 41.5 USD, für die ersten 5 Schriftarten und für die 6. Schriftart berechnet. | Menge und Nutzung am Ende des Zeitraums | Summe für gestaffelte Preisgestaltung | | --------------------------------------- | ------------------------------------- | | 1 | 7 USD | | 5 | 35 USD | | 6 | 41.5 USD | | 20 | 127.5 USD | | 25 | 157.5 USD | #### Dashboard 1. Gehen Sie zum [Produktkatalog](https://dashboard.stripe.com/products). 1. Klicken Sie auf **+ Produkt erstellen**. 1. Geben Sie einen **Namen** für das Produkt an. 1. (Optional) Fügen Sie eine **Beschreibung** hinzu. Die Beschreibung erscheint während des Bezahlvorgangs, im [Kundenportal](https://docs.stripe.com/customer-management.md) und in [Angeboten](https://docs.stripe.com/quotes.md). Erstellen Sie als Nächstes den monatlichen Preis für das Produkt: 1. Klicken Sie auf **Weitere Preisoptionen**. 1. Wählen Sie **Wiederkehrend** aus. 1. Wählen Sie unter **Preismodell auswählen** die Optionen **Gestaffelte Preisgestaltung** und **Gestaffelt** aus. 1. Erstellen Sie unter **Preis** drei Stufen: | | Erste Einheit | Letzte Einheit | Pro Einheit | Pauschalpreis | | ------------ | ------------- | -------------- | ----------- | ------------- | | Stufe 1 | 1 | 5 | 7 USD | 0 USD | | Zweite Stufe | 6 | 10 | 6.5 USD | 0 USD | | Dritte Stufe | 11 | ∞ | 6 USD | 0 USD | 1. Wählen Sie als **Abrechnungszeitraum** die Option **Monatlich** aus. 1. Klicken Sie auf **Produkt hinzufügen**, um das Produkt und den Preis zu speichern. Sie können das Produkt und den Preis nur so lange bearbeiten, bis Sie ein Abonnement dafür erstellen. #### API Erstellen Sie die Stufen so, dass sie dem Beispiel entsprechen, und legen Sie den Wert von `tiers_mode` auf `graduated` fest: ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d nickname="Per-minute pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ -d currency=usd \ -d "recurring[interval]"=month \ -d "recurring[usage_type]"=metered \ -d product="{{PRODUCT_ID}}" \ -d tiers_mode=graduated \ -d billing_scheme=tiered \ -d "expand[0]"=tiers ``` ```cli stripe prices create \ --nickname="Per-minute pricing" \ -d "tiers[0][unit_amount]"=700 \ -d "tiers[0][up_to]"=5 \ -d "tiers[1][unit_amount]"=650 \ -d "tiers[1][up_to]"=10 \ -d "tiers[2][unit_amount]"=600 \ -d "tiers[2][up_to]"=inf \ --currency=usd \ -d "recurring[interval]"=month \ -d "recurring[usage_type]"=metered \ --product="{{PRODUCT_ID}}" \ --tiers-mode=graduated \ --billing-scheme=tiered \ -d "expand[0]"=tiers ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ nickname: 'Per-minute pricing', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], currency: 'usd', recurring: { interval: 'month', usage_type: 'metered', }, product: '{{PRODUCT_ID}}', tiers_mode: 'graduated', billing_scheme: 'tiered', expand: ['tiers'], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "nickname": "Per-minute pricing", "tiers": [ {"unit_amount": 700, "up_to": 5}, {"unit_amount": 650, "up_to": 10}, {"unit_amount": 600, "up_to": "inf"}, ], "currency": "usd", "recurring": {"interval": "month", "usage_type": "metered"}, "product": "{{PRODUCT_ID}}", "tiers_mode": "graduated", "billing_scheme": "tiered", "expand": ["tiers"], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'nickname' => 'Per-minute pricing', 'tiers' => [ [ 'unit_amount' => 700, 'up_to' => 5, ], [ 'unit_amount' => 650, 'up_to' => 10, ], [ 'unit_amount' => 600, 'up_to' => 'inf', ], ], 'currency' => 'usd', 'recurring' => [ 'interval' => 'month', 'usage_type' => 'metered', ], 'product' => '{{PRODUCT_ID}}', 'tiers_mode' => 'graduated', 'billing_scheme' => 'tiered', 'expand' => ['tiers'], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setNickname("Per-minute pricing") .addTier(PriceCreateParams.Tier.builder().setUnitAmount(700L).setUpTo(5L).build()) .addTier(PriceCreateParams.Tier.builder().setUnitAmount(650L).setUpTo(10L).build()) .addTier( PriceCreateParams.Tier.builder() .setUnitAmount(600L) .setUpTo(PriceCreateParams.Tier.UpTo.INF) .build() ) .setCurrency("usd") .setRecurring( PriceCreateParams.Recurring.builder() .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .setUsageType(PriceCreateParams.Recurring.UsageType.METERED) .build() ) .setProduct("{{PRODUCT_ID}}") .setTiersMode(PriceCreateParams.TiersMode.GRADUATED) .setBillingScheme(PriceCreateParams.BillingScheme.TIERED) .addExpand("tiers") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ nickname: 'Per-minute pricing', tiers: [ { unit_amount: 700, up_to: 5, }, { unit_amount: 650, up_to: 10, }, { unit_amount: 600, up_to: 'inf', }, ], currency: 'usd', recurring: { interval: 'month', usage_type: 'metered', }, product: '{{PRODUCT_ID}}', tiers_mode: 'graduated', billing_scheme: 'tiered', expand: ['tiers'], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Nickname: stripe.String("Per-minute pricing"), Tiers: []*stripe.PriceCreateTierParams{ &stripe.PriceCreateTierParams{UnitAmount: stripe.Int64(700), UpTo: stripe.Int64(5)}, &stripe.PriceCreateTierParams{UnitAmount: stripe.Int64(650), UpTo: stripe.Int64(10)}, &stripe.PriceCreateTierParams{ UnitAmount: stripe.Int64(600), UpToInf: stripe.String("inf"), }, }, Currency: stripe.String(stripe.CurrencyUSD), Recurring: &stripe.PriceCreateRecurringParams{ Interval: stripe.String(stripe.PriceRecurringIntervalMonth), UsageType: stripe.String(stripe.PriceRecurringUsageTypeMetered), }, Product: stripe.String("{{PRODUCT_ID}}"), TiersMode: stripe.String(stripe.PriceTiersModeGraduated), BillingScheme: stripe.String(stripe.PriceBillingSchemeTiered), } params.AddExpand("tiers") result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Nickname = "Per-minute pricing", Tiers = new List { new PriceTierOptions { UnitAmount = 700, UpTo = 5 }, new PriceTierOptions { UnitAmount = 650, UpTo = 10 }, new PriceTierOptions { UnitAmount = 600, UpTo = PriceTierUpTo.Inf }, }, Currency = "usd", Recurring = new PriceRecurringOptions { Interval = "month", UsageType = "metered" }, Product = "{{PRODUCT_ID}}", TiersMode = "graduated", BillingScheme = "tiered", Expand = new List { "tiers" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` ### Fügen Sie einen Pauschalpreis hinzu Sie können einen Pauschalbetrag (`flat_amount`) angeben, der zur *Rechnung* (Invoices are statements of amounts owed by a customer. They track the status of payments from draft through paid or otherwise finalized. Subscriptions automatically generate invoices, or you can manually create a one-off invoice) hinzugefügt wird. Dies gilt sowohl für volumenbasierte als auch für gestaffelte Preisgestaltungen. Sie können zum Beispiel eine Pauschalgebühr erheben, die sich erhöht, wenn Ihre Kundin oder Ihr Kunde bestimmte Nutzungsschwellenwerte überschreitet: | Stufe | Menge (Stückkosten) | Pauschalpreis | | ---------------------- | -------------------------- | --------------------------- | | 1 bis 5 (`up_to=5`) | 5 USD (`unit_amount=500`) | 10 USD (`flat_amount=1000`) | | 6 bis 10 (`up_to=10`) | 4 USD (`unit_amount=400`) | 20 USD (`flat_amount=2000`) | | 10 bis 15 (`up_to=15`) | 3 USD (`unit_amount=300`) | 30 USD (`flat_amount=3000`) | | 15 bis 20 (`up_to=20`) | 2 USD (`unit_amount=200`) | 40 USD (`flat_amount=4000`) | | 20+ (`up_to=inf`) | 1 USD (`unit_amount=100`) | 50 USD (`flat_amount=5000`) | #### Beispiel für eine volumenbasierte Preisgestaltung mit Pauschalpreis Wenn `quantity` gleich `12` und `tiers_mode=volume` ist, lautet der Rechnungsbetrag: 12 × 3 USD + 30 USD = 66 USD #### Beispiel für eine gestaffelte Preisgestaltung mit Pauschalpreis Wenn `quantity` gleich `12` und `tiers_mode=graduated` ist, lautet der Rechnungsbetrag: (5 × 5 USD + 10 USD) + (5 × 4 USD + 20 USD) + (2 × 3 USD + 30 USD) = 111 USD Eine Stufe kann entweder einen `unit_amount` oder einen `flat_amount` oder beides haben, muss jedoch mindestens eines der beiden enthalten. Wenn `quantity` `0` ist, beträgt der Gesamtbetrag 10 USD, unabhängig vom verwendeten gestaffelten Preisgestaltungsmodell. Stripe berechnet immer die erste Pauschalpreisstufe, wenn `quantity=0`. Um `0` zu berechnen, wenn keine Nutzung erfolgt, richten Sie eine `up_to=1`-Stufe mit einem `unit_amount` gleich dem Pauschalpreis ein und lassen den `flat_amount` weg. ## Nutzungsbasierte Tarife Mit der nutzungsbasierten Preisgestaltung können Sie Gebühren basierend auf der Nutzung Ihres Produkts oder Ihrer Dienstleistung durch einen Kunden/eine Kundin erheben. Die nutzungsbasierte Preisgestaltung umfasst Modelle wie Pauschalgebühr und Zusatzgebühren, Pay-As-You-Go und Aufbrauchen des Guthabens. ### Pauschalgebühr und Zusatzgebührenpreis Verwenden Sie das Modell mit Pauschalgebühr und Zusatzgebührenpreis, um zu Beginn des Zeitraums eine Pauschalgebühr pro Monat für Ihren Dienst zu berechnen. Im Pauschalpreis sind ein gewisser Nutzungsanspruch und eventuelle zusätzliche Zusatzgebühren am Ende des Zeitraums enthalten. Sie können das Stripe-Dashboard oder die API verwenden, um dies mit zwei Preisen innerhalb desselben Produkts einzurichten. Zum Beispiel führt Hypernian ein fortgeschrittenes Modell namens Hypernian ein. Mit einem Preis von 200 USD pro Monat umfasst dieses Modell 100.000 Token. Jede Nutzung über die enthaltenen Token hinaus wird zu einem zusätzlichen Satz von 0.001 USD pro Token berechnet. #### Dashboard 1. Klicken Sie auf der Seite [Produktkatalog](https://dashboard.stripe.com/test/products) auf **Produkt erstellen**. 1. Gehen Sie auf der Seite **Produkt hinzufügen** wie folgt vor: - Geben Sie bei **Name** den Namen Ihres Produkts ein. Geben Sie für das Hypernian-Beispiel „Hypernian“ ein. - (Optional) Fügen Sie für **Beschreibung** eine Beschreibung hinzu, die beim Bezahlvorgang im [Kundenportal](https://docs.stripe.com/customer-management.md) und in den [Angeboten](https://docs.stripe.com/quotes.md) angezeigt wird. - Wählen Sie unter **Abrechnungszeitraum** die Option **Weitere Preisoptionen** aus. 1. Führen Sie auf der Seite **Preis hinzufügen** die folgenden Schritte aus: - Wählen Sie unter **Preismodell auswählen** die Option **Flatrate** aus. - Setzen Sie unter **Preis** den **Betrag** auf 200 USD. - Klicken Sie auf **Weiter** 1. Um dem Produkt einen zweiten wiederkehrenden Preis hinzuzufügen, klicken Sie auf der Seite **Produkt hinzufügen** auf **Weiteren Preis hinzufügen**. 1. Gehen Sie auf der Seite **Preis hinzufügen** wie folgt vor: - Wählen Sie unter **Preismodell auswählen** die Optionen **Nutzungsbasiert**, **Pro Stufe** und **Gestaffelt** aus. - Erstellen Sie unter **Preis** zwei gestaffelte Preisstufen: | | Erste Einheit | Letzte Einheit | Pro Einheit | Pauschalpreis | | ------------ | ------------- | -------------- | ----------- | ------------- | | Stufe 1 | 0 | 100.000 | 0 USD | 0 USD | | Zweite Stufe | 100.001 | ∞ | 0.001 USD | 0 USD | 1. Erstellen Sie unter **Zähler** einen neuen Zähler, um die Nutzung zu erfassen. Verwenden Sie im Hypernian-Beispiel den Zählernamen „hypernian_api_tokens“. 1. Klicken Sie auf **Weiter**. 1. Klicken Sie auf **Produkt hinzufügen**. Wenn Sie Abonnements erstellen, geben Sie beide Preise an. #### API Erstellen Sie zunächst Ihr [Produkt](https://docs.stripe.com/api/products.md). Verwenden Sie im Hypernian-Beispiel den Namen `Hypernian-Token`. ```curl curl https://api.stripe.com/v1/products \ -u "<>:" \ -d name="Hypernian tokens" ``` ```cli stripe products create \ --name="Hypernian tokens" ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") product = client.v1.products.create({name: 'Hypernian tokens'}) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. product = client.v1.products.create({"name": "Hypernian tokens"}) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $product = $stripe->products->create(['name' => 'Hypernian tokens']); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); ProductCreateParams params = ProductCreateParams.builder().setName("Hypernian tokens").build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Product product = client.v1().products().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const product = await stripe.products.create({ name: 'Hypernian tokens', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.ProductCreateParams{Name: stripe.String("Hypernian tokens")} result, err := sc.V1Products.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new ProductCreateOptions { Name = "Hypernian tokens" }; var client = new StripeClient("<>"); var service = client.V1.Products; Product product = service.Create(options); ``` Als Nächstes fügen Sie dem Produkt einen [Pauschalpreis](https://docs.stripe.com/api/prices.md) mit einem Lizenzsatz von 200 USD hinzu. ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d product={{PRODUCT_ID}} \ -d currency=usd \ -d unit_amount=20000 \ -d billing_scheme=per_unit \ -d "recurring[usage_type]"=licensed \ -d "recurring[interval]"=month ``` ```cli stripe prices create \ --product={{PRODUCT_ID}} \ --currency=usd \ --unit-amount=20000 \ --billing-scheme=per_unit \ -d "recurring[usage_type]"=licensed \ -d "recurring[interval]"=month ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ product: '{{PRODUCT_ID}}', currency: 'usd', unit_amount: 20000, billing_scheme: 'per_unit', recurring: { usage_type: 'licensed', interval: 'month', }, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "product": "{{PRODUCT_ID}}", "currency": "usd", "unit_amount": 20000, "billing_scheme": "per_unit", "recurring": {"usage_type": "licensed", "interval": "month"}, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'product' => '{{PRODUCT_ID}}', 'currency' => 'usd', 'unit_amount' => 20000, 'billing_scheme' => 'per_unit', 'recurring' => [ 'usage_type' => 'licensed', 'interval' => 'month', ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setProduct("{{PRODUCT_ID}}") .setCurrency("usd") .setUnitAmount(20000L) .setBillingScheme(PriceCreateParams.BillingScheme.PER_UNIT) .setRecurring( PriceCreateParams.Recurring.builder() .setUsageType(PriceCreateParams.Recurring.UsageType.LICENSED) .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ product: '{{PRODUCT_ID}}', currency: 'usd', unit_amount: 20000, billing_scheme: 'per_unit', recurring: { usage_type: 'licensed', interval: 'month', }, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Product: stripe.String("{{PRODUCT_ID}}"), Currency: stripe.String(stripe.CurrencyUSD), UnitAmount: stripe.Int64(20000), BillingScheme: stripe.String(stripe.PriceBillingSchemePerUnit), Recurring: &stripe.PriceCreateRecurringParams{ UsageType: stripe.String(stripe.PriceRecurringUsageTypeLicensed), Interval: stripe.String(stripe.PriceRecurringIntervalMonth), }, } result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Product = "{{PRODUCT_ID}}", Currency = "usd", UnitAmount = 20000, BillingScheme = "per_unit", Recurring = new PriceRecurringOptions { UsageType = "licensed", Interval = "month" }, }; var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` Fügen Sie dem Produkt dann einen nutzungsbasierten Preis mit einer gestaffelten Rate mit zwei Stufen hinzu. Für die erste Stufe geben Sie 0 bis 100.000 Einheiten zu 200 USD an. Für die zweite Stufe legen Sie 0.001 USD pro Einheit fest. Die erste Stufe hat einen Preis von 0 USD, da der Pauschalpreis die ersten 100.000 Einheiten bereits abdeckt. ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d product={{PRODUCT_ID}} \ -d currency=usd \ -d billing_scheme=tiered \ -d "recurring[usage_type]"=metered \ -d "recurring[interval]"=month \ -d "recurring[meter]"={{METER_ID}} \ -d tiers_mode=graduated \ -d "tiers[0][up_to]"=100000 \ -d "tiers[0][unit_amount_decimal]"=0 \ -d "tiers[1][up_to]"=inf \ -d "tiers[1][unit_amount_decimal]"="0.1" ``` ```cli stripe prices create \ --product={{PRODUCT_ID}} \ --currency=usd \ --billing-scheme=tiered \ -d "recurring[usage_type]"=metered \ -d "recurring[interval]"=month \ -d "recurring[meter]"={{METER_ID}} \ --tiers-mode=graduated \ -d "tiers[0][up_to]"=100000 \ -d "tiers[0][unit_amount_decimal]"=0 \ -d "tiers[1][up_to]"=inf \ -d "tiers[1][unit_amount_decimal]"=0.1 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") price = client.v1.prices.create({ product: '{{PRODUCT_ID}}', currency: 'usd', billing_scheme: 'tiered', recurring: { usage_type: 'metered', interval: 'month', meter: '{{METER_ID}}', }, tiers_mode: 'graduated', tiers: [ { up_to: 100000, unit_amount_decimal: 0, }, { up_to: 'inf', unit_amount_decimal: 0.1, }, ], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. price = client.v1.prices.create({ "product": "{{PRODUCT_ID}}", "currency": "usd", "billing_scheme": "tiered", "recurring": {"usage_type": "metered", "interval": "month", "meter": "{{METER_ID}}"}, "tiers_mode": "graduated", "tiers": [ {"up_to": 100000, "unit_amount_decimal": "0"}, {"up_to": "inf", "unit_amount_decimal": "0.1"}, ], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $price = $stripe->prices->create([ 'product' => '{{PRODUCT_ID}}', 'currency' => 'usd', 'billing_scheme' => 'tiered', 'recurring' => [ 'usage_type' => 'metered', 'interval' => 'month', 'meter' => '{{METER_ID}}', ], 'tiers_mode' => 'graduated', 'tiers' => [ [ 'up_to' => 100000, 'unit_amount_decimal' => '0', ], [ 'up_to' => 'inf', 'unit_amount_decimal' => '0.1', ], ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); PriceCreateParams params = PriceCreateParams.builder() .setProduct("{{PRODUCT_ID}}") .setCurrency("usd") .setBillingScheme(PriceCreateParams.BillingScheme.TIERED) .setRecurring( PriceCreateParams.Recurring.builder() .setUsageType(PriceCreateParams.Recurring.UsageType.METERED) .setInterval(PriceCreateParams.Recurring.Interval.MONTH) .build() ) .setTiersMode(PriceCreateParams.TiersMode.GRADUATED) .addTier( PriceCreateParams.Tier.builder() .setUpTo(100000L) .setUnitAmountDecimal(new BigDecimal("0")) .build() ) .addTier( PriceCreateParams.Tier.builder() .setUpTo(PriceCreateParams.Tier.UpTo.INF) .setUnitAmountDecimal(new BigDecimal("0.1")) .build() ) .putExtraParam("recurring[meter]", "{{METER_ID}}") .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Price price = client.v1().prices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const price = await stripe.prices.create({ product: '{{PRODUCT_ID}}', currency: 'usd', billing_scheme: 'tiered', recurring: { usage_type: 'metered', interval: 'month', meter: '{{METER_ID}}', }, tiers_mode: 'graduated', tiers: [ { up_to: 100000, unit_amount_decimal: '0', }, { up_to: 'inf', unit_amount_decimal: '0.1', }, ], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.PriceCreateParams{ Product: stripe.String("{{PRODUCT_ID}}"), Currency: stripe.String(stripe.CurrencyUSD), BillingScheme: stripe.String(stripe.PriceBillingSchemeTiered), Recurring: &stripe.PriceCreateRecurringParams{ UsageType: stripe.String(stripe.PriceRecurringUsageTypeMetered), Interval: stripe.String(stripe.PriceRecurringIntervalMonth), }, TiersMode: stripe.String(stripe.PriceTiersModeGraduated), Tiers: []*stripe.PriceCreateTierParams{ &stripe.PriceCreateTierParams{ UpTo: stripe.Int64(100000), UnitAmountDecimal: stripe.Float64(0), }, &stripe.PriceCreateTierParams{ UpToInf: stripe.String("inf"), UnitAmountDecimal: stripe.Float64(0.1), }, }, } params.AddExtra("recurring[meter]", "{{METER_ID}}") result, err := sc.V1Prices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new PriceCreateOptions { Product = "{{PRODUCT_ID}}", Currency = "usd", BillingScheme = "tiered", Recurring = new PriceRecurringOptions { UsageType = "metered", Interval = "month" }, TiersMode = "graduated", Tiers = new List { new PriceTierOptions { UpTo = 100000, UnitAmountDecimal = 0M }, new PriceTierOptions { UpTo = PriceTierUpTo.Inf, UnitAmountDecimal = 0.1M }, }, }; options.AddExtraParam("recurring[meter]", "{{METER_ID}}"); var client = new StripeClient("<>"); var service = client.V1.Prices; Price price = service.Create(options); ``` Schließlich geben Sie beim [Erstellen eines Abonnements](https://docs.stripe.com/billing/subscriptions/usage-based/implementation-guide.md#create-subscription) beide Preis-IDs an. ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d customer={{CUSTOMER_ID}} \ -d "items[0][price]"={{FLAT_MONTHLY_FEE_PRICE_ID}} \ -d "items[0][quantity]"=1 \ -d "items[1][price]"={{METERED_USAGE_PRICE_ID}} ``` ```cli stripe subscriptions create \ --customer={{CUSTOMER_ID}} \ -d "items[0][price]"={{FLAT_MONTHLY_FEE_PRICE_ID}} \ -d "items[0][quantity]"=1 \ -d "items[1][price]"={{METERED_USAGE_PRICE_ID}} ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") subscription = client.v1.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { price: '{{FLAT_MONTHLY_FEE_PRICE_ID}}', quantity: 1, }, {price: '{{METERED_USAGE_PRICE_ID}}'}, ], }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. subscription = client.v1.subscriptions.create({ "customer": "{{CUSTOMER_ID}}", "items": [ {"price": "{{FLAT_MONTHLY_FEE_PRICE_ID}}", "quantity": 1}, {"price": "{{METERED_USAGE_PRICE_ID}}"}, ], }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $subscription = $stripe->subscriptions->create([ 'customer' => '{{CUSTOMER_ID}}', 'items' => [ [ 'price' => '{{FLAT_MONTHLY_FEE_PRICE_ID}}', 'quantity' => 1, ], ['price' => '{{METERED_USAGE_PRICE_ID}}'], ], ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); SubscriptionCreateParams params = SubscriptionCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .addItem( SubscriptionCreateParams.Item.builder() .setPrice("{{FLAT_MONTHLY_FEE_PRICE_ID}}") .setQuantity(1L) .build() ) .addItem( SubscriptionCreateParams.Item.builder() .setPrice("{{METERED_USAGE_PRICE_ID}}") .build() ) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Subscription subscription = client.v1().subscriptions().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const subscription = await stripe.subscriptions.create({ customer: '{{CUSTOMER_ID}}', items: [ { price: '{{FLAT_MONTHLY_FEE_PRICE_ID}}', quantity: 1, }, { price: '{{METERED_USAGE_PRICE_ID}}', }, ], }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.SubscriptionCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Items: []*stripe.SubscriptionCreateItemParams{ &stripe.SubscriptionCreateItemParams{ Price: stripe.String("{{FLAT_MONTHLY_FEE_PRICE_ID}}"), Quantity: stripe.Int64(1), }, &stripe.SubscriptionCreateItemParams{ Price: stripe.String("{{METERED_USAGE_PRICE_ID}}"), }, }, } result, err := sc.V1Subscriptions.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new SubscriptionCreateOptions { Customer = "{{CUSTOMER_ID}}", Items = new List { new SubscriptionItemOptions { Price = "{{FLAT_MONTHLY_FEE_PRICE_ID}}", Quantity = 1, }, new SubscriptionItemOptions { Price = "{{METERED_USAGE_PRICE_ID}}" }, }, }; var client = new StripeClient("<>"); var service = client.V1.Subscriptions; Subscription subscription = service.Create(options); ``` ### Pay-As-You-Go Mit dem Pay-As-You-Go-Modell (auch als „rückwirkende Abrechnung“ bezeichnet) können Sie die über einen bestimmten Zeitraum angefallene Nutzung verfolgen und den Kundinnen/Kunden am Ende dieses Zeitraums die Kosten abbuchen. Sie können jede der folgenden Preisstrategien verwenden: - **Pro Einheit**: Berechnen Sie für jede Einheit den gleichen Betrag. - **Pro Paket**: Berechnen Sie einen Betrag für ein Paket oder Bundle von Einheiten oder für die Nutzung. - **Volumenbasierte Preisgestaltung**: Berechnen Sie den Abonnement-Artikel zu der Stufe, die der Nutzungsmenge am Ende des Zeitraums entspricht. - **Gestaffelte Preisgestaltung**: Berechnen Sie die Nutzung in jeder Stufe, anstatt einen einzigen Preis auf die gesamte Nutzung anzuwenden. Dieses Modell kann dazu führen, dass Kundinnen/Kunden sie in erheblichem Umfang nutzen, was sich auf den Status ihrer Zahlungsmethode am Monatsende auswirkt. ### Vorauszahlung/Gutschrift Das Modell mit Aufbrauchen von Guthaben erlaubt Ihnen, eine Vorauszahlung für nutzungsbasierte Produkte und Dienstleistungen einzuziehen. Kundinnen und Kunden können [Abrechnungsgutschriften](https://docs.stripe.com/billing/subscriptions/usage-based/billing-credits.md) verwenden, um einen anfänglichen Betrag zu zahlen, und ihre Abrechnungsgutschrift dann bei der Nutzung des Produkts anwenden. Beispielsweise möchte Hypernian einen großen Unternehmenskundenvertrag für ihr neues Hypernian-Modell an einen bestehenden Self-Service-Kunden verkaufen. Der Kunde verpflichtet sich, 100000 USD im Voraus für Hypernian zu zahlen, damit er 120000 USD an Abrechnungsguthaben innerhalb eines Jahres nutzen kann. #### Dashboard #### Vorauszahlung von Kundin/Kunde einziehen 1. Klicken Sie auf der Seite [Rechnungen](https://dashboard.stripe.com/invoices) auf **Rechnung erstellen**. 1. Wählen Sie Ihren Kunden/Ihre Kundin aus der Dropdown-Liste **Kunde/Kundin** aus. 1. Wählen Sie die richtige Währung aus dem Dropdown-Menü **Währung**. 1. Wählen Sie unter **Artikel** die Option **Neuen Posten hinzufügen** aus. 1. Führen Sie unter **Postendetails** die folgenden Schritte aus: - Geben Sie als **Posten** „Hypernian Credits“ ein. - Geben Sie für **Preis** den Wert „100.000“ ein. - Klicken Sie auf **Speichern**. 1. Klicken Sie auf **Rechnung senden**. Nachdem Ihr Kunde/Ihre Kundin die Rechnung bezahlt hat, können Sie ihm/ihr Abrechnungsguthaben gewähren. #### Einem Kunden/Einer Kundin Abrechnungsgutschriften gewähren 1. Wählen Sie auf der Seite [Kundinnen/Kunden](https://dashboard.stripe.com/test/customers) den Namen der Kundin/des Kunden aus. 1. Klicken Sie auf der Kundenseite unter **Gewährung von Gutschriften** auf das Plussymbol (**+**). 1. Gehen Sie auf der Seite **Neue Gutschrift** wie folgt vor: - Geben Sie unter **Name** einen Namen für Ihre gewährte Gutschrift ein. - Geben Sie unter **Betrag** den Betrag der Gutschriftgewährung an. Geben Sie für das Hypernian-Beispiel „120,000“ ein. - Geben Sie unter **Ablaufdatum** an, falls vorhanden, wann die Gutschriften verfallen. Im Hypernian-Beispiel wählen Sie **bestimmtes Datum** und legen ein Datum 12 Monate ab jetzt fest. - Klicken Sie auf **Gutschrift erstellen**. #### API Erstellen Sie als Erstes eine Rechnung. ```curl curl https://api.stripe.com/v1/invoices \ -u "<>:" \ -d description="Hypernian Credits" \ -d customer={{CUSTOMER_ID}} \ -d collection_method=charge_automatically ``` ```cli stripe invoices create \ --description="Hypernian Credits" \ --customer={{CUSTOMER_ID}} \ --collection-method=charge_automatically ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") invoice = client.v1.invoices.create({ description: 'Hypernian Credits', customer: '{{CUSTOMER_ID}}', collection_method: 'charge_automatically', }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. invoice = client.v1.invoices.create({ "description": "Hypernian Credits", "customer": "{{CUSTOMER_ID}}", "collection_method": "charge_automatically", }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->create([ 'description' => 'Hypernian Credits', 'customer' => '{{CUSTOMER_ID}}', 'collection_method' => 'charge_automatically', ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); InvoiceCreateParams params = InvoiceCreateParams.builder() .setDescription("Hypernian Credits") .setCustomer("{{CUSTOMER_ID}}") .setCollectionMethod(InvoiceCreateParams.CollectionMethod.CHARGE_AUTOMATICALLY) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Invoice invoice = client.v1().invoices().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.create({ description: 'Hypernian Credits', customer: '{{CUSTOMER_ID}}', collection_method: 'charge_automatically', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.InvoiceCreateParams{ Description: stripe.String("Hypernian Credits"), Customer: stripe.String("{{CUSTOMER_ID}}"), CollectionMethod: stripe.String(stripe.InvoiceCollectionMethodChargeAutomatically), } result, err := sc.V1Invoices.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new InvoiceCreateOptions { Description = "Hypernian Credits", Customer = "{{CUSTOMER_ID}}", CollectionMethod = "charge_automatically", }; var client = new StripeClient("<>"); var service = client.V1.Invoices; Invoice invoice = service.Create(options); ``` Fügen Sie als Nächstes die Abrechnungsgutschriften zur Rechnung hinzu. ```curl curl https://api.stripe.com/v1/invoiceitems \ -u "<>:" \ -d customer={{CUSTOMER_ID}} \ -d currency=usd \ -d unit_amount_decimal=10000000 ``` ```cli stripe invoiceitems create \ --customer={{CUSTOMER_ID}} \ --currency=usd \ --unit-amount-decimal=10000000 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") invoice_item = client.v1.invoice_items.create({ customer: '{{CUSTOMER_ID}}', currency: 'usd', unit_amount_decimal: '10000000', }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. invoice_item = client.v1.invoice_items.create({ "customer": "{{CUSTOMER_ID}}", "currency": "usd", "unit_amount_decimal": "10000000", }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $invoiceItem = $stripe->invoiceItems->create([ 'customer' => '{{CUSTOMER_ID}}', 'currency' => 'usd', 'unit_amount_decimal' => '10000000', ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); InvoiceItemCreateParams params = InvoiceItemCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setCurrency("usd") .setUnitAmountDecimal(new BigDecimal("10000000")) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. InvoiceItem invoiceItem = client.v1().invoiceItems().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const invoiceItem = await stripe.invoiceItems.create({ customer: '{{CUSTOMER_ID}}', currency: 'usd', unit_amount_decimal: '10000000', }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.InvoiceItemCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Currency: stripe.String(stripe.CurrencyUSD), UnitAmountDecimal: stripe.Float64(10000000), } result, err := sc.V1InvoiceItems.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new InvoiceItemCreateOptions { Customer = "{{CUSTOMER_ID}}", Currency = "usd", UnitAmountDecimal = 10000000M, }; var client = new StripeClient("<>"); var service = client.V1.InvoiceItems; InvoiceItem invoiceItem = service.Create(options); ``` Finalisieren Sie dann die Rechnung. ```curl curl https://api.stripe.com/v1/invoices/{{INVOICE_ID}}/finalize \ -u "<>:" \ -d auto_advance=true ``` ```cli stripe invoices finalize_invoice {{INVOICE_ID}} \ --auto-advance=true ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") invoice = client.v1.invoices.finalize_invoice('{{INVOICE_ID}}', {auto_advance: true}) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. invoice = client.v1.invoices.finalize_invoice( "{{INVOICE_ID}}", {"auto_advance": True}, ) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $invoice = $stripe->invoices->finalizeInvoice('{{INVOICE_ID}}', ['auto_advance' => true]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); InvoiceFinalizeInvoiceParams params = InvoiceFinalizeInvoiceParams.builder().setAutoAdvance(true).build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. Invoice invoice = client.v1().invoices().finalizeInvoice("{{INVOICE_ID}}", params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const invoice = await stripe.invoices.finalizeInvoice( '{{INVOICE_ID}}', { auto_advance: true, } ); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.InvoiceFinalizeInvoiceParams{AutoAdvance: stripe.Bool(true)} result, err := sc.V1Invoices.FinalizeInvoice(context.TODO(), "{{INVOICE_ID}}", params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new InvoiceFinalizeOptions { AutoAdvance = true }; var client = new StripeClient("<>"); var service = client.V1.Invoices; Invoice invoice = service.FinalizeInvoice("{{INVOICE_ID}}", options); ``` Nachdem Ihr Kunde/Ihre Kundin die Rechnung bezahlt hat, können Sie ihm/ihr Abrechnungsguthaben gewähren. ```curl curl https://api.stripe.com/v1/billing/credit_grants \ -u "<>:" \ -d customer={{CUSTOMER_ID}} \ -d category=paid \ -d "amount[type]"=monetary \ -d "amount[monetary][value]"=12000000 \ -d "amount[monetary][currency]"=usd \ -d "applicability_config[scope][price_type]"=metered \ -d expires_at=1759341179 ``` ```cli stripe billing credit_grants create \ --customer={{CUSTOMER_ID}} \ --category=paid \ -d "amount[type]"=monetary \ -d "amount[monetary][value]"=12000000 \ -d "amount[monetary][currency]"=usd \ -d "applicability_config[scope][price_type]"=metered \ --expires-at=1759341179 ``` ```ruby # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = Stripe::StripeClient.new("<>") credit_grant = client.v1.billing.credit_grants.create({ customer: '{{CUSTOMER_ID}}', category: 'paid', amount: { type: 'monetary', monetary: { value: 12000000, currency: 'usd', }, }, applicability_config: {scope: {price_type: 'metered'}}, expires_at: 1759341179, }) ``` ```python # Set your secret key. Remember to switch to your live secret key in production. # See your keys here: https://dashboard.stripe.com/apikeys client = StripeClient("<>") # For SDK versions 12.4.0 or lower, remove '.v1' from the following line. credit_grant = client.v1.billing.credit_grants.create({ "customer": "{{CUSTOMER_ID}}", "category": "paid", "amount": {"type": "monetary", "monetary": {"value": 12000000, "currency": "usd"}}, "applicability_config": {"scope": {"price_type": "metered"}}, "expires_at": 1759341179, }) ``` ```php // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys $stripe = new \Stripe\StripeClient('<>'); $creditGrant = $stripe->billing->creditGrants->create([ 'customer' => '{{CUSTOMER_ID}}', 'category' => 'paid', 'amount' => [ 'type' => 'monetary', 'monetary' => [ 'value' => 12000000, 'currency' => 'usd', ], ], 'applicability_config' => ['scope' => ['price_type' => 'metered']], 'expires_at' => 1759341179, ]); ``` ```java // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys StripeClient client = new StripeClient("<>"); CreditGrantCreateParams params = CreditGrantCreateParams.builder() .setCustomer("{{CUSTOMER_ID}}") .setCategory(CreditGrantCreateParams.Category.PAID) .setAmount( CreditGrantCreateParams.Amount.builder() .setType(CreditGrantCreateParams.Amount.Type.MONETARY) .setMonetary( CreditGrantCreateParams.Amount.Monetary.builder() .setValue(12000000L) .setCurrency("usd") .build() ) .build() ) .setApplicabilityConfig( CreditGrantCreateParams.ApplicabilityConfig.builder() .setScope( CreditGrantCreateParams.ApplicabilityConfig.Scope.builder() .setPriceType( CreditGrantCreateParams.ApplicabilityConfig.Scope.PriceType.METERED ) .build() ) .build() ) .setExpiresAt(1759341179L) .build(); // For SDK versions 29.4.0 or lower, remove '.v1()' from the following line. CreditGrant creditGrant = client.v1().billing().creditGrants().create(params); ``` ```node // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys const stripe = require('stripe')('<>'); const creditGrant = await stripe.billing.creditGrants.create({ customer: '{{CUSTOMER_ID}}', category: 'paid', amount: { type: 'monetary', monetary: { value: 12000000, currency: 'usd', }, }, applicability_config: { scope: { price_type: 'metered', }, }, expires_at: 1759341179, }); ``` ```go // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys sc := stripe.NewClient("<>") params := &stripe.BillingCreditGrantCreateParams{ Customer: stripe.String("{{CUSTOMER_ID}}"), Category: stripe.String(stripe.BillingCreditGrantCategoryPaid), Amount: &stripe.BillingCreditGrantCreateAmountParams{ Type: stripe.String("monetary"), Monetary: &stripe.BillingCreditGrantCreateAmountMonetaryParams{ Value: stripe.Int64(12000000), Currency: stripe.String(stripe.CurrencyUSD), }, }, ApplicabilityConfig: &stripe.BillingCreditGrantCreateApplicabilityConfigParams{ Scope: &stripe.BillingCreditGrantCreateApplicabilityConfigScopeParams{ PriceType: stripe.String("metered"), }, }, ExpiresAt: stripe.Int64(1759341179), } result, err := sc.V1BillingCreditGrants.Create(context.TODO(), params) ``` ```dotnet // Set your secret key. Remember to switch to your live secret key in production. // See your keys here: https://dashboard.stripe.com/apikeys var options = new Stripe.Billing.CreditGrantCreateOptions { Customer = "{{CUSTOMER_ID}}", Category = "paid", Amount = new Stripe.Billing.CreditGrantAmountOptions { Type = "monetary", Monetary = new Stripe.Billing.CreditGrantAmountMonetaryOptions { Value = 12000000, Currency = "usd", }, }, ApplicabilityConfig = new Stripe.Billing.CreditGrantApplicabilityConfigOptions { Scope = new Stripe.Billing.CreditGrantApplicabilityConfigScopeOptions { PriceType = "metered", }, }, ExpiresAt = DateTimeOffset.FromUnixTimeSeconds(1759341179).UtcDateTime, }; var client = new StripeClient("<>"); var service = client.V1.Billing.CreditGrants; Stripe.Billing.CreditGrant creditGrant = service.Create(options); ``` ## See also - [Vorgefertigte Abonnementseite mit Stripe Checkout](https://docs.stripe.com/billing/quickstart.md) - [Abonnement-Integration erstellen](https://docs.stripe.com/billing/subscriptions/build-subscriptions.md) - [Preistabelle einbetten](https://docs.stripe.com/payments/checkout/pricing-table.md)