外部連携

Webhook通知API

購買・広告・在庫更新などのイベント発生時に、指定したURLへリアルタイムで通知します。Webhookエンドポイントの登録・管理・テストに対応しています。


端點清單

方法 路徑 說明 回應
GET /api/v1/webhooks 登録済みWebhook一覧
登録されたWebhookエンドポイントとイベントサブスクリプション、ステータスの一覧を返します。
200
GET /api/v1/webhooks/{id} Webhook詳細を取得
単一のWebhookエンドポイントの完全な設定を返します。
200 404
POST /api/v1/webhooks 新規Webhookを登録
特定のイベントタイプ用に新しいWebhookエンドポイントを登録します。
200 400
POST /api/v1/webhooks/test/{id} テストWebhookを送信
テストイベントペイロードを送信して、Webhookエンドポイントの到達性を検証します。
200 404
DELETE /api/v1/webhooks/{id} Webhookを削除
Webhookエンドポイントを削除します。
204 404

端點詳細資訊

登録されたWebhookエンドポイントとイベントサブスクリプション、ステータスの一覧を返します。

完整路徑: GET /api/v1/webhooks
回應碼: 200

単一のWebhookエンドポイントの完全な設定を返します。

完整路徑: GET /api/v1/webhooks/{id}
回應碼: 200 404

特定のイベントタイプ用に新しいWebhookエンドポイントを登録します。

完整路徑: POST /api/v1/webhooks
回應碼: 200 400

テストイベントペイロードを送信して、Webhookエンドポイントの到達性を検証します。

完整路徑: POST /api/v1/webhooks/test/{id}
回應碼: 200 404

Webhookエンドポイントを削除します。

完整路徑: DELETE /api/v1/webhooks/{id}
回應碼: 204 404

請求範例

請求
POST /api/v1/webhooks
Authorization: Bearer {access_token}

{
  "url": "https://your-app.com/webhooks",
  "events": ["purchase.completed", "order.shipped"],
  "secret": "your-webhook-secret"
}
回應
{
  "id": "wh-001",
  "url": "https://your-app.com/webhooks",
  "events": ["purchase.completed", "order.shipped"],
  "status": "active",
  "createdAt": "2025-03-20T10:00:00Z"
}
關於驗證

使用此 API 需要 Authorization: Bearer {access_token} 標頭。取得權杖的方式請參閱驗證指南。

查看驗證與存取 API