0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Stripe初心者が知っておきたいStripe用語集(図あり)

Last updated at Posted at 2025-01-24

概要

実装を経て理解が深まったので、Stripeの用語をまとめおきます。

対象者

  • StripeAPIで開発を始めようとしている
  • Stripeの用語をさらっと知りたい

紹介する用語

Customers

  • 顧客は、Userを作る時に同時作成しておいて良いぐらい必要性が高いです。
  • 価格を管理するIDプレフィックス「cus_xxxxxxxx」で管理されます。

Coupon

  • クーポンは、発行時に「どの商品にどんな割引をするか。」を決めます。
  • クーポンは、顧客に紐づけて顧客に適用します。
  • クーポンを管理するIDは、自動採番もしくは自分で付けることが出来ます。

CustomersとCouponの関係

  • 現在の認識では、クーポンはカスタマーに1つしか紐づけ出来ません。

1対1

stripe.customer.coupon.png

Products

  • 商品カタログは、商品です。
  • 商品カタログは、Pricesを配下に持つため商品カタログの下に複数のPricesがあることがあり得ます。
  • 商品カタログを管理するIDプレフィックス「prod_xxxxxxxx」で管理されます。

Prices

  • 価格は、商品カタログの配下です。商品カタログがなくて、価格があるは起きません。
  • 価格を管理するIDプレフィックス「price_xxxxxxxx」で管理されます。
  • 実装時は「prod_xxxxxxxx」よりも「price_xxxxxxxx」を指定してサブスクリプションを作成しました。

ProductsとPricesの関係

  • 1対1、1対多 どちらも有り得ます。

1対1

stripe.products.price.png

1対多

stripe.prodcuts_prices.png

Subscriptions

  • サブスクリプションは、主に課金周期を管理します。
  • サブスクリプションを管理するIDプレフィックス「sub_xxxxxxxx」で管理され、
    サブスクリプションの開始・終了に合わせて作成・削除されます。
  • 「サブスクリプション = 課金周期」のイメージで頭に置いてます。

SubscriptionItems

  • サブスクリプションアイテムは、Products配下のPricesを基に生成されます。
  • サブスクリプションを作成する時にPricesを紐づける時、名前が変わるイメージです。
  • サブスクリプションアイテムを管理するIDプレフィックス「si_xxxxxxxx」で管理され、サブスクリプションアイテムの「数量を変える・削除する」などをすることで課金周期を変更せずに定期的な課金を続けることが出来ます。
  • 「サブスクリプションアイテム = 契約内容」のイメージで頭に置いてます。

SubscriptionsとSubscriptionItemsの関係

  • サブスクリプションの中に、サブスクリプションアイテムが配置されます。逆はありません。
  • サブスクリプションを解約すると、中のサブスクリプションアイテムを指定せずとも紐づいているすべてのサブスクリプションアイテムが解約となります。

1対1

subscription_subitem.png

1対多

subscription.subscriptionitems.png

  • 顧客にクーポンとサブスクリプション2つ。
  • サブスクリプションの中身は、1対1と1対多

stripe.example.png

一言

  • StripeのTaxIDには気をつけなはれや。
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?