OMSFlash Sale

Lấy chi tiết Flash Sale theo ID

Lấy thông tin chi tiết chương trình Flash Sale, bao gồm danh sách sản phẩm tham gia (details).

Endpoint

GET /site/flashsales/{id}

Headers

KeyValueBắt buộcMô tả
SiteTenantId{tenant_id}CóID của công ty/tenant.

Path Parameters

TênKiểuBắt buộcMô tả
idintegerCóID chương trình Flash Sale.

Workflow & Logic

API này trả về chi tiết đầy đủ của một chương trình Flash Sale bao gồm danh sách sản phẩm tham gia (details[]).

Điều kiện trả về dữ liệu

Hệ thống chỉ trả kết quả khi tất cả điều kiện sau đều thỏa:

  1. Flash Sale tồn tại (id hợp lệ).
  2. Thuộc đúng company/tenant hiện tại.
  3. status = 3 (ENABLE).
  4. date_started <= now (đã bắt đầu).
  5. date_ended >= now (chưa kết thúc).

Nếu bất kỳ điều kiện nào không thỏa → trả HTTP 404 (error_not_found).

Chi tiết sản phẩm (details)

API sẽ tự động load danh sách Flash Sale Detail có status = 1 (ENABLE), sắp xếp theo display_order ASC, tối đa 500 items.

Response Schema

HTTP 200 - Thành công

Trả về Flash Sale Object đầy đủ kèm details[]. Xem thêm Flash Sale Object.

Ví dụ Response

{
  "id": 5,
  "company_id": 1,
  "creator_id": 10,
  "type": 1,
  "name": "Flash Sale T3/2026",
  "title": "Siêu Sale Tháng 3",
  "description": "<p>Giảm giá cực sốc!</p>",
  "seo_url": "sieu-sale-thang-3",
  "max_total_order": 0,
  "max_total_quantity": 1000,
  "max_total_amount": 0,
  "status": 3,
  "date_started": 1741564800,
  "date_ended": 1741651200,
  "date_created": 1741500000,
  "date_modified": 1741500000,
  "details": [
    {
      "id": 20,
      "flash_sale_id": 5,
      "company_id": 1,
      "creator_id": 10,
      "product_id": 150,
      "product_variant_id": 301,
      "pricing_mode": 3,
      "uom_unit_price": 99000,
      "min_uom_quantity": 1,
      "max_uom_quantity": 5,
      "max_per_customer": 2,
      "quota_total_quantity": 100,
      "description": "",
      "display_order": 1,
      "status": 1,
      "date_created": 1741500000,
      "date_modified": 1741500000
    }
  ]
}

HTTP 404 - Không tìm thấy

Flash Sale không tồn tại, không thuộc tenant hiện tại, hoặc không nằm trong khung giờ hiệu lực.

On this page