# Revenue Recognition API プログラムで Stripe の Revenue Recognition レポートにアクセスして、発生主義会計を自動化します。 発生主義会計の場合、Stripe 収益認識は[、期間サマリー](https://docs.stripe.com/revenue-recognition/reports/period-summary.md)や[収益推移表](https://docs.stripe.com/revenue-recognition/reports/waterfall.md)などの[ダウンロード可能なレポート](https://docs.stripe.com/revenue-recognition/reports.md)を提供します。これらのレポートは、[ダッシュボード](https://dashboard.stripe.com/revenue-recognition)から CSV 形式でダウンロードすることも、API からプログラムでアクセスすることもできます。 Stripe Revenue Recognition では、6 種類のレポートに対応しています。 - `revenue_recognition.debit_credit_summary.1` - `revenue_recognition.debit_credit_by_price.1` - `revenue_recognition.debit_credit_by_product.1` - `revenue_recognition.debit_credit_by_customer.1` - `revenue_recognition.debit_credit_by_invoice.1` - `revenue_recognition.debit_credit_by_invoice_line_item.1` > この機能はベータ版であるため、データフィールドは変わる可能性があります。 ## レポートをダウンロードする 以下の例では、借方と貸方を 2025 年 5 月のサマリー別にダウンロードしています。 最初に、[レポート実行の作成](https://docs.stripe.com/api/reporting/report_run/create.md)でレポート実行を作成します。 2025 年 5 月のレポートを取得するには、`parameters[interval_start]` を 2025 年 5 月 1 日に、`parameters[interval_end]` を 2025 年 6 月 1 日に設定します。 ```curl curl https://api.stripe.com/v1/reporting/report_runs \ -u "<>:" \ -d "report_type=revenue_recognition.debit_credit_summary.1" \ -d "parameters[interval_start]=1746057600" \ -d "parameters[interval_end]=1748736000" ``` 次に、[Report Run (レポート実行)](https://docs.stripe.com/api/reporting/report_run/object.md) オブジェクトを取得して、オブジェクトが成功したかどうかを確認します。 レポート実行オブジェクト ID が `frr_` で始まる。 ```curl curl https://api.stripe.com/v1/reporting/report_runs/{{REPORT_RUN_OBJECT_ID}} \ -u "<>:" ``` オブジェクトの `status` が `succeeded` の場合、以下の例のように `result.id` を使用して CSV をダウンロードできます。 レポートの実行結果 ID が `file_` で始まる。 #### curl ```bash curl https://files.stripe.com/v1/files/{{REPORT_RUN_RESULT_ID}}/contents \ -u <>: ``` ## レポート実行パラメーター | レポートタイプ | 必要な実行パラメータ | オプションの実行パラメータ | | ------------------------------------------------------- | ------------------------------------- | ----------------------------------------------------------------------- | | revenue_recognition.debit_credit_summary.1 | - `interval_start` - `interval_end` | - `decimal_format` | | revenue_recognition.debit_credit_by_price.1 | - `interval_start` - `interval_end` | - `customer` - `decimal_format` | | revenue_recognition.debit_credit_by_product.1 | - `interval_start` - `interval_end` | - `customer` - `decimal_format` | | revenue_recognition.debit_credit_by_customer.1 | - `interval_start` - `interval_end` | - `decimal_format` | | revenue_recognition.debit_credit_by_invoice.1 | - `interval_start` - `interval_end` | - `customer` - `invoice` - `invoice_line_item` - `decimal_format` | | revenue_recognition.debit_credit_by_invoice_line_item.1 | - `interval_start` - `interval_end` | - `customer` - `invoice` - `invoice_line_item` - `decimal_format` | ## レポート実行の列 デフォルトでは、レポートはデフォルトの列セットで実行されます。 [列名のリスト](https://docs.stripe.com/reports/api.md#report-runs)にオプションの列パラメーターを含めることで、出力の列の選択と順序をカスタマイズできます。各レポートタイプでサポートされている列は以下のとおりです。 ### サマリー API レポートタイプ: `revenue_recognition.debit_credit_summary.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | --------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | debit_gl_code | | 借方記入の総勘定元帳のコード | ### 価格別 API レポートタイプ: `revenue_recognition.debit_credit_by_price.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | --------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | price_id | ✓ デフォルト | この変更に関連する価格。 | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | debit_gl_code | | 借方記入の総勘定元帳のコード | ### 商品別 API レポートタイプ: `revenue_recognition.debit_credit_by_product.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | --------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | product_id | ✓ デフォルト | この変更に関連する商品。 | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | debit_gl_code | | 借方記入の総勘定元帳のコード | ### 顧客別 API レポートタイプ: `revenue_recognition.debit_credit_by_customer.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | --------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | customer_id | ✓ デフォルト | この変更に関連する顧客。 | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | debit_gl_code | | 借方記入の総勘定元帳のコード | ### 請求書別 API レポートタイプ: `revenue_recognition.debit_credit_by_invoice.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | ---------------------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | transaction_model_id | ✓ デフォルト | この変更に関連付けられている Stripe のモデル (invoice line item、invoice、invoiceitem、charge など) | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | booked_date | ✓ デフォルト | 元帳のエントリーが帳簿に追加された日付。 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | debit_gl_code | | 借方記入の総勘定元帳のコード | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | invoice_id | | この変更に関連する請求書。請求書に関連付けられていない単独の支払いまたは請求書アイテムは `null` です。 | | invoice_line_item_id | | 請求書の line_item の ID。 | | invoice_item_id | | 請求書アイテムの ID | | invoice_number | | 請求書に関連付けられている顧客の一意の番号。 | | subscription_item_id | | subscription_item の ID。 | | price_id | | この変更に関連する価格。価格に関連付けられていない単独の支払いまたは請求書アイテムは `null` です。 | | product_id | | この価格に関連する商品。 | | customer_id | | この変更に関連する顧客。 | | subscription_id | | この変更に関連するサブスクリプション。 | | charge_id | | この変更に関連する支払い。 | | refund_id | | この変更に関連する返金。 | | dispute_id | | この変更に関連する不審請求の申請。 | | presentment_currency | | 取引の表示 (顧客向け) 通貨。 | | presentment_amount | | 表示 (顧客向け) 金額。 | ### 請求書ラインアイテム別 API レポートタイプ: `revenue_recognition.debit_credit_by_invoice_line_item.1` | 列名 | デフォルト | 説明 | | ---------------------- | ------- | --------------------------------------------------------------- | | accounting_period | ✓ デフォルト | 会計期間 | | open_accounting_period | ✓ デフォルト | 確定前の会計期間。確定前の期間のエントリーは変更されることがあります | | 通貨 | ✓ デフォルト | 金額の[通貨の ISO コード](https://docs.stripe.com/currencies.md) (3 文字)。 | | transaction_model_id | ✓ デフォルト | この変更に関連する Stripe のモデル (請求書ラインアイテム、請求書、請求書アイテム、支払いなど)。 | | デビット | ✓ デフォルト | 引き落としされた口座 | | クレジット | ✓ デフォルト | 入金された口座 | | booked_date | ✓ デフォルト | 元帳のエントリーが帳簿に追加された日付。 | | 金額 | ✓ デフォルト | 通貨の主要な単位で表示された金額の変更 (例: USD の場合はドル、MXN の場合はペソ)。 | | debit_gl_code | | 借方記入の総勘定元帳のコード | | credit_gl_code | | 貸方記入の総勘定元帳のコード | | invoice_id | | この変更に関連する請求書。請求書に関連付けられていない単独の支払いまたは請求書アイテムは `null` です。 | | invoice_line_item_id | | 請求書の line_item の ID。 | | invoice_item_id | | 請求書アイテムの ID | | subscription_item_id | | subscription_item の ID。 | | price_id | | この変更に関連する価格。価格に関連付けられていない単独の支払いまたは請求書アイテムは `null` です。 | | product_id | | この価格に関連する商品。 | | customer_id | | この変更に関連する顧客。 | | subscription_id | | この変更に関連するサブスクリプション。 | | charge_id | | この変更に関連する支払い。 | | refund_id | | この変更に関連する返金。 | | dispute_id | | この変更に関連する不審請求の申請。 | | presentment_currency | | 取引の表示 (顧客向け) 通貨。 | | presentment_amount | | 表示 (顧客向け) 金額。 | 問題が発生した場合は、[revenue-recognition-api-beta@stripe.com](mailto:revenue-recognition-api-beta@stripe.com) までお問い合わせください。