Create a Webhook
POST
/v1/webhook_endpointsA webhook endpoint must have a url and a list of enabled_events.
请求参数
Body Params application/json
object {0}
Example
{
"description": "This is your description of the webhook",
"enabled_events": [
"payment_intent.succeeded",
"payment_intent.payment_failed",
"charge.refund.updated",
"charge.dispute.updated"
],
"url": "https://your_call_back_address.com"
}
示例代码
Responses
OK(200)
HTTP 状态码: 200
内容格式: JSONapplication/json
Data Schema
No schema defined
Example
{
"id": "we_1M3fqHHTdYyGj2Y6LeGVaamQ",
"object": "webhook_endpoint",
"api_version": null,
"created": 1668344601,
"description": "This is my webhook, I like it a lot",
"enabled_events": [
"payment_intent.succeeded",
"payment_intent.payment_failed",
"charge.refund.updated",
"charge.dispute.updated"
],
"livemode": false,
"metadata": {},
"status": "enabled",
"url": "https://example.com/my/webhook/endpoint",
"secret": "whsec_9rMfZUGWM3gTTBtn0f8kPEfmiIJCmzQi"
}
Last modified: 9 个月前