Skip to content

Instantly share code, notes, and snippets.

@caocuong2404
Last active January 26, 2026 07:47
Show Gist options
  • Select an option

  • Save caocuong2404/348ee728a371e11e66a63868a092ae0e to your computer and use it in GitHub Desktop.

Select an option

Save caocuong2404/348ee728a371e11e66a63868a092ae0e to your computer and use it in GitHub Desktop.
Kingflix Import Templates - Account, Customer, Product CSV templates

Import Templates - Kingflix

Quick Links (Google Sheets)

Tạo Google Sheets từ templates sau và share link cho client:

1. Account Import (Tài khoản share)

Template File: account-import-template.csv

Tạo Google Sheet:

  1. Vào https://sheets.google.com
  2. File → Import → Upload account-import-template.csv
  3. Share → Anyone with link → Editor
  4. Copy link gửi client

2. Customer Import (Khách hàng)

Template File: customer-import-template.csv

3. Product Import (Sản phẩm)

Template File: product-import-template.csv

Note: Medusa đã có built-in import trong Admin Panel


Files trong thư mục này

File Mô tả Status
account-import-template.csv Template import tài khoản Netflix, Disney+, etc. ✅ Ready
customer-import-template.csv Template import khách hàng ✅ Ready
product-import-template.csv Template import sản phẩm (Medusa format) ✅ Ready
IMPORT-GUIDE.md Hướng dẫn chi tiết các fields ✅ Ready

Workflow cho Client

1. Client mở Google Sheet (link được share)
2. Client điền data theo template
3. Client thông báo khi xong
4. Team export CSV từ Google Sheet
5. Import vào hệ thống

Notes

  • Encoding: Luôn export UTF-8
  • Date format: YYYY-MM-DD (2026-12-31)
  • JSON fields: Escape quotes với ""
  • Validation: Kiểm tra trước khi import

Contact

Team kỹ thuật Kingflix

product_id plan credential_login credential_password total_slots rotation_type rotation_day expires_at account_type metadata
prod_netflix Premium example@email.com SecurePass123 4 monthly 15 2026-12-31
prod_netflix Standard user2@email.com Pass456 2 monthly 1 2026-06-30
prod_disney Premium disney@email.com DisneyPass 4 monthly 10 2026-12-31
prod_spotify Family spotify@email.com SpotifyPass 6 monthly 5 2026-12-31 family {"owner_email":"owner@email.com","invite_link":"https://spotify.com/invite/xxx"}
prod_chatgpt Plus chatgpt@email.com GPTPass 1 daily 2026-12-31 shared
email first_name last_name phone has_account metadata
customer1@gmail.com Nguyen Van A 0901234567 true {"referral_code":"REF001","source":"facebook"}
customer2@gmail.com Tran Thi B 0912345678 true {"referral_code":"REF002","source":"zalo"}
customer3@gmail.com Le Van C 0923456789 false
customer4@gmail.com Pham Thi D 0934567890 true {"vip_level":"gold"}
guest@example.com Guest User false

Hướng Dẫn Import Dữ Liệu - Kingflix

📋 Tổng Quan

Hệ thống hỗ trợ import dữ liệu qua Google Sheets. Bạn chỉ cần điền data vào sheet được chia sẻ, team kỹ thuật sẽ import vào hệ thống.


🔗 Link Google Sheets

Loại Data Link Trạng Thái
Tài khoản Share Mở Sheet 🟡 Chờ link
Khách hàng Mở Sheet 🟡 Chờ link
Sản phẩm Dùng Admin Panel ✅ Có sẵn

⚠️ Lưu ý: Link sẽ được cập nhật sau khi tạo Google Sheets


📦 Template Import Tài Khoản Share

Các Cột Bắt Buộc

Cột Kiểu Mô Tả Ví Dụ
product_id text ID sản phẩm (lấy từ Admin) prod_netflix
plan text Gói dịch vụ Premium, Standard, Basic
credential_login text Email/Username đăng nhập account@gmail.com
credential_password text Mật khẩu MatKhau123!
total_slots số Số slot có thể share 4

Các Cột Tùy Chọn

Cột Kiểu Mặc định Mô Tả Ví Dụ
rotation_type text monthly Chu kỳ đổi pass monthly hoặc daily
rotation_day số trống Ngày đổi pass (1-31) 15
expires_at ngày trống Ngày hết hạn 2026-12-31
account_type text shared Loại tài khoản shared, family, team
metadata JSON trống Thông tin thêm xem bên dưới

📚 Giải Thích Chi Tiết

🏷️ product_id

  • Lấy từ: Admin Panel → Products → Copy Product ID
  • Ví dụ: prod_01HXXX... hoặc prod_netflix

📦 plan - Gói Dịch Vụ

Nhà cung cấp Các gói
Netflix Basic, Standard, Premium
Disney+ Standard, Premium
Spotify Individual, Duo, Family
ChatGPT Plus, Team
YouTube Individual, Family

🔢 total_slots - Số Slot

Loại Gói Số Slot
Basic/Individual 1
Standard/Duo 2
Premium 4
Family 5-6

🔄 rotation_type - Chu Kỳ Đổi Pass

  • monthly: Đổi pass hàng tháng (vào ngày rotation_day)
  • daily: Đổi pass hàng ngày

📁 account_type - Loại Tài Khoản

  • shared: Share thông thường (login/password)
  • family: Family plan (có invite link)
  • team: Team/Business plan
  • upgrade: Tài khoản khách hàng được nâng cấp

📝 metadata - Thông Tin Mở Rộng

Để trống nếu không cần. Nếu cần, điền JSON:

{"owner_email":"chu@email.com","invite_link":"https://..."}

Các key phổ biến:

  • owner_email: Email chủ tài khoản (family/team)
  • invite_link: Link mời (family/team)
  • twofa_secret: Mã 2FA
  • display_name: Tên hiển thị

⚠️ Quy Tắc Quan Trọng

✅ Đúng Format

Cột Format Đúng Ví Dụ
Ngày tháng YYYY-MM-DD 2026-12-31
Số Chỉ số, không có dấu 4
Email Email hợp lệ user@gmail.com

❌ Các Lỗi Thường Gặp

Lỗi Nguyên Nhân Cách Sửa
Product không tìm thấy product_id sai Kiểm tra lại ID trong Admin
Email trùng Account đã tồn tại Dùng email khác
Ngày sai format Ghi 31/12/2026 Đổi thành 2026-12-31
JSON lỗi Thiếu dấu ngoặc Kiểm tra lại cú pháp

📥 Quy Trình Import

1️⃣ Mở Google Sheet (link ở trên)
2️⃣ Điền data theo template
3️⃣ Thông báo team khi xong
4️⃣ Team kiểm tra và import
5️⃣ Nhận thông báo hoàn tất

💡 Lưu Ý Khi Dùng Google Sheets

  1. KHÔNG thay đổi tên cột (header row)
  2. KHÔNG merge cells
  3. KHÔNG thêm format màu sắc phức tạp
  4. Có thể thêm nhiều dòng data
  5. Để trống ô nếu không có data (cột optional)


👥 Template Import Khách Hàng

Các Cột

Cột Kiểu Bắt Buộc Mô Tả Ví Dụ
email text Email (không trùng) user@gmail.com
first_name text Họ Nguyen
last_name text Tên Van A
phone text Số điện thoại 0901234567
has_account text Có tài khoản đăng nhập true hoặc false
metadata JSON Thông tin thêm {"source":"facebook"}

metadata - Thông Tin Thêm

{"referral_code":"REF001","source":"facebook","vip_level":"gold"}

Các key:

  • referral_code: Mã giới thiệu
  • source: Nguồn (facebook, zalo, website, direct)
  • vip_level: Hạng VIP (silver, gold, platinum)
  • notes: Ghi chú nội bộ

🛒 Import Sản Phẩm

Medusa Admin đã có sẵn tính năng import sản phẩm:

  1. Vào Admin Panel → Products
  2. Click nút Import
  3. Tải template CSV và điền data
  4. Upload và xác nhận

⚙️ Lưu Ý Export Từ Google Sheets

Cách Export Đúng

  1. Vào File → Download → Comma Separated Values (.csv)
  2. Chọn sheet cần export
  3. Gửi file cho team kỹ thuật

Các Vấn Đề Có Thể Gặp

Vấn đề Nguyên nhân Cách fix
Ký tự lạ (à, ả, ã...) Encoding sai Team kỹ thuật sẽ handle
Số bị đổi format Excel/Sheets tự format Đặt cell format là Plain Text
Ngày bị đổi Sheets đổi format Nhập dạng text: '2026-12-31
JSON bị lỗi Dấu ngoặc kép Dùng single quote hoặc escape

Tips

  • ✅ Dùng format Plain Text cho cột credential_password
  • ✅ Dùng format Plain Text cho cột ngày tháng
  • ✅ Để trống ô thay vì ghi "null" hay "N/A"
  • ❌ KHÔNG dùng merge cells
  • ❌ KHÔNG thêm dòng trống giữa data

📞 Liên Hệ

Nếu có thắc mắc về import:

  • Gửi message qua Zalo/Telegram cho team kỹ thuật
  • Mô tả rõ vấn đề gặp phải
  • Gửi kèm screenshot nếu có lỗi
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 49 columns, instead of 50 in line 1.
Product Id,Product Handle,Product Title,Product Status,Product Description,Product Subtitle,Product External Id,Product Thumbnail,Product Collection Id,Product Type Id,Product Category 1,Product Discountable,Product Height,Product HS Code,Product Image 1,Product Image 2,Product Length,Product Material,Product MID Code,Product Origin Country,Product Tag 1,Product Tag 2,Product Sales Channel 1,Product Weight,Product Width,Variant Id,Variant Title,Variant SKU,Variant UPC,Variant EAN,Variant HS Code,Variant MID Code,Variant Manage Inventory,Variant Allow Backorder,Variant Barcode,Variant Height,Variant Length,Variant Material,Variant Option 1 Name,Variant Option 1 Value,Variant Option 2 Name,Variant Option 2 Value,Variant Origin Country,Variant Price USD,Variant Price VND,Variant Rank,Variant Weight,Variant Width,Shipping Profile Id
,netflix-premium,Netflix Premium,published,Tài khoản Netflix Premium 4K,Xem phim 4K không giới hạn,,https://example.com/netflix.jpg,,,pcat_streaming,true,,,https://example.com/netflix1.jpg,https://example.com/netflix2.jpg,,,,,ptag_streaming,ptag_netflix,sc_default,,,Netflix Premium - 1 Tháng,NFLX-PREM-1M,,,,,,true,false,,,,,,Gói,Premium,Thời hạn,1 Tháng,VN,,199000,0,,,
,netflix-premium,Netflix Premium,published,Tài khoản Netflix Premium 4K,Xem phim 4K không giới hạn,,https://example.com/netflix.jpg,,,pcat_streaming,true,,,https://example.com/netflix1.jpg,https://example.com/netflix2.jpg,,,,,ptag_streaming,ptag_netflix,sc_default,,,Netflix Premium - 3 Tháng,NFLX-PREM-3M,,,,,,true,false,,,,,,Gói,Premium,Thời hạn,3 Tháng,VN,,549000,1,,,
,netflix-premium,Netflix Premium,published,Tài khoản Netflix Premium 4K,Xem phim 4K không giới hạn,,https://example.com/netflix.jpg,,,pcat_streaming,true,,,https://example.com/netflix1.jpg,https://example.com/netflix2.jpg,,,,,ptag_streaming,ptag_netflix,sc_default,,,Netflix Premium - 12 Tháng,NFLX-PREM-12M,,,,,,true,false,,,,,,Gói,Premium,Thời hạn,12 Tháng,VN,,1999000,2,,,
,disney-premium,Disney+ Premium,published,Tài khoản Disney+ Premium,Xem phim Disney 4K,,https://example.com/disney.jpg,,,pcat_streaming,true,,,https://example.com/disney1.jpg,,,,,,ptag_streaming,ptag_disney,sc_default,,,Disney+ Premium - 1 Tháng,DISNEY-PREM-1M,,,,,,true,false,,,,,,Gói,Premium,Thời hạn,1 Tháng,VN,,149000,0,,,
,chatgpt-plus,ChatGPT Plus,published,Tài khoản ChatGPT Plus,Truy cập GPT-4 không giới hạn,,https://example.com/chatgpt.jpg,,,pcat_ai,true,,,https://example.com/chatgpt1.jpg,,,,,,ptag_ai,ptag_chatgpt,sc_default,,,ChatGPT Plus - 1 Tháng,GPT-PLUS-1M,,,,,,true,false,,,,,,Gói,Plus,Thời hạn,1 Tháng,US,,499000,0,,,
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment