# Reporting Query Runs API v2 を追加 ## 新機能 [Reporting Query Runs API v2](https://docs.stripe.com/api/v2/data/reporting/query-runs.md?api-version=2026-04-22.preview) を追加する。これにより、Stripe データに対して SQL クエリをプログラムで実行し、結果を取得できる。 この API は、[Query Run v2](https://docs.stripe.com/api/v2/data/reporting/query-runs/object.md?api-version=2026-04-22.preview) オブジェクト (ID プレフィックス `qryrun_`) を導入する。Stripe データに対して SQL クエリを実行するクエリ実行を[作成し](https://docs.stripe.com/api/v2/data/reporting/query-runs/create.md?api-version=2026-04-22.preview)、クエリ実行のステータスと結果を[取得する](https://docs.stripe.com/api/v2/data/reporting/query-runs/retrieve.md?api-version=2026-04-22.preview)ことができる。 クエリ結果は、セキュリティ上の理由から 5 分で期限切れになる事前署名付き S3 URL を通じて配信される。API には、クエリ実行のライフサイクルを追跡するための [4 つのイベント](https://docs.stripe.com/api/v2/data/reporting/query-runs/event-types.md?api-version=2026-04-22.preview)も含まれる。 - `v2.data.reporting.query_run.created` - `v2.data.reporting.query_run.succeeded` - `v2.data.reporting.query_run.failed` - `v2.data.reporting.query_run.updated` ## 影響 ダッシュボードからレポートを手動でエクスポートしなくても、プログラムで Stripe データにアクセスして分析できます。これにより、以下が可能になります。 - Stripe データから直接データを取得するカスタム分析ダッシュボードを構築 - スケジュールに従って SQL クエリを実行することで、レポート作成ワークフローを自動化 - Stripe データ分析を既存のビジネスインテリジェンスツールに統合 - 決済指標とビジネス指標に基づいて、リアルタイムの監視とアラートを作成 詳細については、[レポート API v2 から SQL クエリを実行する](https://docs.stripe.com/reports/query-runs.md)を参照してください。 ## 変更点 #### REST API | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Endpoints | Change | Resource | | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2.Data.Reporting.QueryRun` | #### Ruby | | Change | Resource | | | ------ | ---------------------------------------------------------------------------------------------------------------------------- | | | Added | [V2::Data::Reporting::QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | -------------------- | ------ | ---------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [V2::Data::Reporting::QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2::Data::Reporting::QueryRun` | #### Python | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [v2.data.reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [v2.data.reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `v2.data.reporting.QueryRun` | #### PHP | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2.Data.Reporting.QueryRun` | #### Java | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [v2.data.reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [v2.data.reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `v2.data.reporting.QueryRun` | #### Node.js | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | -------------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `create`, `retrieve` | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2.Data.Reporting.QueryRun` | #### Go | | Change | Resource | | | ------ | ---------------------------------------------------------------------------------------------------------------------- | | | Added | [V2DataReportingQueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | ------------ | ------ | ---------------------------------------------------------------------------------------------------------------------- | | `Get`, `New` | Added | [V2DataReportingQueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2DataReportingQueryRun` | #### .NET | | Change | Resource | | | ------ | ------------------------------------------------------------------------------------------------------------------------- | | | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | Methods | Change | Resource | | --------------- | ------ | ------------------------------------------------------------------------------------------------------------------------- | | `Create`, `Get` | Added | [V2.Data.Reporting.QueryRun](/api/v2/data/reporting/query-runs/object?api-version=2026-04-22.preview#v2_query_run_object) | | | Change | Event type | | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | ---------------------------- | | `V2DataReportingQueryRunCreatedEvent`, `V2DataReportingQueryRunFailedEvent`, `V2DataReportingQueryRunSucceededEvent`, `V2DataReportingQueryRunUpdatedEvent` | Added | `V2.Data.Reporting.QueryRun` | ## アップグレード #### REST API 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. SDK を使用している場合は、この API バージョンに対応する SDK バージョンにアップグレードします。 - SDK を使用していない場合は、`Stripe-Version: 2026-04-22.preview` を含めるように [API リクエスト](https://docs.stripe.com/api/versioning.md)を更新してください。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### Ruby 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. Ruby SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### Python 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. Python SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### PHP 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. PHP SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### Java 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. Java SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### Node.js 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. Node SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### Go 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. Go SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。 #### .NET 1. Workbench で[現在の API バージョンを表示します](https://docs.stripe.com/upgrades.md#view-your-api-version-and-the-latest-available-upgrade-in-workbench)。 1. .NET SDK を 最新バージョンにアップグレードします。 1. [Webhook エンドポイント](https://docs.stripe.com/webhooks/versioning.md)に使用する API バージョンをアップグレードします。 1. 新しいバージョンに対して、[実装内容をテスト](https://docs.stripe.com/testing.md)します。 1. Connect を使用する場合は、[Connect の実装内容をテスト](https://docs.stripe.com/connect/testing.md)します。 1. Workbench で[アップグレードを実行](https://docs.stripe.com/upgrades.md#perform-the-upgrade)します。[バージョンをロールバック](https://docs.stripe.com/upgrades.md#roll-back-your-api-version)できるのは 72 時間以内です。 [Stripe API のアップグレード](https://docs.stripe.com/upgrades.md)について、詳細をご確認ください。