# 決済フォームへのリンクを作成する コードなしでカスタムの決済ページを作成します。 [Stripe ダッシュボード](https://dashboard.stripe.com/payment-links/create)を使用して、顧客と[共有](https://docs.stripe.com/payment-links/share.md)できる決済用の URL リンクを作成します。顧客は、このリンクを開くと、Stripe がオンラインで提供する決済ページにリダイレクトされます。 ## 始める 開始する前に、お客様に最適な料金体系モデルを決定します。 - **商品またはサブスクリプション**: 商品を固定価格で販売する E コマースまたは SaaS に最適です。 - **顧客が支払い金額を選択する**: 寄付、チップ、または Pay What You Want (買い手が価格を決める) 方式の支払いに最適です。現在この料金モデルは、継続支払いや継続的な寄付に対応していません。[チップや寄付の受け付け](https://support.stripe.com/questions/requirements-for-accepting-tips-or-donations)に関する要件について、詳細をご確認ください。 #### 商品またはサブスクリプション 商品またはサブスクリプションを作成する場合は、次の手順を実行して決済用の URL リンクを作成します。 1. ダッシュボードで [Payment Links](https://dashboard.stripe.com/payment-links/create/standard-pricing) ページを開き、**+新規**をクリックします (または、プラス記号 (+) をクリックして**決済用のリンク**を選択します)。 1. 既存の商品を選択するか、**+新しい商品を追加**をクリックします。 1. 新しく商品を追加する場合は、商品詳細を入力して**商品を追加**をクリックします。 1. **リンクを作成**をクリックします。 #### 顧客が支払い金額を選択する 顧客が支払い金額を選択できるようにする場合は、次の手順を実行して決済用の URL リンクを作成します。 1. ダッシュボードで [Payment Links](https://dashboard.stripe.com/payment-links/create/customer-chooses-pricing) ページを開き、**+新規**をクリックします (または、プラス記号 (+) をクリックして**決済用のリンク**を選択します)。 1. **顧客が支払う金額を選択する** を選び、タイトル、説明、画像を追加します。 1. (オプション) 推奨プリセット金額を設定します。 1. (オプション) 最小決済金額と最大決済金額を設定します。 デフォルトの 最大決済金額は 10,000.00 USD です。この上限の引き上げをご希望の場合は、[Stripe サポート](https://support.stripe.com)のフォームからお問い合わせください。 1. **リンクを作成**をクリックします。 ## Payment Links API を利用開始する [Payment Links API](https://docs.stripe.com/api/payment_links/payment_links.md) を使用して決済用リンクを作成できます。*Products* (Products represent what your business sells—whether that's a good or a service) と *Prices* (Prices define how much and how often to charge for products. This includes how much the product costs, what currency to use, and the interval if the price is for subscriptions) を使用して、商品またはサブスクリプションを販売できます。 #### 商品またはサブスクリプション Payment Links は、次の料金体系モデルをサポートしています。 - 継続利用商品 - [定額課金](https://docs.stripe.com/subscriptions/pricing-models/flat-rate-pricing.md) - [段階制](https://docs.stripe.com/subscriptions/pricing-models/tiered-pricing.md) - 1 回限りの商品 - [定額課金](https://docs.stripe.com/subscriptions/pricing-models/flat-rate-pricing.md) - [パッケージ料金](https://docs.stripe.com/billing/subscriptions/usage-based-legacy/pricing-models.md#package-standard-pricing) まず、[定額課金](https://docs.stripe.com/products-prices/pricing-models.md#flat-rate)の料金を使用して、固定額の商品またはサブスクリプションを作成します。 ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d currency=usd \ -d unit_amount=1000 \ -d "product={{PRODUCT_ID}}" ``` 次に、[line_items](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-line_items) を渡して決済用リンクを作成します。各項目には [price](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-line_items-price) と [quantity](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-line_items-quantity) が含まれます。定額料金のラインアイテムは 20 個まで追加できます。 ```curl curl https://api.stripe.com/v1/payment_links \ -u "<>:" \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1" ``` 決済用リンクの作成時に [price_data](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-line_items-price_data) を使用して商品と価格を作成できます。 ```curl curl https://api.stripe.com/v1/payment_links \ -u "<>:" \ -d "line_items[0][price_data][product_data][name]=T-shirt" \ -d "line_items[0][price_data][product_data][description]=This is a t-shirt" \ -d "line_items[0][price_data][currency]=usd" \ -d "line_items[0][price_data][unit_amount]=1000" \ -d "line_items[0][quantity]=1" ``` 決済用リンクを使用してサブスクリプションを作成するには、`line_items` に [type=recurring](https://docs.stripe.com/api/prices/object.md#price_object-type) を指定して価格を設定します。[subscription_data](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-subscription_data) を使用して、決済用リンクから作成されるサブスクリプション (トライアルを含む) の設定を指定します。 ```curl curl https://api.stripe.com/v1/payment_links \ -u "<>:" \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1" \ -d "subscription_data[trial_period_days]=7" ``` #### 顧客が価格を選択する まず、[変動料金](https://docs.stripe.com/products-prices/how-products-and-prices-work.md#variable-pricing)を設定して、顧客がチップ、寄付、または商品やサービスに対する支払い金額を自由に選択できるようにします。[チップまたは寄付を受け付ける](https://support.stripe.com/questions/requirements-for-accepting-tips-or-donations)ための要件の詳細をご確認ください。 ```curl curl https://api.stripe.com/v1/prices \ -u "<>:" \ -d currency=usd \ -d "custom_unit_amount[enabled]=true" \ -d "product={{PRODUCT_ID}}" ``` 次に、[line_items](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-line_items) を渡して決済用リンクを作成します。顧客が定義するの価格には、項目を 1 つ含めることができます。 ```curl curl https://api.stripe.com/v1/payment_links \ -u "<>:" \ -d "line_items[0][price_data][product_data][name]=T-shirt" \ -d "line_items[0][price_data][product_data][description]=This is a t-shirt" \ -d "line_items[0][price_data][currency]=usd" \ -d "line_items[0][price_data][unit_amount]=1000" \ -d "line_items[0][quantity]=1" ``` ## モバイルの Payment Links 商品またはサブスクリプションを作成している場合は、[Stripe ダッシュボード iOS アプリ](https://apps.apple.com/app/apple-store/id978516833?pt=91215812&ct=stripe-mobile-app-docs-plinks&mt=8)を使用して、モバイルデバイスで決済用の URL リンクを作成します。アプリで、**支払い** > **Payment Links** に移動して、決済用の URL リンクを作成します (または、作成アイコン (+) をクリックして**決済フォームへのリンク**を選択します)。iOS アプリは、現時点では顧客が支払い金額を選択するリンクの作成には対応していません。 ## 支払い方法を設定する [動的な決済手段](https://docs.stripe.com/payments/payment-methods/dynamic-payment-methods.md)を使用すると、Stripe は Apple Pay と Google Pay をはじめ、顧客に最適で互換性のある決済手段を表示します。Stripe は、特定の決済手段をデフォルトで有効にします。また、追加の決済手段を有効にする場合がありますが、その際は事前に通知します。[ダッシュボード](https://dashboard.stripe.com/settings/payment_methods)では、いつでも決済手段の有効と無効を切り替えることができます。[サポートされている決済手段](https://docs.stripe.com/payments/payment-methods/payment-method-support.md)と[決済手段のさまざまなタイプ](https://stripe.com/guides/payment-methods-guide)の詳細をご確認ください。 取引 ID を入力するか、注文金額と通貨を設定して、[ダッシュボード](https://dashboard.stripe.com/settings/payment_methods/review)で顧客に表示される支払い方法を確認できます。 別の決済手段を指定するには、API で決済用リンクを作成するときに [payment_method_types](https://docs.stripe.com/api/payment_links/payment_links/create.md#create_payment_link-payment_method_types) パラメーターを設定します。 ```curl curl https://api.stripe.com/v1/payment_links \ -u "<>:" \ -d "line_items[0][price]={{PRICE_ID}}" \ -d "line_items[0][quantity]=1" \ -d "payment_method_types[0]=card" \ -d "payment_method_types[1]=klarna" ``` 一部の決済手段 (口座振替や店舗支払いなど) では、決済の確定までに 2 ~ 14 日かかる場合があります。決済が完了したときに通知を送信するように [Webhook を設定](https://docs.stripe.com/checkout/fulfillment.md#create-payment-event-handler)して、フルフィルメントを開始できるようにします。 顧客がデバイスで Apple Pay または Google Pay オプションを有効にしている場合、それらのオプションが表示されます。顧客に表示される決済手段は、顧客が使用しているブラウザーによっても異なります。 #### Item 1 ## 顧客が現地通貨で支払えるようにする [Adaptive Pricing](https://docs.stripe.com/payments/currencies/localize-prices/adaptive-pricing.md) を使用すると、顧客は 150 カ国以上で現地通貨で決済できます。Adaptive Pricing では、Stripe は機械学習を使用して最も関連性の高い取引通貨を決定し、ローカライズされた価格を自動的に計算して、すべての通貨換算を処理します。Adaptive Pricing は Payment Links で常に有効になっています。 #### Item 2 ## See also - [決済用のリンクを共有する](https://docs.stripe.com/payment-links/share.md) - [決済用のリンクを追跡する](https://docs.stripe.com/payment-links/url-parameters.md)