Stripe のクーポンを同期する
Salesforce と Stripe 間で Stripe のクーポンを同期する方法をご紹介します。
The Stripe Billing app for Salesforce CPQ enables you to add configurable, stackable coupons to your Stripe subscriptions and subscription items synced from Salesforce. For example, you can offer your customers a one-time discount of 10% off or 50 USD off for the first 3 months of their subscription.
権限セットを割り当てる
クーポンを正しく動作させるには、注文を追加および同期する Salesforce ユーザーに Stripe Connector Coupon User 権限セットを割り当てる必要があります。権限セットにユーザーを追加するには、そのユーザーに Salesforce CPQ ライセンスが必要です。
Salesforce の注文または注文アイテムにクーポンを追加する
コネクターが表示する以下のカスタム Salesforce オブジェクトを組み合わせて使用し、Stripe のサブスクリプションに割引を追加できます。
Salesforce オブジェクト | 説明 |
---|---|
Quote Stripe Coupon | Stripe のクーポンを表す Salesforce オブジェクト。Quote Stripe Coupon には、Stripe クーポンに対応する 1 対 1 のフィールドマッピングが含まれます。 |
Quote Stripe Coupon Association | Quote Stripe Coupon を Quote に関連付けるために使用される Salesforce の連結オブジェクト。 |
Quote Line Stripe Coupon Association | Quote Stripe Coupon を Quote Line に関連付けるために使用される Salesforce の連結オブジェクト。 |
When a Salesforce order activates, the app:
- Salesforce の注文または注文アイテムに対応する
Quote Stripe Coupon
オブジェクトを特定する - 対応する Salesforce の注文または注文アイテムに
Quote Stripe Coupon
をシリアライズする - 各 Salesforce クーポン用の Stripe クーポンを作成 (または、可能な場合は再利用) する
- Stripe で作成されたサブスクリプションまたはサブスクリプションアイテムにクーポンを適用する
Stripe のクーポンを再利用する
複数の注文または注文アイテムが対応する Salesforce クーポンを再利用する場合、コネクターは既存の Stripe クーポンを再利用します。元の Salesforce クーポンを変更すると、新しい Stripe クーポンが作成されます。
クーポンのカスタムマッピング
他のネイティブの Salesforce オブジェクトと同様に、データマッパーを使用して Quote Stripe Coupon
をマッピングできます。デフォルトでは、Quote Stripe Coupon
は Stripe Coupon
への 1 対 1 のフィールドマッピングです。Quote Stripe Coupon
にカスタムメタデータを追加することもできます。
カスタム Apex トリガー
コネクターはカスタム Apex トリガーを使用して、after update
に Salesforce の注文で Quote_
をシリアライズします。Quote_
を変更するカスタムワークフローがある場合は、ワークフロー間の競合状態を避けるため、before update
にトリガーが発生するようにしてください。
多通貨への対応
If you enabled multi-currency and you specify an amount off for the coupon, the app maps the CurrencyIsoCode
on the Quote Stripe Coupon
to the equivalent Stripe currency during Stripe coupon creation.