OVIRO LogoOVIRO
OMSOrder Promotion

Order Promotion Object Schema

Đối tượng đại diện cho thông tin khuyến mãi áp dụng trên đơn hàng

JSON Schema

Trường (Field)Kiểu (Type)Mô tả (Description)
idintID bản ghi order promotion
company_idintID công ty (tenant)
creator_idintID người tạo
sale_order_idintID đơn hàng
sale_order_detail_idintID chi tiết đơn hàng (dòng sản phẩm)
product_idintID sản phẩm được áp dụng khuyến mãi
product_variant_idintID biến thể sản phẩm
customer_idintID khách hàng
ymdintNgày áp dụng (định dạng YYYYMMDD)
promotion_idintID chương trình khuyến mãi
promotion_typeintLoại khuyến mãi
promotion_scopeintPhạm vi khuyến mãi
discount_amountintSố tiền giảm giá (VNĐ)
coupon_codestringMã coupon đã sử dụng
gift_uom_idintID đơn vị tính quà tặng
gift_uom_quantityintSố lượng quà tặng (theo UOM)
gift_uom_unit_priceintĐơn giá quà tặng (VNĐ)
bonus_jsonobjectDữ liệu chi tiết bonus (chứa thông tin promotion)
snapshot_jsonobjectSnapshot dữ liệu promotion tại thời điểm áp dụng
statusintTrạng thái (xem bảng mã bên dưới)
ip_addressstringĐịa chỉ IP
date_createdintThời gian tạo (UNIX timestamp)
date_modifiedintThời gian cập nhật (UNIX timestamp)

Enriched fields

Khi gọi API List hoặc Detail, mỗi item sẽ được bổ sung thêm các trường sau:

Trường (Field)Kiểu (Type)Mô tả (Description)
promotionobject | nullThông tin chương trình khuyến mãi (trích xuất từ bonus_json hoặc snapshot_json)
customerobject | nullThông tin khách hàng (id, full_name, phone)
customer_namestringTên khách hàng
customer_phonestringSố điện thoại khách hàng

Bảng mã trạng thái (Status)

Giá trịKeyMô tả
1STATUS_ENABLEHoạt động
3STATUS_DISABLEDVô hiệu hóa

Ví dụ JSON object

{
    "id": 5001,
    "company_id": 10311,
    "creator_id": 1,
    "sale_order_id": 10002414,
    "sale_order_detail_id": 30001,
    "product_id": 123,
    "product_variant_id": 456,
    "customer_id": 101,
    "ymd": 20260309,
    "promotion_id": 200,
    "promotion_type": 101,
    "promotion_scope": 3,
    "discount_amount": 98180,
    "coupon_code": "",
    "gift_uom_id": 0,
    "gift_uom_quantity": 0,
    "gift_uom_unit_price": 0,
    "bonus_json": {
        "promotion": {
            "id": 200,
            "name": "Giảm 5% đơn hàng",
            "type": 101
        }
    },
    "snapshot_json": {},
    "status": 1,
    "ip_address": "14.169.11.81",
    "date_created": 1741500000,
    "date_modified": 1741500000,
    "promotion": {
        "id": 200,
        "name": "Giảm 5% đơn hàng",
        "type": 101
    },
    "customer": {
        "id": 101,
        "full_name": "Hoàng Văn Hải",
        "phone": "0909876543"
    },
    "customer_name": "Hoàng Văn Hải",
    "customer_phone": "0909876543"
}

On this page