← Tất cả tích hợp

Kết nối KiotViet với omniVN

Có thể kết nối

Kết nối theo ngành hàng: Retail/F&B dùng OAuth client credentials; Salon/Hotel dùng PublicApiKey.

Kết nối KiotVietTạo tài khoản và làm theo hướng dẫn bên dưới — dùng thử 14 ngày.

Tổng quan

KiotViet có bốn Public API riêng theo ngành hàng (Retail, F&B, Salon, Hotel). Host và cách xác thực khác nhau — không dùng chung một client. Retail/F&B: OAuth2 client credentials + header Retailer + Authorization Bearer. Salon/Hotel: header PublicApiKey, không gọi id.kiotviet.vn.

Điều kiện trước khi bắt đầu

  • Quyền quản trị cửa hàng KiotViet và gói Cao cấp (Salon/Hotel).
  • Chọn đúng ngành hàng trong Omni0 trước khi điền credential.

Các bước lấy credential

1. Chọn ngành hàng (industry)

Retail (bán lẻ/sỉ): public.kiotapi.com. F&B (quán/cafe/nhà hàng): publicfnb.kiotapi.com. Salon (spa/làm đẹp): api-integration-booking.kiotviet.vn. Hotel: api-integration-hotel.kiotviet.vn. Chọn đúng giá trị trong Omni0 — mặc định là retail nếu bỏ trống.

2. Retail / F&B — retailer và OAuth

Retailer là mã cửa hàng (subdomain đăng nhập). Lấy client_id và client_secret từ Thiết lập kết nối API trong admin. POST token URL theo ngành: Retail → id.kiotviet.vn/connect/token (scope PublicApi.Access); F&B → api.fnb.kiotviet.vn/identity/connect/token (scope PublicApi.Access.FNB). Gọi API với header Retailer và Authorization: Bearer {access_token}. F&B: doanh thu/GMV lấy qua GET publicfnb.kiotapi.com/invoices (invoiceDetails); không có GET /orders — POST /orders/create chỉ để tạo đơn.

3. Salon / Hotel — PublicApiKey

Lấy PublicApiKey trong cài đặt API của cửa hàng Salon/Hotel. Gửi header PublicApiKey và Accept: application/json tới host tích hợp tương ứng (đường dẫn /public/...). Không dùng OAuth và không POST id.kiotviet.vn.

4. Điền vào Omni0

Integrations → KiotViet. Chọn Industry. Retail/F&B: Retailer code + client_id/client_secret hoặc access_token. Salon/Hotel: Public API key. Base URL tùy chọn (chỉ khi KiotViet hướng dẫn override).

Ánh xạ credential với omniVN

Cột "Lấy từ đâu" cho biết giá trị do người dùng nhập, do provider cấp, do omniVN quản lý, hay do OAuth sinh ra.
Field omniVNTên trong tài liệu officialBắt buộcLấy từ đâu
IndustryNgành hàng KiotVietTùy chọnuser_entered
Retailer codeMã cửa hàng (retailer)Tùy chọnuser_entered
Client IDclient_idTùy chọnuser_entered
Client secretclient_secretTùy chọnuser_entered
Access tokenaccess_tokenTùy chọnprovider_generated
Public API keyPublicApiKeyTùy chọnuser_entered
Base URLAPI base URLTùy chọnuser_entered

industry → ngành hàng (retail | fnb | salon | hotel); retailer → Retailer code (Retail/F&B); clientId/clientSecret → OAuth; accessToken → token sẵn có (Retail/F&B); publicApiKey → PublicApiKey (Salon/Hotel); baseUrl → Base URL (tùy chọn).

Vòng đời token

Retail/F&B: access_token có TTL; khi 401, lấy lại bằng client credentials. Salon/Hotel: PublicApiKey tĩnh, không có token URL.

Lỗi thường gặp

Lỗi xác thực 401 với Salon/Hotel

Sai industry (đang để retail), dùng OAuth thay vì PublicApiKey, hoặc gửi PublicApiKey tới public.kiotapi.com.

Lỗi xác thực 401 với Retail/F&B

Retailer sai, client_secret không khớp, access_token hết hạn, hoặc thiếu scope Public API.

Nguồn chính thức

Hướng dẫn sử dụng KiotViet - Retail kết nối API - Public API
kiotviet.vn·Công khai·Đã kiểm chứng 2026-09-01
KiotViet F&B Public API
kiotviet.vn·Công khai·Đã kiểm chứng 2026-09-01
KiotViet Salon kết nối API
kiotviet.vn·Công khai·Đã kiểm chứng 2026-09-01
KiotViet Hotel kết nối API
kiotviet.vn·Công khai·Đã kiểm chứng 2026-09-01