# Webhook イベント生成の失敗を処理する 生成に失敗した Webhook を処理する方法を学びます。 非常に稀なケースですが、Stripe が `Event` オブジェクトの生成に失敗することがあります。この場合、イベントは回復不能であり、イベントの送信先に配信できず、ダッシュボードや [List Events API](https://docs.stripe.com/api/v2/core/events/list.md) に表示(公開)することもできません。Stripe は、`Event` の生成に失敗したことを通知する [v2.core.health.event_generation_failure.resolved](https://docs.stripe.com/api/v2/core/events/event-types.md#v2_event_types-v2.core.health.event_generation_failure.resolved) イベントを作成します。このガイドでは、アラートの仕組みと、その回復方法について説明します。 ## 失敗したイベントの配信 Stripe は`v2.core.health.event_generation_failure.resolved` イベントをワークベンチと、イベントをリッスンするように設定した Webhook エンドポイントの両方に配信します。 ### ワークベンチ `v2.core.health.event_generation_failure.resolved` イベントはワークベンチの 2 つの場所に表示されます。 - [[Events]](https://docs.stripe.com/workbench/overview.md#events) タブ - [[Health]](https://docs.stripe.com/workbench/health.md) タブ ### Webhook エンドポイント [webhook setup guide](https://docs.stripe.com/webhooks.md) に従って、`v2.core.health.event_generation_failure.resolved` thin イベントをリッスンする Webhook エンドポイントを登録できます。正しい Webhook エンドポイントを登録すると、Stripe はそのエンドポイントに `v2.core.health.event_generation_failure.resolved` イベントを送信します。 ## ヘルスイベントの使用方法 Stripe が Webhook イベントの生成に失敗した場合、次の例に示すように、生成された [thin イベント](https://docs.stripe.com/event-destinations.md#thin-events)を処理して、`v2.core.health.event_generation_failure.resolved` オブジェクトを取得できます。 ```json { "alert_id": "halert_61RFBMa6o6H87usts16RFBM10hSQlYfddqcFoEMR6CPY", "grouping_key": "_grouping_s8PgTvizbkORV9z5PhaJSvc4dUcAMmfRpEHKm4EeJ1glsQ5XMf", "impact": { "event_type": "payment_intent.requires_action", "related_object_id": "pi_1QA8PKDTvO5jCVb3TVDZP75a", "related_object": { "id": "pi_1QA8PKDTvO5jCVb3TVDZP75a", "type": "payment_intent", "url": "https://dashboard.stripe.com/payment_intents/pi_1QA8PKDTvO5jCVb3TVDZP75a" } }, "resolved_at": "2025-10-30T16:05:44.000Z", "summary": "We have failed to create a notification for your Stripe account." } ``` この例のイベントでは、障害に関する次の情報が示されます。 - **失敗したイベント**: Stripe は `payment_intent.requires_action` イベントの生成に失敗しました。 - **関連オブジェクト**: Stripe がイベントの生成に失敗した PaymentIntent は `pi_1QA8PKDTvO5jCVb3TVDZP75a` です。 - **タイムスタンプ**: イベントは `2025-10-30T16:05:44.000Z` で生成できませんでした。 - **アカウントタイプ**: `影響に`は`コンテキスト`プロパティーが含まれていないため、連結アカウントで `payment_intent.requires_action` イベントは連結アカウント上で発生したものではありません。 導入が `payment_intent.requires_action` イベントの Webhook を受信する場合、Stripe の状態と同期されません。`v2.core.health.event_generation_failure.resolved` Webhook を受信した後で、関連する API (この場合は[支払いインテント API](https://docs.stripe.com/api/payment_intents.md)) をポーリングして、関連オブジェクトを取得できます。 ```curl curl https://api.stripe.com/v1/payment_intents/pi_1QA8PKDTvO5jCVb3TVDZP75a \ -u "<>:" ```