コンテンツにスキップ
アカウントを作成
または
サインイン
Stripe ドキュメントのロゴ
/
AI に質問する
アカウントを作成
サインイン
始める
支払い
売上
プラットフォームおよびマーケットプレイス
資金管理
開発者向けリソース
概要
Stripe Payments について
構築済みのシステムをアップグレード
支払いの分析
オンライン決済
概要ユースケースを見つけるUse Managed Payments
Payment Links を使用する
構築済みの決済ページを使用する
Build a custom integration with Elements
    概要
    Compare Checkout Sessions and PaymentIntents
    Quickstart guides
    高度なシステムを設計
    デザインをカスタマイズする
    決済手段を管理
    追加情報を収集する
    サブスクリプションの実装
    Dynamic updates
    割引を追加する
    支払いで税金を徴収
    顧客が現地通貨で支払いできるようにする
    顧客の支払い方法を保存および取得する
    領収書と支払い済みの請求書を送信する
    サーバーで支払いを手動で承認する
    支払いのオーソリとキャプチャーを分離する
    Elements with Checkout Sessions API ベータ版の変更ログ
アプリ内実装を構築
決済手段
決済手段を追加
決済手段を管理
Link による購入の迅速化
支払いインターフェイス
Payment Links
Checkout
Web Elements
アプリ内決済
決済シナリオ
複数の通貨を扱う
カスタムの決済フロー
柔軟なアクワイアリング
オーケストレーション
店頭支払い
端末
決済にとどまらない機能
会社を設立する
仮想通貨
Financial Connections
Climate
不正利用について
Radar の不正防止
不審請求の申請の管理
本人確認
ホーム支払いBuild a custom integration with Elements

注

このページはまだ日本語ではご利用いただけません。より多くの言語で文書が閲覧できるように現在取り組んでいます。準備が整い次第、翻訳版を提供いたしますので、もう少しお待ちください。

Add discounts

Learn how to apply discounts with coupons and promotion codes in your custom integration.

You can use discounts to reduce the amount charged to a customer. Coupons and promotion codes allow you to:

  • Apply a discount to an entire purchase subtotal
  • Apply a discount to specific products
  • Reduce the total charged by a percentage or a flat amount
  • Create customer-facing promotion codes on top of coupons to share directly with customers

クーポンを作成する

クーポンは固定額の割引を指定します。1 つのベースとなるクーポンにマッピングされる、顧客向けのプロモーションコードを作成できます。つまり、FALLPROMO と SPRINGPROMO の両方のコードを 1 つの 25% 割引のクーポンに関連付けることができます。クーポンは、ダッシュボードまたは API で作成できます。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/coupons \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d percent_off=20 \ -d duration=once

Use a coupon

To create a session with an applied discount, pass the coupon ID in the coupon parameter of the discounts array. Checkout Sessions support up to one coupon or promotion code.

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

Configure a coupon

Coupons have the following parameters that you can use:

  • currency
  • percent_off or amount_off
  • max_redemptions
  • redeem_by: The latest date customers can apply the coupon
  • applies_to: Limits the products that the coupon applies to

Limit redemption usage

The max_redemptions and redeem_by values apply to the coupon across every application. For example, you can restrict a coupon to the first 50 usages of it, or you can make a coupon expire by a certain date.

Limit eligible products

You can limit the products that are eligible for discounts using a coupon by adding the product IDs to the applies_to hash in the Coupon object. Any promotion codes that map to this coupon only apply to the list of eligible products.

Delete a coupon

You can delete coupons in the Dashboard or the API. Deleting a coupon prevents it from being applied to future transactions or customers.

プロモーションコードを作成する

プロモーションコードは、クーポンに加えて作成される顧客向けのコードです。また、顧客がプロモーションを適用できる期間を管理する追加の制限を指定することもできます。これらのコードは顧客に伝えることができ、顧客が購入時に入力すると割引の適用を受けることができます。

promotion code (プロモーションコード) を作成するには、既存の coupon と制限 (たとえば、特定の customer に制限するなど) を指定します。顧客に提供したい特定のコードがある場合には (FALL25OFF など)、code を設定します。このフィールドを空白にすると、ランダムな code が生成されます。

この code では大文字小文字が区別され、すべての顧客向けの有効なプロモーションコードの中で一意になります。以下に例を挙げます。

  • 同じ code を使用して、対象の顧客が制限された複数のプロモーションコードを作成できますが、その code を再利用して、すべての顧客が引き換えできるプロモーションコードを作成することはできません。
  • あらゆる顧客が引き換え可能なプロモーションコードを作成する場合、同じ code で別の有効なプロモーションコードを作成することはできません。
  • code: NEWUSER でプロモーションコードを作成し、active: false を渡してそれを無効化してから、code: NEWUSER で新しいプロモーションコードを作成できます。

プロモーションコードは、ダッシュボードのクーポンセクションまたは API で作成できます。

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/promotion_codes \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d coupon={{COUPON_ID}} \ -d code=VIPCODE

Use a promotion code

On your server, enable customer-redeemable promotion codes using the allow_promotion_codes parameter in a Checkout Session.

Command Line
cURL
Stripe CLI
Ruby
Python
PHP
Java
Node.js
Go
.NET
No results
curl https://api.stripe.com/v1/checkout/sessions \ -u "
sk_test_BQokikJOvBiI2HlWgH4olfQ2
:"
\ -d "line_items[0][price_data][unit_amount]"=2000 \ -d "line_items[0][price_data][product_data][name]"=T-shirt \ -d "line_items[0][price_data][currency]"=usd \ -d "line_items[0][quantity]"=1 \ -d mode=payment \ -d ui_mode=custom \ -d allow_promotion_codes=true \ --data-urlencode return_url="https://example.com/checkout/return"

On your client, use applyPromotionCode to apply a promotion code that your customer enters. Use removePromotionCode to remove all previously applied promotion codes.

index.html
<input type="text" id="promotion-code" /> <button id="apply-promotion-code">Apply</button> <button id="remove-promotion-codes">Remove</button> <div id="promotion-code-error"></div>
checkout.js
stripe.initCheckout({fetchClientSecret}).then((checkout) => { const input = document.getElementById('promotion-code'); document.getElementById('apply-promotion-code').addEventListener('click', () => { checkout.applyPromotionCode(input.value).then((result) => { if (result.error) { // Display an error message document.getElementById('promotion-code-error').textContent = result.error.message; } else { // Clear the input if the promotion code was successfully applied input.value = ''; } }); }); document.getElementById('remove-promotion-codes').addEventListener('click', () => { checkout.removePromotionCode(); }); });

プロモーションコードを設定する

プロモーションコードごとに、対象の顧客、引き換え回数、その他の制限をカスタマイズできます。

特定の顧客に限定する

プロモーションを特定の顧客に限定するには、プロモーションコードを作成する際に customer (顧客) を指定します。顧客が指定されていない場合、すべての顧客がコードを引き換えることができます。

初回注文に限定する

また、restrictions.first_time_transaction を使用して、プロモーションコードを初めての顧客のみに限定することもできます。customer が定義されていない場合、または定義された customer が過去に支払いをしたことがない場合や、無効化されていないインボイスがない場合は、初回の取引とみなされます。

注

セッションで Customer (顧客) が作成されない場合、代わりにゲスト顧客がダッシュボードに作成されます。新規の顧客に限定されたプロモーションコードも、これらのセッションでは受け付けられます。

最低金額を設定する

プロモーションコードでは、minimum_amount と minimum_amount_currency を設定して、割引対象の最低取引額を設定できます。プロモーションコードの制限は引き換え時に確認されるため、最低取引額はサブスクリプションの初回の支払いにのみ適用されます。

有効期限をカスタマイズする

expires_at を使用してプロモーションコードの有効期限を設定できます。ベースとなるクーポンにすでに redeem_by が設定されている場合には、プロモーションコードの期限をクーポンの期日よりも後にすることはできません。promotion_code[expires_at] が指定されていない場合は、クーポンの redeem_by が自動的に expires_at となります。

たとえば、クーポンを 1 年間サポートするプランがあり、引き換え期間を顧客がクーポンを受け取ってから 1 週間以内にするとします。その場合、coupon[redeem_by] を現在から 1 年後にし、各 promotion_code[expires_at] を作成日の 1 週間後に設定できます。

引き換え回数を制限する

max_redemptions を使用して引き換え回数を制限できます。これは coupon パラメーターと同様に機能します。ベースとなるクーポンにすでに max_redemptions が設定されている場合、プロモーションコードの max_redemptions をクーポンの上限値より大きくすることはできません。

たとえば、シーズンセールのクーポンの引き換えを先着 50 人の顧客に制限する一方で、冬のプロモーションで引き換えを利用できる対象を 20 人のみにすることができます。このシナリオでは、coupon[max_redemptions]: 50 および promotion_code[max_redemptions]: 20 を設定できます。

無効なプロモーション

active パラメーターを使用して、プロモーションコードが現在引き換え可能かどうかを設定できます。ただし、プロモーションのベースとなるクーポンが無効になると、そのプロモーションコードはすべて永久に無効になります。同様に、プロモーションコードが max_redemptions や expires_at に達した場合にも、永久に無効になります。これらのプロモーションコードを再度有効にすることはできません。

プロモーションを削除する

ダッシュボードまたは API を使用して、プロモーションを削除できます。プロモーションを削除すると、そのプロモーションは今後の取引や顧客に適用できなくなります。

このページはお役に立ちましたか。
はいいいえ
  • お困りのことがございましたら 、サポートにお問い合わせください。
  • 早期アクセスプログラムにご参加ください。
  • 変更ログをご覧ください。
  • ご不明な点がございましたら、お問い合わせください。
  • LLM ですか?llms.txt を読んでください。
  • Powered by Markdoc