OVIRO LogoOVIRO
Cài đặt website

Lấy cài đặt website

API lấy toàn bộ cấu hình website/storefront của công ty hiện tại. Dùng khi khởi tạo giao diện frontend.

Endpoint

GET /site/settings/setting

Headers

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

Workflow & Logic

API này trả về toàn bộ cấu hình website của một tenant, được sử dụng khi khởi tạo giao diện storefront (web/app). Dữ liệu cài đặt bao gồm: giao diện chung, trang chủ, danh sách sản phẩm, chi tiết sản phẩm, giỏ hàng, thanh toán, cổng thanh toán, vận chuyển, khách hàng, và affiliate.

Quy trình xử lý

  1. Xác thực Tenant: Kiểm tra SiteTenantId và xác định company_id từ session (initSite). Không yêu cầu đăng nhập khách hàng.
  2. Tải toàn bộ Setting: Gọi Setting::getAllCompanySettings(company_id) để lấy tất cả bản ghi cài đặt của công ty.
  3. Trích xuất & Định dạng: Duyệt qua danh sách setting, trích xuất giá trị (value hoặc valueextra tùy theo key) và ép kiểu dữ liệu phù hợp (string, int, float).
  4. Trả kết quả: Trả về JSON object phẳng (flat) chứa tất cả các key-value cài đặt.

Query Parameters

API này không nhận query parameter nào. Toàn bộ cài đặt của tenant sẽ được trả về.

Response Schema

HTTP 200 - JSON Object

{
  "company_id": 123,
  "id": 123,

  "website_domain": "https://myshop.example.com",
  "website_logo_file": "logo.png",
  "website_logo_file_darkmode": "logo-dark.png",
  "website_favicon_file": "favicon.ico",
  "website_on_maintain": 0,
  "website_custom_css": "",
  "website_custom_js": "",
  "website_custom_html_head": "",
  "website_custom_html_body": "",
  "website_desktop_container_full": 0,
  "website_mobile_page_footer_navigation": 1,

  "website_using_page_id_index": 0,
  "website_homepage_recently_viewed_layout": "slider",
  "point_allow_redeem": 1,

  "website_inventory_from_warehouse": 0,
  "website_product_limit": 20,
  "website_product_photo_ratio": "1:1",
  "website_order_default_store": 0,
  "website_product_list_layout": "grid",
  "website_product_quick_view": 1,
  "website_product_quick_view_style": "modal",
  "website_product_quick_add_to_cart": 1,
  "website_product_quick_add_to_cart_style": "icon",
  "website_product_card_wishlist": 1,
  "website_product_card_hover_effect": "zoom",
  "website_product_card_col_desktop": 4,
  "website_product_card_col_mobile": 2,
  "website_allow_cart_buy_now": 1,

  "website_product_detail_main_layout": "default",
  "website_product_detail_main_ratio": "1:1",
  "website_product_detail_gallery_layout": "slider",
  "website_product_detail_thumbnail_position": "bottom",
  "website_product_detail_thumbnail_count": 5,
  "website_product_detail_description_position": "below",
  "website_product_detail_attribute_position": "tab",
  "website_product_detail_rating_summary_position": "below_price",
  "website_product_detail_review_position": "tab",
  "website_product_detail_wishlist_position": "beside_cart",
  "website_product_detail_price_position": "default",
  "website_product_detail_promotion_position": "below_price",
  "website_product_detail_combo_column": "2",
  "website_product_detail_combo_layout": "grid",
  "website_product_detail_custom_css": "",
  "website_product_detail_custom_js": "",
  "website_product_suggestion_column_desktop": 4,
  "website_product_suggestion_column_mobile": 2,
  "website_product_suggestion_swiper_gap_desktop": 16,
  "website_product_suggestion_swiper_gap_mobile": 8,
  "website_product_suggestion_default_title": "Sản phẩm gợi ý",
  "website_product_suggestion_type": "related",

  "website_cart_layout": "default",
  "website_cart_require_login": 0,

  "website_checkout_require_login": 0,
  "website_checkout_layout_ratio": "6:4",
  "website_checkout_coupon_position": "sidebar",
  "website_checkout_block_detail_position": "1",
  "website_checkout_block_detail_layout": "compact",
  "website_checkout_block_billing_info_position": "2",
  "website_checkout_block_billing_info_mode": "form",
  "website_checkout_block_shipping_info_position": "3",
  "website_checkout_block_shipping_info_mode": "form",
  "website_checkout_block_shipping_service_mode": "list",
  "website_checkout_block_payment_position": "4",
  "website_checkout_block_tax_position": "5",
  "website_checkout_block_tax_mode": "auto",
  "website_checkout_block_summary_position": "6",
  "website_checkout_allow_pickup_at_store": 0,
  "website_checkout_login_only": 0,

  "website_payment_cod_enable": 1,
  "website_payment_cod_amount_from": 0,
  "website_payment_cod_amount_to": 0,
  "website_payment_momo_enable": 0,
  "website_payment_momo_amount_from": 0,
  "website_payment_momo_amount_to": 0,
  "website_payment_momo_endpoint_url": "",
  "website_payment_momo_partner_code": "",
  "website_payment_vnpay_enable": 0,
  "website_payment_vnpay_amount_from": 0,
  "website_payment_vnpay_amount_to": 0,
  "website_payment_vnpay_endpoint_url": "",
  "website_payment_vnpay_tmn_code": "",
  "website_payment_vnpay_return_url": "",
  "website_payment_vnpayqr_enable": 0,
  "website_payment_vnpayqr_amount_from": 0,
  "website_payment_vnpayqr_amount_to": 0,
  "website_payment_vnpayqr_app_id": "",
  "website_payment_vnpayqr_merchant_name": "",
  "website_payment_vnpayqr_merchant_code": "",
  "website_payment_vnpayqr_terminal_id": "",
  "website_payment_vnpayqr_secret_key": "",
  "website_payment_vnpayqr_master_mer_code": "",
  "website_payment_vnpayqr_merchant_type": "",
  "website_payment_vnpayqr_gen_qr_url": "",
  "website_payment_vnpayqr_check_trans_url": "",
  "website_payment_vnpayqr_secret_key_check_trans": "",
  "website_payment_sepay_enable": 0,
  "website_payment_sepay_amount_from": 0,
  "website_payment_sepay_amount_to": 0,
  "website_payment_sepay_account_bank": "",
  "website_payment_sepay_name_bank": "",
  "website_payment_sepay_qr_code_url": "",
  "website_payment_zalopay_enable": 0,
  "website_payment_zalopay_amount_from": 0,
  "website_payment_zalopay_amount_to": 0,
  "website_payment_banktransfer_enable": 0,
  "website_payment_banktransfer_amount_from": 0,
  "website_payment_banktransfer_amount_to": 0,
  "website_payment_banktransfer_detail": "",
  "website_price_policy_id": 0,
  "website_filter_pricing_range": "",

  "website_order_default_customer_id": 0,
  "website_checkout_create_new_customer": 1,
  "website_customer_attribute_category_id": 0,

  "default_product_tax_ratio": 0.0,
  "product_price_including_tax": 1,

  "product_allow_multiple_avatar": 0,
  "product_weighted_uom_id_of_gram": 0,
  "product_weight_preset": "",

  "shipping_using_new_region": 1,
  "shipping_show_district_ward_legacy": 0,

  "affiliate_store_front_enable": 0,
  "affiliate_store_front_show_link": 0,
  "affiliate_register_enable": 0,
  "affiliate_register_auto_approve": 0,
  "affiliate_register_auto_approve_code_list": "",
  "affiliate_default_group_id": 0,
  "affiliate_tracking_lifetime_day": 30,
  "affiliate_commission_window_day": 30,
  "affiliate_payout_min_amount": 0,
  "affiliate_payout_lock_mday": 0
}

Chi tiết các nhóm cài đặt

Cài đặt chung (General)

TrườngKiểuMô tả
company_idintegerID công ty/tenant.
idintegerAlias của company_id.
website_domainstringTên miền website storefront.
website_logo_filestringĐường dẫn file logo (sáng).
website_logo_file_darkmodestringĐường dẫn file logo (tối).
website_favicon_filestringĐường dẫn file favicon.
website_on_maintainintegerChế độ bảo trì (1: Bật, 0: Tắt).
website_custom_cssstringCSS tùy chỉnh thêm vào website.
website_custom_jsstringJavaScript tùy chỉnh thêm vào website.
website_custom_html_headstringHTML tùy chỉnh chèn vào thẻ <head>.
website_custom_html_bodystringHTML tùy chỉnh chèn vào thẻ <body>.
website_desktop_container_fullintegerBật/tắt container full-width trên desktop (1: Full, 0: Boxed).
website_mobile_page_footer_navigationintegerHiển thị thanh điều hướng dưới cùng trên mobile (1: Có, 0: Không).

Trang chủ (Homepage)

TrườngKiểuMô tả
website_using_page_id_indexintegerID trang CMS dùng làm trang chủ (0: Mặc định hệ thống).
website_homepage_recently_viewed_layoutstringLayout hiển thị sản phẩm đã xem gần đây trên trang chủ.
point_allow_redeemintegerCho phép khách hàng sử dụng điểm tích lũy (1: Có, 0: Không).

Danh sách sản phẩm (Product Listing)

TrườngKiểuMô tả
website_inventory_from_warehouseintegerID kho hàng dùng để hiển thị tồn kho (0: Tất cả kho).
website_product_limitintegerSố sản phẩm tối đa mỗi trang listing.
website_product_photo_ratiostringTỷ lệ ảnh sản phẩm (VD: 1:1, 3:4).
website_order_default_storeintegerID chi nhánh/cửa hàng mặc định khi đặt hàng online.
website_product_list_layoutstringLayout danh sách sản phẩm (VD: grid, list).
website_product_quick_viewintegerBật/tắt Quick View trên card sản phẩm (1: Bật, 0: Tắt).
website_product_quick_view_stylestringKiểu hiển thị Quick View (VD: modal, drawer).
website_product_quick_add_to_cartintegerBật/tắt nút thêm nhanh vào giỏ hàng (1: Bật, 0: Tắt).
website_product_quick_add_to_cart_stylestringKiểu hiển thị nút thêm nhanh (VD: icon, button).
website_product_card_wishlistintegerHiển thị nút yêu thích trên card (1: Có, 0: Không).
website_product_card_hover_effectstringHiệu ứng hover trên card sản phẩm (VD: zoom, fade, none).
website_product_card_col_desktopintegerSố cột hiển thị sản phẩm trên desktop.
website_product_card_col_mobileintegerSố cột hiển thị sản phẩm trên mobile.
website_allow_cart_buy_nowintegerBật/tắt nút "Mua ngay" (1: Bật, 0: Tắt).

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

TrườngKiểuMô tả
website_product_detail_main_layoutstringLayout chính trang chi tiết sản phẩm.
website_product_detail_main_ratiostringTỷ lệ ảnh chính (VD: 1:1, 3:4).
website_product_detail_gallery_layoutstringLayout gallery ảnh sản phẩm (VD: slider, grid).
website_product_detail_thumbnail_positionstringVị trí thumbnail (VD: bottom, left).
website_product_detail_thumbnail_countintegerSố lượng thumbnail hiển thị.
website_product_detail_description_positionstringVị trí block mô tả sản phẩm.
website_product_detail_attribute_positionstringVị trí block thuộc tính (VD: tab, below).
website_product_detail_rating_summary_positionstringVị trí tóm tắt đánh giá.
website_product_detail_review_positionstringVị trí block đánh giá chi tiết.
website_product_detail_wishlist_positionstringVị trí nút yêu thích.
website_product_detail_price_positionstringVị trí hiển thị giá.
website_product_detail_promotion_positionstringVị trí hiển thị khuyến mãi.
website_product_detail_combo_columnstringSố cột hiển thị combo.
website_product_detail_combo_layoutstringLayout hiển thị combo (VD: grid, list).
website_product_detail_custom_cssstringCSS tùy chỉnh riêng cho trang chi tiết SP.
website_product_detail_custom_jsstringJavaScript tùy chỉnh riêng cho trang chi tiết SP.
website_product_suggestion_column_desktopintegerSố cột gợi ý sản phẩm trên desktop.
website_product_suggestion_column_mobileintegerSố cột gợi ý sản phẩm trên mobile.
website_product_suggestion_swiper_gap_desktopintegerKhoảng cách giữa các card gợi ý trên desktop (px).
website_product_suggestion_swiper_gap_mobileintegerKhoảng cách giữa các card gợi ý trên mobile (px).
website_product_suggestion_default_titlestringTiêu đề mặc định cho block gợi ý SP.
website_product_suggestion_typestringLoại gợi ý sản phẩm (VD: related, upsell, crosssell).

Giỏ hàng (Cart)

TrườngKiểuMô tả
website_cart_layoutstringLayout trang giỏ hàng.
website_cart_require_loginintegerYêu cầu đăng nhập để xem giỏ hàng (1: Có, 0: Không).

Thanh toán (Checkout)

TrườngKiểuMô tả
website_checkout_require_loginintegerYêu cầu đăng nhập để thanh toán (1: Có, 0: Không).
website_checkout_layout_ratiostringTỷ lệ layout trang checkout (VD: 6:4, 7:3).
website_checkout_coupon_positionstringVị trí ô nhập mã giảm giá.
website_checkout_block_detail_positionstringVị trí block chi tiết đơn hàng.
website_checkout_block_detail_layoutstringLayout block chi tiết.
website_checkout_block_billing_info_positionstringVị trí block thông tin thanh toán.
website_checkout_block_billing_info_modestringChế độ hiển thị thông tin thanh toán.
website_checkout_block_shipping_info_positionstringVị trí block thông tin giao hàng.
website_checkout_block_shipping_info_modestringChế độ hiển thị thông tin giao hàng.
website_checkout_block_shipping_service_modestringChế độ chọn dịch vụ vận chuyển.
website_checkout_block_payment_positionstringVị trí block phương thức thanh toán.
website_checkout_block_tax_positionstringVị trí block thuế.
website_checkout_block_tax_modestringChế độ hiển thị thuế.
website_checkout_block_summary_positionstringVị trí block tổng kết đơn hàng.
website_checkout_allow_pickup_at_storeintegerCho phép nhận hàng tại cửa hàng (1: Có, 0: Không).
website_checkout_login_onlyintegerChỉ cho phép checkout khi đã đăng nhập (1: Có, 0: Không).

Cổng thanh toán (Payment Gateways)

TrườngKiểuMô tả
website_payment_cod_enableintegerBật/tắt thanh toán COD.
website_payment_cod_amount_fromintegerGiá trị đơn tối thiểu cho COD (0: Không giới hạn).
website_payment_cod_amount_tointegerGiá trị đơn tối đa cho COD (0: Không giới hạn).
website_payment_momo_enableintegerBật/tắt thanh toán MoMo.
website_payment_momo_amount_fromintegerGiá trị đơn tối thiểu cho MoMo.
website_payment_momo_amount_tointegerGiá trị đơn tối đa cho MoMo.
website_payment_momo_endpoint_urlstringURL endpoint API MoMo.
website_payment_momo_partner_codestringMã đối tác MoMo.
website_payment_vnpay_enableintegerBật/tắt thanh toán VNPay.
website_payment_vnpay_amount_fromintegerGiá trị đơn tối thiểu cho VNPay.
website_payment_vnpay_amount_tointegerGiá trị đơn tối đa cho VNPay.
website_payment_vnpay_endpoint_urlstringURL endpoint API VNPay.
website_payment_vnpay_tmn_codestringTerminal code VNPay.
website_payment_vnpay_return_urlstringURL callback sau khi thanh toán VNPay.
website_payment_vnpayqr_enableintegerBật/tắt thanh toán VNPay QR.
website_payment_vnpayqr_amount_fromintegerGiá trị đơn tối thiểu cho VNPay QR.
website_payment_vnpayqr_amount_tointegerGiá trị đơn tối đa cho VNPay QR.
website_payment_vnpayqr_app_idstringApp ID VNPay QR.
website_payment_vnpayqr_merchant_namestringTên merchant VNPay QR.
website_payment_vnpayqr_merchant_codestringMã merchant VNPay QR.
website_payment_vnpayqr_terminal_idstringTerminal ID VNPay QR.
website_payment_vnpayqr_secret_keystringSecret key VNPay QR.
website_payment_vnpayqr_master_mer_codestringMaster merchant code VNPay QR.
website_payment_vnpayqr_merchant_typestringLoại merchant VNPay QR.
website_payment_vnpayqr_gen_qr_urlstringURL tạo mã QR VNPay.
website_payment_vnpayqr_check_trans_urlstringURL kiểm tra trạng thái giao dịch VNPay QR.
website_payment_vnpayqr_secret_key_check_transstringSecret key kiểm tra giao dịch VNPay QR.
website_payment_sepay_enableintegerBật/tắt thanh toán SePay.
website_payment_sepay_amount_fromintegerGiá trị đơn tối thiểu cho SePay.
website_payment_sepay_amount_tointegerGiá trị đơn tối đa cho SePay.
website_payment_sepay_account_bankstringSố tài khoản ngân hàng SePay.
website_payment_sepay_name_bankstringTên ngân hàng SePay.
website_payment_sepay_qr_code_urlstringURL mã QR thanh toán SePay.
website_payment_zalopay_enableintegerBật/tắt thanh toán ZaloPay.
website_payment_zalopay_amount_fromintegerGiá trị đơn tối thiểu cho ZaloPay.
website_payment_zalopay_amount_tointegerGiá trị đơn tối đa cho ZaloPay.
website_payment_banktransfer_enableintegerBật/tắt thanh toán chuyển khoản ngân hàng.
website_payment_banktransfer_amount_fromintegerGiá trị đơn tối thiểu cho chuyển khoản.
website_payment_banktransfer_amount_tointegerGiá trị đơn tối đa cho chuyển khoản.
website_payment_banktransfer_detailstringThông tin chi tiết chuyển khoản (STK, tên, nội dung).
website_price_policy_idintegerID chính sách giá áp dụng cho website (0: Giá mặc định).
website_filter_pricing_rangestringKhoảng giá cho bộ lọc (VD: 0-100000.100000-500000).

Khách hàng (Customer)

TrườngKiểuMô tả
website_order_default_customer_idintegerID khách hàng mặc định cho đơn hàng online (0: Không có).
website_checkout_create_new_customerintegerTự động tạo khách hàng mới khi checkout (1: Có, 0: Không).
website_customer_attribute_category_idintegerID nhóm thuộc tính mở rộng áp dụng cho khách hàng website.

Bán hàng & Thuế (Sale & Tax)

TrườngKiểuMô tả
default_product_tax_ratiofloatTỷ lệ thuế mặc định cho sản phẩm (VD: 0.1 = 10%).
product_price_including_taxintegerGiá sản phẩm đã bao gồm thuế (luôn là 1).

Cân nặng & Đơn vị (Weight & UOM)

TrườngKiểuMô tả
product_allow_multiple_avatarintegerHỗ trợ nhiều hình đại diện (1: Bật). Khi bật, hiệu ứng hover change_image dùng ảnh đại diện thứ 2 (thumbnails[1]).
product_weighted_uom_id_of_gramintegerID đơn vị tính cân nặng (gram).
product_weight_presetstringPreset cân nặng mặc định.

Vận chuyển (Shipping)

TrườngKiểuMô tả
shipping_using_new_regionintegerSử dụng hệ thống vùng miền mới (1: Có, 0: Không).
shipping_show_district_ward_legacyintegerHiển thị quận/huyện/phường kiểu cũ (1: Có, 0: Không).

Tiếp thị liên kết (Affiliate)

TrườngKiểuMô tả
affiliate_store_front_enableintegerBật/tắt affiliate trên storefront (1: Bật, 0: Tắt).
affiliate_store_front_show_linkintegerHiển thị link affiliate trên storefront (1: Có, 0: Không).
affiliate_register_enableintegerCho phép đăng ký affiliate (1: Có, 0: Không).
affiliate_register_auto_approveintegerTự động duyệt đăng ký affiliate (1: Có, 0: Không).
affiliate_register_auto_approve_code_liststringDanh sách mã tự động duyệt (cách nhau dấu phẩy).
affiliate_default_group_idintegerID nhóm affiliate mặc định.
affiliate_tracking_lifetime_dayintegerSố ngày cookie tracking affiliate có hiệu lực.
affiliate_commission_window_dayintegerSố ngày tính hoa hồng sau khi click.
affiliate_payout_min_amountintegerSố tiền tối thiểu để yêu cầu rút hoa hồng.
affiliate_payout_lock_mdayintegerNgày khóa thanh toán hoa hồng trong tháng.

On this page