# 継続支払いの税金を徴収する 継続支払いの税金を徴収および申告する方法をご紹介します。 継続支払いの税金を計算するために、Stripe は Stripe Tax と Tax Rate を提供します。 - **Stripe Tax**: 有料製品です。税率やルールを定義することなく取引の税金を自動的に計算します。手数料は、税金の計算と納付を登録している場所を 1 カ所以上追加した後にのみ適用されます。詳細は、[Stripe Tax](https://docs.stripe.com/tax.md) をご覧ください。 - **Tax Rates**: 無料の機能です。Checkout を使用した*請求書* (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)、*サブスクリプション* (A Subscription represents the product details associated with the plan that your customer subscribes to. Allows you to charge the customer on a recurring basis)、および 1 回限りの支払いに適用する税率を任意の数だけ定義できます。Stripe がお客様の代わりに税率を作成または管理することはありません。詳細については、[Tax Rates](https://docs.stripe.com/api/tax_rates.md) および[その使用方法](https://docs.stripe.com/billing/taxes/tax-rates.md)をご覧ください。 # Stripe Tax > This is a Stripe Tax for when tax-calculation is stripe-tax. View the full page at https://docs.stripe.com/billing/taxes/collect-taxes?tax-calculation=stripe-tax. Stripe Tax では、Stripe Billing の使用時に継続支払いの税額を計算できます。サブスクリプションを作成する前に顧客の所在地の詳細情報を使用して税額のプレビューを行い、顧客の支払い準備ができたら、Stripe Tax を有効にしてサブスクリプションを作成します。Stripe Tax はStripe Billing と連携し、設定された[料金モデル](https://docs.stripe.com/products-prices/pricing-models.md)、[比例配分 (日割り計算)](https://docs.stripe.com/billing/subscriptions/prorations.md)、[割引](https://docs.stripe.com/billing/subscriptions/coupons.md)、[トライアル](https://docs.stripe.com/billing/subscriptions/trials.md)などを使用して税金計算を自動的に処理します。 #### Customer v1 Customer v1 を使用した Stripe Tax と Billing の連携の概要を示す図。 (See full diagram at https://docs.stripe.com/billing/taxes/collect-taxes) このガイドでは、初めて Stripe Tax と Billing を設定することを前提としています。[既存のサブスクリプションを更新する](https://docs.stripe.com/tax/subscriptions/update.md)方法をご覧ください。 Stripe Checkout を使用して新しいサブスクリプションを作成する場合は、[Checkout セッションで税金を自動徴収する](https://docs.stripe.com/tax/checkout.md)方法をご確認ください。また、以下の短い動画もご覧いただけます。 [Watch on YouTube](https://www.youtube.com/watch?v=3QBRs4IfDNo) ## 税額と合計額を推計する [サーバー側] #### 住所収集前 顧客が初めて決済フローを使用する際は、住所情報をまだ取得していない可能性があります。この場合、[請求書のプレビューを作成](https://docs.stripe.com/api/invoices/create_preview.md)し、[customer_details.tax.ip_address](https://docs.stripe.com/api/invoices/create_preview.md#create_create_preview-customer_details-tax-ip_address) を設定して、Stripe が IP アドレスを使用して所在地を確認できるようにします。 > ほとんどの場合、Stripe は IP アドレスを物理的なエリアに対して解決できますが、その精度はさまざまで、顧客の実際の所在地を反映できていない場合もあります。初期の見積もり以外で顧客の IP アドレスに頼ってアドレスを判別することはお勧めしません。 ```curl curl https://api.stripe.com/v1/invoices/create_preview \ -u "<>:" \ -d "automatic_tax[enabled]"=true \ -d "customer_details[tax][ip_address]"={{IP_ADDRESS}} \ -d "subscription_details[items][0][price]"="{{PRICE_ID}}" ``` #### 住所収集後 顧客が住所の詳細情報を入力するときに、[customer_details.address](https://docs.stripe.com/api/invoices/create_preview.md#create_create_preview-customer_details-address) も設定します。配送先住所を収集する場合は、[customer_details.shipping](https://docs.stripe.com/api/invoices/create_preview.md#create_create_preview-customer_details-shipping) を使用します。 ```curl curl https://api.stripe.com/v1/invoices/create_preview \ -u "<>:" \ -d "automatic_tax[enabled]"=true \ -d "customer_details[address][line1]"={{LINE1}} \ -d "customer_details[address][line2]"={{LINE2}} \ -d "customer_details[address][city]"={{CITY}} \ -d "customer_details[address][state]"={{STATE}} \ -d "customer_details[address][postal_code]"={{POSTAL_CODE}} \ -d "customer_details[address][country]"={{COUNTRY}} \ -d "customer_details[tax][ip_address]"={{IP_ADDRESS}} \ -d "subscription_details[items][0][price]"="{{PRICE_ID}}" ``` 請求書の [automatic_tax.status](https://docs.stripe.com/api/invoices/object.md#invoice_object-automatic_tax-status) を確認します。ステータスが `requires_location_inputs` の場合は、住所の詳細情報が無効であるか、不備があります。この場合、顧客に住所情報の再入力や、正確な住所情報の提供を求めてください。 請求書の[total (合計)](https://docs.stripe.com/api/invoices/object.md#invoice_object-total) は顧客が支払う金額で、[tax (税金)](https://docs.stripe.com/api/invoices/object.md#invoice_object-tax) は請求書のすべての税金金額の合計です。税金の内訳については、[total_tax_amounts](https://docs.stripe.com/api/invoices/object.md#invoice_object-total_tax_amounts) をご覧ください。金額はすべてセント単位です。 > #### 税額ゼロ > > `tax` がゼロの場合は、顧客の所在地に税務登録があることを確認してください。[売上税、VAT、GST の登録](https://docs.stripe.com/tax/registering.md)方法と[税額ゼロとリバースチャージ](https://docs.stripe.com/tax/zero-tax.md)の詳細をご確認ください。 ## 顧客情報を収集する [クライアント側] 税額と合計額の見積もりができたら、配送先住所 (該当する場合)、請求先住所、支払い情報など、顧客情報の収集を開始します。Stripe Tax を使用する場合は、インテントなしで支払い情報を収集します。最初のステップは、[インテントのない Elements オブジェクトを作成](https://docs.stripe.com/js/elements_object/create_without_intent)することです。 ```javascript const stripe = Stripe("<>"); const elements = stripe.elements({ mode: 'subscription', currency: '{{CURRENCY}}', amount: {{TOTAL}}, // これは請求書の合計額です。 }); ``` 次に、[Address Element](https://docs.stripe.com/js/elements_object/create_address_element) と [Payment Element](https://docs.stripe.com/js/elements_object/create_payment_element) を作成し、その両方を[マウント](https://docs.stripe.com/js/element/mount)します。 ```javascript const addressElement = elements.create('address', { mode: 'billing' // or 'shipping', if you are shipping goods }); addressElement.mount('#address-element'); const paymentElementOptions = { layout: 'accordion'}; const paymentElement = elements.create('payment', paymentElementOptions); paymentElement.mount('#payment-element'); ``` その後、Address Element で[変更イベント](https://docs.stripe.com/js/element/events/on_change?type=paymentElement#element_on_change-event)をリッスンできます。住所が変更された場合は、税額と合計額を[再見積もり](https://docs.stripe.com/tax/subscriptions.md?estimate=after#estimate-taxes-total)します。 ```javascript addressElement.on('change', async function(event) { // Throttle your requests to avoid overloading your server or hitting // Stripe's rate limits. const { tax, total } = await updateEstimate(event.value.address); elements.update({ amount: total }); // Update your page to display the new tax and total to the user... }); ``` > 顧客が住所を入力すると、Address Element はキーストロークごとに `change` イベントを起動します。サーバーへの過負荷と Stripe の[レート制限](https://docs.stripe.com/rate-limits.md)への到達を回避するには、最後の `change` イベントの後、しばらく待ってから、税金と合計を推計しなおします。 ## 送信を処理する [クライアント側] 顧客がフォームを送信したら、[elements.submit()](https://docs.stripe.com/js/elements/submit) を呼び出してフォームのフィールドを検証し、ウォレットに必要なデータを収集します。この関数の Promise が解決されるのを待たないと、他の操作は実行できません。 ```javascript document.querySelector("#form").addEventListener("submit", async function(event) { // We don't want to let default form submission happen here, // which would refresh the page. event.preventDefault(); const { error: submitError } = await elements.submit(); if (submitError) { // Handle error... return; } const { value: customerDetails } = await addressElement.getValue(); // See the "Save customer details" section below to implement this // server-side. await saveCustomerDetails(customerDetails); // 顧客の詳細を保存するリクエストをサーバーに送信します。 // See the "Create subscription" section below to implement this server-side. const { clientSecret } = await createSubscription(); // 新しいサブスクリプションの latest_invoice.confirmation_secret.client_secret。 // サブスクリプションを作成するリクエストをサーバーに送信します。 const { error: confirmError } = await stripe.confirmPayment({ elements, clientSecret, confirmParams: { return_url: {{RETURN_URL}}, // 顧客が支払いを完了した後にリダイレクトされる URL。 }, }); if (confirmError) { // Handle error... return; } // Upon a successful confirmation, your user will be redirected to the // return_url you provide before the Promise ever resolves. }); ``` ## 顧客の情報を保存する [サーバー側] #### Customer v1 顧客から収集した詳細情報で `Customer` オブジェクトを[更新](https://docs.stripe.com/api/customers/update.md)して、Stripe Tax で位置を精密に判定し、正確な結果が得られるようにしてください。 > 顧客が米国にいる場合、可能な限り詳細な住所を提供してください。「ルーフトップ・アキュレート」という用語は、顧客の所在地を特定の家や建物まで特定できることを意味します。米国の税区割は非常に複雑で、同じ通りの隣り合った2軒の家であっても、境界線をまたぐことで適用される税率が異なる場合があります。詳細な住所を提供することで、より高い精度で税計算を行うことが可能になります。 `Customer` オブジェクトをまだ作成していない場合 (顧客がウェブサイトで初めて登録したときなど) は、ここで[作成](https://docs.stripe.com/api/customers/create.md)できます。 #### 顧客情報を更新する ```curl curl https://api.stripe.com/v1/customers/{{CUSTOMER_ID}} \ -u "<>:" \ -d "address[line1]"={{LINE1}} \ -d "address[line2]"={{LINE2}} \ -d "address[city]"={{CITY}} \ -d "address[state]"={{STATE}} \ -d "address[postal_code]"={{POSTAL_CODE}} \ -d "address[country]"={{COUNTRY}} \ -d "tax[validate_location]"=immediately ``` > 顧客に、税の自動計算が有効になっている別のサブスクリプションがある場合、住所情報を更新すると、今後発行する請求書の税額や合計金額が変わる可能性があります。これは、税率が顧客の所在地によって異なるためです。 #### 顧客を作成する ```curl curl https://api.stripe.com/v1/customers \ -u "<>:" \ -d "address[line1]"={{LINE1}} \ -d "address[line2]"={{LINE2}} \ -d "address[city]"={{CITY}} \ -d "address[state]"={{STATE}} \ -d "address[postal_code]"={{POSTAL_CODE}} \ -d "address[country]"={{COUNTRY}} \ -d "tax[validate_location]"=immediately ``` サブスクリプションで自動課税を有効にするには、顧客の税務上の所在地が有効である必要があります。[tax.validate_location](https://docs.stripe.com/api/customers/update.md#update_customer-tax-validate_location) を `immediately` に設定して、顧客の税務上の所在地を検証します。検証に失敗した場合、Stripe は [customer_tax_location_invalid](https://docs.stripe.com/error-codes.md#customer-tax-location-invalid) エラーコードでリクエストを失敗させます。プレビュー請求書の [automatic_tax.status](https://docs.stripe.com/api/invoices/object.md#invoice_object-automatic_tax-status) を確認することで、この失敗を回避できます。 ## サブスクリプションを作成する [サーバー側] 税金の自動徴収を有効にしてサブスクリプションを[作成します](https://docs.stripe.com/api/subscriptions/create.md)。 #### Customer v1 ```curl curl https://api.stripe.com/v1/subscriptions \ -u "<>:" \ -d "automatic_tax[enabled]"=true \ -d customer="{{CUSTOMER_ID}}" \ -d "items[0][price]"="{{PRICE_ID}}" \ -d "payment_settings[save_default_payment_method]"=on_subscription \ -d "expand[0]"="latest_invoice.confirmation_secret" ``` [latest_invoice.confirmation_secret.client_secret](https://docs.stripe.com/api/invoices/object.md#invoice_object-confirmation_secret-client_secrett) は、新しいサブスクリプションの最初 (かつ最新) の請求書にある*支払いインテント* (API object that represents your intent to collect payment from a customer, tracking charge attempts and payment state changes throughout the process)の *client secret* (The client secret is a unique key returned from Stripe as part of a PaymentIntent. This key lets the client access important fields from the PaymentIntent (status, amount, currency) while hiding sensitive ones (metadata, customer)) です。支払いインテントを*確定* (Confirming a PaymentIntent indicates that the customer intends to pay with the current or provided payment method. Upon confirmation, the PaymentIntent attempts to initiate a payment)するには、client secret をフロントエンドに渡す必要があります。 > client secret は保存したり、ログに記録したり、顧客以外に漏洩したりしないでください。client secret が含まれるページはすべて、必ず TLS を有効にしてください。 顧客がデフォルトの支払い方法を使用している場合、サブスクリプションの最初の請求書は自動的に支払われます。これは、サブスクリプションの [latest_invoice .status](https://docs.stripe.com/api/invoices/object.md#invoice_object-status)を使用すると確認できます。決済フローで顧客から収集した新しい支払いの詳細を使用する場合は、最初の請求書が自動的に支払われないようにしてください。サブスクリプションの作成時に [payment_behavior](https://docs.stripe.com/api/subscriptions/create.md#create_subscription-payment_behavior) に `default_incomplete` を渡し、表示のように [stripe.confirmPayment()](https://docs.stripe.com/js/payment_intents/confirm_payment) を使用して支払いインテントを確定します。詳細は、[請求の回収方法](https://docs.stripe.com/billing/collection-method.md)をご覧ください。 ## Optional: 商品と価格を更新する Stripe Tax では、*商品* (Products represent what your business sells—whether that's a good or a service)と*価格* (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)に保存されている、*税コード* (A tax code is the category of your product for tax purposes)や*税金処理* (Tax behavior determines whether you want to include taxes in the price ("inclusive") or add them on top ("exclusive"))などの情報を使用して、税額を計算します。これらの設定を明示的に指定しない場合、Stripe Tax は[税金設定](https://dashboard.stripe.com/settings/tax)で選択したデフォルトの税コードを使用します。 詳細については、[商品の税金コードと税金処理を指定する](https://docs.stripe.com/tax/products-prices-tax-codes-tax-behavior.md) をご覧ください。 ## Optional: 返金を処理する [サーバー側] 請求書の支払いに対する返金を作成すると、Stripe Tax によって仮受消費税が自動的に減額されます。 また、[クレジットノート](https://docs.stripe.com/api/credit_notes/object.md)を発行して、仮受消費税の減少額を追跡し、顧客に記録を提供することもできます。 #### 請求金額を返金する 請求書の合計に関連付けられた金額を返金するには、クレジットノートと返金を作成します。 #### 自動返金のクレジットノート [create Credit Note](https://docs.stripe.com/api/credit_notes/create.md) を呼び出し、`refund_amount` 値を指定して、クレジットノートと[返金](https://docs.stripe.com/api/refunds/object.md)をまとめて作成します。 ```curl curl https://api.stripe.com/v1/credit_notes \ -u "<>:" \ -d invoice="{{INVOICE_ID}}" \ -d refund_amount=1000 ``` #### 手動返金のクレジットノート [返金を作成し](https://docs.stripe.com/api/refunds/create.md)、[クレジットノート](https://docs.stripe.com/api/credit_notes/object.md)の作成時にその ID を含めます。このときに `refund_amount` 値は含めないでください。 ```curl curl https://api.stripe.com/v1/credit_notes \ -u "<>:" \ -d invoice="{{INVOICE_ID}}" \ -d "refunds[0][refund]"="{{REFUND_ID}}" \ -d "refunds[0][amount_refunded]"=1000 ``` Stripe Tax は、返金合計額を税金と正味金額に自動配分します。 #### 請求書のラインアイテムの金額を返金する 請求書のラインアイテムに関連付けられている金額を返金する場合は、まず [preview Credit Note](https://docs.stripe.com/api/credit_notes/preview.md) を呼び出して、[total](https://docs.stripe.com/api/credit_notes/object.md#credit_note_object-total) と [total_excluding_tax](https://docs.stripe.com/api/credit_notes/object.md#credit_note_object-total_excluding_tax) の金額を計算します。 ```curl curl -G https://api.stripe.com/v1/credit_notes/preview \ -u "<>:" \ -d invoice="{{INVOICE_ID}}" \ -d "lines[0][type]"=invoice_line_item \ --data-urlencode "lines[0][invoice_line_item]"="{{line item id from invoice}}" \ -d "lines[0][amount]"=1000 ``` 次に、[Credit Note](https://docs.stripe.com/api/credit_notes/object.md) と [Refund](https://docs.stripe.com/api/refunds/object.md) を作成します。 #### 自動返金のクレジットノート [create Credit Note](https://docs.stripe.com/api/credit_notes/create.md) を呼び出し、`refund_amount` 値を指定して、クレジットノートと[返金](https://docs.stripe.com/api/refunds/object.md)をまとめて作成します。 ```curl curl https://api.stripe.com/v1/credit_notes \ -u "<>:" \ -d invoice="{{INVOICE_ID}}" \ -d refund_amount=1000 \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"="{{line item id from invoice}}" \ -d "lines[0][amount]"=1000 ``` #### 手動返金のクレジットノート クレジットノートのプレビューで計算された `total` を使用して[返金を作成し](https://docs.stripe.com/api/refunds/create.md)、[Credit Note](https://docs.stripe.com/api/credit_notes/object.md) の作成時にその ID を含めます。このときに `refund_amount` 値は含めないでください。 ```curl curl https://api.stripe.com/v1/credit_notes \ -u "<>:" \ -d invoice="{{INVOICE_ID}}" \ -d "refunds[0][refund]"="{{REFUND_ID}}" \ -d "refunds[0][amount_refunded]"=1000 \ -d "lines[0][type]"=invoice_line_item \ -d "lines[0][invoice_line_item]"="{{line item id from invoice}}" \ -d "lines[0][amount]"=1000 ``` ## Webhook を使用する サブスクリプションアクティビティの大半は非同期で行われるため、*Webhook* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests) を使用してサブスクリプションイベントをリッスンすることをお勧めします。 Stripe Tax の使用を開始するときは、必ず [invoice.finalization_failed](https://docs.stripe.com/api/events/types.md#event_types-invoice.finalization_failed) イベントをリッスンしてください。請求書の [automatic_tax.status](https://docs.stripe.com/api/invoices/object.md#invoice_object-automatic_tax-status) が `requires_location_inputs` の場合は、顧客の住所の詳細が無効であるか、情報に不備があります。この場合、Stripe で税金の計算、請求書の確定、および支払いの回収を行うことはできません。住所情報を入力しなおすか、正確な住所を提供するように顧客に連絡してください。 詳しくは、[サブスクリプションでの Webhook の使用](https://docs.stripe.com/billing/subscriptions/webhooks.md)をご覧ください。 # 税率 > This is a 税率 for when tax-calculation is tax-rates. View the full page at https://docs.stripe.com/billing/taxes/collect-taxes?tax-calculation=tax-rates. サブスクリプションで税を徴収するには、[サブスクリプションに税率](https://docs.stripe.com/billing/taxes/collect-taxes.md#static-configuration)を設定するか、サブスクリプションの更新時に請求書に税率[を設定](https://docs.stripe.com/billing/taxes/collect-taxes.md#dynamic-configuration)します。あるいは、決済を使用している場合は、決済 [セッションで税率](https://docs.stripe.com/billing/taxes/collect-taxes.md#adding-tax-rates-to-checkout)を指定して、サブスクリプションに税を適用することもできます。 ## サブスクリプションに税率を設定する (Recommended) サブスクリプションでは、ドラフトの請求書が作成されます。このドラフトは約 1 時間、編集可能な状態で保持されます。この間は、以下のステップに沿って税率を修正できます。 サブスクリプションレベルとサブスクリプションアイテムレベルで税金を適用し、各サブスクリプションアイテムに最大 [5 つの税率](https://docs.stripe.com/billing/taxes/tax-rates.md#using-multiple-tax-rates)を設定できます。 サブスクリプションの請求書が生成されると、税率がサブスクリプションから請求書にコピーされます。以下の例では、1 つ目のサブスクリプションアイテムに 2 つの税率 (3% と 5%) が適用されており、サブスクリプションレベルの税率の 1% を上書きします。2 つ目のアイテムには直接設定された税率がないため、サブスクリプションレベルの税率の 1% が自動的に適用されます。 | | | | | サブスクリプションアイテム 1 | 3% と 5% | ➡️ | 請求書アイテム 1 | 3% と 5% | | サブスクリプションアイテム 2 | (税率設定なし) | ➡️ | 請求書アイテム 2 | (税率設定なし) | | サブスクリプション | 1% | ➡️ | 請求書 | 1% | サブスクリプションを作成または更新するときに、[税率 ID](https://docs.stripe.com/api/subscription_items/object.md#subscription_item_object-tax_rates-id) を渡すことで、税率を設定できます。次の例では、既存のサブスクリプションアイテムを 2 つの税率で更新します。 ```curl curl https://api.stripe.com/v1/subscription_items/si_F2yjdxUlCCOAtv \ -u "<>:" \ -d "tax_rates[]"=txr_1F6kmAAJVYItwOKqV9IWehUH \ -d "tax_rates[]"=txr_2J8lmBBGHJYyuUJqF6QJtkNM ``` サブスクリプションを作成または更新するときに、サブスクリプションレベルの税率を設定できます。[デフォルトの税率 ID](https://docs.stripe.com/api/subscriptions/object.md#subscription_object-default_tax_rates) を渡して、適用する税率を設定します。次の例では、既存のサブスクリプションを 2 つの税率で更新します。 ```curl curl https://api.stripe.com/v1/subscriptions/sub_BVxXIrxAAYb7Fb \ -u "<>:" \ -d "default_tax_rates[]"=txr_1EO66sClCIKljWvs98IiVfHW \ -d "default_tax_rates[]"=txr_1EEOvcClCIKljWvsqYb9U0MB ``` ## サブスクリプションサービス期間ごとに税率を動的に設定 [請求書アイテムを追加](https://docs.stripe.com/billing/invoices/subscription.md#adding-upcoming-invoice-items)する場合や、販売する管轄区域の多くで税率が頻繁に変わる場合は、税率を動的に計算して、サブスクリプションの請求書の作成時に割り当てることができます。 サブスクリプションが更新され、請求書が作成されると、Stripe は `invoice.created` *Webhook* (A webhook is a real-time push notification sent to your application as a JSON payload through HTTPS requests) イベントを送信します。Stripe は[約 1 時間待機](https://docs.stripe.com/billing/subscriptions/webhooks.md#understand)してから請求書を確定し、支払い処理を行うか、メールを送ります。この待機の期間、請求書は [draft](https://docs.stripe.com/api/invoices/object.md#invoice_object-status) の状態で、編集可能です。プロセスに従って、その請求書に[税率を割り当て](https://docs.stripe.com/invoicing/taxes/tax-rates.md)ます。 クレジットの[比例配分](https://docs.stripe.com/billing/subscriptions/prorations.md) が適用される場合、[(請求書) 項目](https://docs.stripe.com/api/invoice-line-item/object.md) の `proration_details` パラメーターを使用して、クレジットの比例配分が適用される元のデビット項目を参照してください。この参照を使用して、税額をクレジットの按分に正しく調整してください。 ## 決済に税率を追加 Checkout セッションで[税率](https://docs.stripe.com/billing/taxes/tax-rates.md) (消費税、VAT、GST、その他) を指定し、*サブスクリプション* (A Subscription represents the product details associated with the plan that your customer subscribes to. Allows you to charge the customer on a recurring basis)に税金を適用できます。 - 顧客が決済フロープロセスを開始する前に、顧客に請求する正確な税率を把握している場合は、固定税率を使用します (イギリスの顧客にのみ販売し、常に 20% の VAT を課税する場合など)。 - *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) API では、請求する税率を決定する前に顧客の詳細情報 (請求先住所、配送先住所など) が必要な場合に、動的税率を使用できます。動的税率では、地域ごとに異なる複数の税率 (イギリスの顧客には 20% の VAT、アメリカ・カリフォルニア州の顧客には 7.25% の売上税など) を作成でき、Stripe は顧客の居住地を、これらの税率のいずれかとマッチングします。 #### 固定税率 Checkout で開始したサブスクリプションにデフォルトの税率を適用するには、[subscription_data.default_tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-default_tax_rates) を設定します。 #### curl ```bash curl https://api.stripe.com/v1/checkout/sessions \ -u <>: \ -d "payment_method_types[]"=card \ -d "line_items[][price]"="{{PRICE_ID}}" \ -d "line_items[][quantity]"=1 \-d "subscription_data[default_tax_rates][]"="{{TAX_RATE_ID}}" \ -d mode=subscription \ -d success_url="https://example.com/success" \ ``` また、[line_items.tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items-tax_rates) あるいは [subscription_data.items.tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-items-tax_rates) を指定して、特定のプランまたはインボイスのラインアイテムに税率を適用することもできます。 #### curl ```bash curl https://api.stripe.com/v1/checkout/sessions \ -u <>: \ -d "payment_method_types[]"="card" \ -d "line_items[][price]"="{{PRICE_ID}}" \ -d "line_items[][quantity]"=1 \-d "line_items[][tax_rates][0]"="{{TAX_RATE_ID}}" \ -d "mode"="subscription" \ -d "success_url"="https://example.com/success" \ ``` #### 動的税率 [Tax Rate (税率)](https://docs.stripe.com/api/tax_rates/object.md) の配列を [line_items.dynamic_tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items-dynamic_tax_rates) に渡します。各 Tax Rate には[サポート対象の](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items-dynamic_tax_rates) `country` が設定されている必要があり、アメリカの場合は `state` も必要です。 このリストでは、税率を顧客の[配送先住所](https://docs.stripe.com/payments/collect-addresses.md)または請求先住所と突き合わせます。請求する税率を決定する際は、請求先住所よりも配送先住所が優先されます。 配送先住所や請求先住所を収集していない場合は、税率の決定に顧客の国 (および該当する場合には郵便番号) が使用されます。顧客の配送先住所、請求先住所、または国に一致する税率を渡していない場合、税率は適用されません。 #### curl ```bash curl https://api.stripe.com/v1/checkout/sessions \ -u <>: \ -d "payment_method_types[]"="card" \ -d "line_items[][price]"="{{PRICE_ID}}" \ -d "line_items[][quantity]"=1 \-d "line_items[][dynamic_tax_rates][]"="{{FIRST_TAX_RATE_ID}}" \ -d "line_items[][dynamic_tax_rates][]"="{{SECOND_TAX_RATE_ID}}" \ -d "mode"="subscription" \ -d "success_url"="https://example.com/success" \ ``` > [subscription_data.default_tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-subscription_data-default_tax_rates) および [line_items.tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items-tax_rates) を [line_items.dynamic_tax_rates](https://docs.stripe.com/api/checkout/sessions/create.md#create_checkout_session-line_items-dynamic_tax_rates) と組み合わせて使用することはできません。 Stripe のデータエクスポート機能を使用して、送金に必要となる定期的な申告書に入力することができます。詳細については、[納税申告および送金](https://docs.stripe.com/billing/taxes/tax-rates.md#remittance)を参照してください。 ## See also - [顧客の所在地を特定する](https://docs.stripe.com/tax/customer-locations.md) - [顧客の納税者番号](https://docs.stripe.com/billing/customer/tax-ids.md) - [納税申告および申請](https://docs.stripe.com/tax/reports.md) - [税率](https://docs.stripe.com/billing/taxes/tax-rates.md) - [請求書の税率](https://docs.stripe.com/invoicing/taxes/tax-rates.md)