Cửa hàng — Cập nhật & cấu hình Webhook

Cập nhật thông tin cửa hàng và bật/cấu hình webhook.

Xem Markdown

Cập nhật cấu hình cửa hàng, bao gồm bật webhook, URL nhận, loại sự kiện và header tuỳ chỉnh.

Endpoint

MethodEndpointMô tả
PUT/api/v1/shops/{shop_id}Cập nhật cửa hàng / webhook

Tham số

Tham sốVị tríKiểuBắt buộcMô tả
shop_idđường dẫnstringCóID cửa hàng
webhook_enablethânbooleanKhôngBật/tắt webhook
webhook_urlthânstringKhôngURL nhận webhook (HTTPS)
webhook_typesthânstring[]KhôngLoại sự kiện: orders, customers, products, variations_warehouses, auto_call
webhook_headersthânobjectKhôngHeader tuỳ chỉnh gửi kèm

Kiểm thử tại chỗ

PUThttps://pos.hitechcloud.vn/api/v1/shops/{shop_id}

Nhập tham số và API Key rồi bấm Gửi thử. Key không được lưu lại.

Tham số đường dẫn
Body
cURL mẫu (PUT)
curl -X PUT "https://pos.hitechcloud.vn/api/v1/shops/shop_0a1b2c3d" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "shop": {
    "webhook_enable": true,
    "webhook_url": "https://ban.example.com/hook",
    "webhook_types": [
      "orders",
      "variations_warehouses"
    ]
  }
}'
Phản hồi mẫu
{
  "status": "success",
  "data": {
    "id": "shop_0a1b2c3d",
    "webhook_enable": true,
    "webhook_url": "https://ban.example.com/hook",
    "webhook_types": [
      "orders",
      "variations_warehouses"
    ]
  }
}
Mỗi loại sự kiện trong webhook_types tương ứng một payload riêng. Xem trang Webhook — Danh sách sự kiện.