处理 Webhook 事件
按照以下步骤处理 Cobo 支付服务发送的 Webhook 事件:- 创建一个 Webhook Endpoint。
- 选择服务器环境。
- 定义 Endpoint URL。
- 在服务器端实现处理逻辑。
- 解析 API 请求。
- 验证签名。
- 响应 API 请求。
- 添加其他处理逻辑(如果适用)。
- 在 Cobo Portal 上注册 Endpoint。
注册 Webhook Endpoint 时,您需要指定要订阅的事件类型。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
| 字段 | 类型 | 说明 |
|---|---|---|
status | string | 事件推送状态,可能的值:Success、Retrying、Failed。 |
next_retry_timestamp | integer (int64) | 下次重试的计划时间,Unix 时间戳格式(毫秒)。仅在 status 为 Retrying 时存在。 |
retries_left | integer | 剩余重试次数。仅在 status 为 Retrying 时存在。 |
{
"event_id": "8f2e919a-6a7b-4a9b-8c1a-4c0b3f5b8b1f",
"url": "https://example.com/webhook",
"created_timestamp": 1701396866000,
"type": "payment.order.status.updated",
"data": {
"data_type": "PaymentOrder",
"order_id": "O20250304-M1001-1001",
"merchant_id": "1001",
"psp_order_code": "P20240201001",
"pricing_currency": "USD",
"pricing_amount": "100.00",
"fee_amount": "2.00",
"payable_currency": "ETH_USDT",
"chain_id": "ETH",
"payable_amount": "103.03",
"exchange_rate": "0.99",
"receive_address": "0x1234567890abcdef1234567890abcdef12345678",
"status": "Completed",
"received_token_amount": "103.0305",
"created_timestamp": 1744689600,
"updated_timestamp": 1744689600
},
"status": "Success"
}