Cấu hình Webhook
PUT
/shops/{SHOP_ID}Cấu hình thiết lập webhook. Vào Cấu hình -> Nâng cao -> Kết nối bên thứ 3 -> Webhook/API để cấu hình:
- Webhook URL (Bắt buộc)
- Email thông báo lỗi
- Request Headers
- Loại webhook:
orders,customers,products,variations_warehouses, hoặcauto_call
Các Loại Phản Hồi Webhook
Khi webhook được bật, hệ thống gửi yêu cầu POST đến URL đã cấu hình. Schema phản hồi:
orders: Xem schema WebhookOrderResponsecustomers: Xem schema WebhookCustomerResponseproducts: Xem schema WebhookProductResponsevariations_warehouses: Xem schema WebhookInventoryResponseauto_call: Xem schema WebhookAutoCallResponse
Tham số đường dẫn
SHOP_IDintegerbắt buộcMã shop
Nội dung yêu cầu
Thông tin yêu cầu chứa thông tin cần cập nhật
object
shopobjectbắt buộcPhản hồi
object
shopobjectThông tin cửa hàng
successbooleanTrạng thái thành công
Yêu cầu
curl -X PUT "https://pos.pages.fm/api/v1/shops/{SHOP_ID}?api_key=API_KEY" \
-H "Content-Type: application/json" \
-d '{
"shop": {
"webhook_enable": true,
"webhook_url": "https://test.com",
"webhook_email": "1234@gmail.com",
"webhook_types": [
"orders",
"customers",
"variations_warehouses"
],
"webhook_partner": "",
"webhook_headers": {
"X-API-KEY": "elqsF9ERiFWGacWQO9Gg5XC4kXojot"
}
}
}'Phản hồi 200
{
"success": true
}