Kết nối sàn TMĐT

EcomPlatform Object Schema

Đối tượng kênh bán hàng sàn TMĐT (gian hàng Shopee / Lazada / TikTok Shop đã kết nối)

JSON Schema

Trường (Field)Kiểu (Type)Mô tả (Description)
creator_idintID người kết nối
company_idintID công ty
idintID kênh (dùng làm :channelid trong các API đồng bộ)
titlestringTên kênh (mặc định lấy theo tên shop trên sàn khi kết nối)
urlstringLink gian hàng trên sàn (có thể rỗng)
typeintLoại sàn: 7 (Shopee), 9 (TikTok Shop), 11 (Lazada)
foreign_idstringID gian hàng phía sàn (Shopee shop_id, Lazada seller_id, TikTok Shop shop_id)
api_keystringLuôn rỗng với kênh sàn
api_secretstringLuôn rỗng với kênh sàn
access_tokenstringLuôn rỗng với kênh sàn (token do Hubport giữ, không trả ra)
refresh_tokenstringLuôn rỗng với kênh sàn
connectedint1 = đang kết nối được (có token hợp lệ); 0 = mất kết nối / cần uỷ quyền lại
storeintID cửa hàng Hubport gán cho đơn nhập từ kênh
settingsobjectCấu hình kênh (xem bên dưới)
statusint1 (Bật), 3 (Tắt). Kênh tắt không đồng bộ được (error_channel_disabled)
date_createdintThời gian kết nối (Unix timestamp)
date_modifiedintThời gian sửa đổi (Unix timestamp)
date_last_syncedintLần đồng bộ (sản phẩm / đơn) gần nhất (Unix timestamp)
date_last_order_syncedintMốc thời gian đã đồng bộ đơn tới (Unix timestamp)
date_last_hookedintLần nhận thông báo từ sàn gần nhất (Unix timestamp)
date_webhook_registeredintThời điểm đăng ký webhook (Unix timestamp)

settings

Do shop cấu hình (qua Cập nhật kênh):

KhoáKiểuMô tả
receipt_warehouseintID kho Hubport dùng cho đơn nhập từ kênh

Do Hubport quản lý (chỉ đọc; khoá bắt đầu bằng shopee_, lazada_, tiktok_ theo sàn, gửi lên khi sửa sẽ bị bỏ qua). Một số khoá hữu ích:

KhoáMô tả
shopee_access_expire_at, lazada_access_expire_at, tiktok_access_expire_atThời điểm token truy cập hết hạn (Unix timestamp, Hubport tự làm mới)
shopee_refresh_expire_at, lazada_refresh_expire_at, tiktok_refresh_expire_atThời điểm hết hạn uỷ quyền làm mới; sau mốc này shop phải kết nối lại
shopee_auth_expire_timeThời điểm uỷ quyền Shopee hết hạn
shopee_auth_expire_soon, lazada_auth_expire_soon, tiktok_auth_expire_soonCó giá trị khi sàn báo uỷ quyền sắp hết hạn
shopee_token_error, lazada_token_error, tiktok_token_errorCó giá trị khi token lỗi / bị thu hồi (khi đó connected = 0)
shopee_region, shopee_shop_statusKhu vực, trạng thái shop Shopee
lazada_short_code, lazada_account, lazada_seller_statusMã shop, tài khoản, trạng thái seller Lazada
tiktok_shop_name, tiktok_shop_code, tiktok_seller_nameTên, mã shop TikTok Shop
tiktok_webhook_errorLỗi khi đăng ký webhook TikTok Shop (nếu có)

Ví dụ JSON

{
  "creator_id": 5,
  "company_id": 1001,
  "id": 31,
  "title": "Shop Demo Official",
  "url": "https://shopee.vn/shop/123456789",
  "type": 7,
  "api_key": "",
  "api_secret": "",
  "foreign_id": "123456789",
  "access_token": "",
  "refresh_token": "",
  "connected": 1,
  "store": 2,
  "settings": {
    "receipt_warehouse": 3,
    "shopee_access_expire_at": 1760014400,
    "shopee_refresh_expire_at": 1762592000,
    "shopee_auth_expire_time": 1791536000,
    "shopee_region": "VN",
    "shopee_shop_status": "NORMAL"
  },
  "status": 1,
  "date_created": 1760000000,
  "date_modified": 1760000000,
  "date_last_synced": 1760003600,
  "date_last_order_synced": 1760003600,
  "date_last_hooked": 1760003000,
  "date_webhook_registered": 0
}

On this page