测试 Webhook

向 Webhook URL 发送测试通知。该方法可在不创建真实付款的情况下检查端点可用性、传入数据处理是否正确以及通知接收情况。

POST

https://api.fps.pro/invoices/webhook/test

请求格式application/json

id

uuid

不存在付款的标识符

默认值: generated

webhook_link

required

url

支付状态回传的 URL

status

string

付款状态

默认值: paid

响应格式data object

status

number

将 Webhook 发送到您的端点时的 HTTP 状态

response_body

json

向您的端点发送数据后收到的响应体

请求示例

curl --request POST 'https://api.fps.pro/invoices/webhook/test' \
  --header 'Content-Type: application/json' \
  --header 'X-Client-Id: YOUR_CLIENT_ID' \
  --header 'X-Timestamp: 1720000000' \
  --header 'X-Signature: YOUR_HMAC_SHA256_SIGNATURE' \
  --data '{
  "id": "0a718b02-131d-495a-9641-39ca52139c07",
  "webhook_link": "https://merchant.example.com/webhooks/fps",
  "status": "paid"
}'

成功响应

{
  "status": 200,
  "message": "success",
  "data": {
    "status": 200,
    "response_body": "Webhook receive"
  }
}

错误

详细的授权错误列表位于 授权 - 错误

{
  "status": 403,
  "message": "Forbidden"
}
{
  "status": 422,
  "message": "Validation Error",
  "data": {
    "field": "name",
    "message": "field validation error"
  }
}
{
  "status": 500,
  "message": "Internal Server Error"
}