Webhook thử nghiệm

Gửi thông báo thử nghiệm tới Webhook URL. Phương thức này cho phép kiểm tra endpoint có truy cập được không, xử lý dữ liệu đầu vào có đúng không và nhận thông báo mà không cần tạo thanh toán thật.

POST

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

Định dạng yêu cầuapplication/json

id

uuid

Định danh của thanh toán không tồn tại

Mặc định: generated

webhook_link

required

url

URL nhận trạng thái thanh toán

status

string

Trạng thái thanh toán

Mặc định: paid

Định dạng phản hồidata object

status

number

Trạng thái HTTP khi gửi webhook tới endpoint của bạn

response_body

json

Nội dung phản hồi nhận được sau khi gửi dữ liệu tới endpoint của bạn

Ví dụ yêu cầu

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"
}'

Phản hồi thành công

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

Lỗi

Danh sách lỗi ủy quyền chi tiết nằm trong Ủy quyền - Lỗi

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