Shopee, Shopee Ads và Shopee Affiliate (AMS)
Elton lấy dữ liệu shop Shopee qua Shopee Open Platform API. Elton chỉ đọc, không tạo hay sửa dữ liệu trên Shopee.
Ba source dưới đây có chung cách tạo và trao quyền. Mỗi source lấy một nhóm dữ liệu khác nhau:
| Source | Dùng khi muốn lấy | Dữ liệu |
|---|---|---|
| Shopee | Bán hàng và vận hành shop | Đơn hàng, thanh toán, vận chuyển, sản phẩm, đánh giá, trả hàng, kho SBS, sức khoẻ shop (mục 3) |
| Shopee Ads | Hiệu quả quảng cáo | Quảng cáo CPC, chiến dịch quảng cáo sản phẩm, chiến dịch GMS (mục 4) |
| Shopee Affiliate Marketing Solution | Tiếp thị liên kết (affiliate) | Đơn hàng từ affiliate, hiệu quả từng affiliate (mục 5) |
Shopee Brand Portal (tài khoản thương hiệu) là source riêng, không thuộc trang này.
1. Tạo data source và trao quyền
Bước 1: Tạo data source
- Vào Data Sources → Create data source, ở ô Type chọn Shopee, Shopee Ads hoặc Shopee Affiliate Marketing Solution.
- Điền form:
| Trường | Giá trị |
|---|---|
| Name | Tên hiển thị của source, ví dụ Elton Shopee |
| Description | Mô tả, không bắt buộc |
| Account name | Chỉ có ở Shopee và Shopee Affiliate Marketing Solution, không bắt buộc. Dùng làm hậu tố tên bảng ở destination (xem mục 3). Để trống thì Elton dùng tên shop trên Shopee |

- Bấm Create data source. Elton mở trang chi tiết của source vừa tạo.
Đặt Account name giúp tên bảng không đổi khi shop đổi tên trên Shopee. Đổi Account name của một source đã chạy thì các lần chạy sau ghi vào bảng mới; dữ liệu đã lấy vẫn nằm ở bảng cũ.
Bước 2: Trao quyền cho Elton
- Ở trang chi tiết source, bấm Authorize with Shopee (nếu source đã từng được trao quyền, nút này là Re-authorize).

- Elton chuyển sang trang đăng nhập của Shopee. Đăng nhập bằng một trong hai loại tài khoản:
- Shop Account: tài khoản của một shop.
- Main account: tài khoản quản lý nhiều shop. Sau khi trao quyền, bạn chọn shop cần lấy dữ liệu ở bước 3.

- Bấm Confirm Authorization để xác nhận cho Elton truy cập shop.

- Chọn thời hạn trao quyền (mặc định 365 ngày), rồi bấm Confirm Authorization.

- Shopee đưa bạn về trang chi tiết source. Mục Authorized shop hiện tên shop mà source đang lấy dữ liệu.
Bước 3: Chọn shop (khi tài khoản có nhiều shop)
Mỗi source lấy dữ liệu của đúng một shop. Khi lần trao quyền bao phủ nhiều shop, trang chi tiết source hiện thêm ô Shop to sync. Các trường hợp:
- Đăng nhập bằng Main account: mọi shop thuộc tài khoản.
- Shop chính SIP (Shopee International Platform): shop chính và các shop khu vực liên kết (ví dụ shop MY, SG). Shop khu vực hiện kèm mã khu vực, ví dụ
Testing Store (MY).
Elton tự chọn sẵn một shop: shop bạn đăng nhập, hoặc shop chính của tài khoản. Muốn lấy shop khác thì chọn trong Shop to sync. Lần chạy tiếp theo của mọi connection dùng source này sẽ lấy shop mới; dữ liệu đã lấy của shop cũ được giữ nguyên. Chỉ có một shop thì ô này không hiện.
- Lấy nhiều shop: tạo mỗi shop một source, trao quyền bằng cùng Main account, rồi chọn shop khác nhau ở Shop to sync của từng source.
- Trao quyền lại (Re-authorize) không đổi shop đang chọn. Shop mới mở sau lần trao quyền trước sẽ có trong danh sách sau khi trao quyền lại.
Tên bảng lấy theo Account name, hoặc theo tên shop nếu để trống (xem mục 3). Khi đổi shop:
- Account name để trống: dữ liệu shop mới vào bảng mới mang tên shop mới.
- Account name đã đặt: dữ liệu shop mới vào cùng bảng với shop cũ, và các bảng không có cột phân biệt shop. Hãy đổi Account name cùng lúc với đổi shop để mỗi shop có bảng riêng.
Khi hết thời hạn trao quyền, các lần chạy sẽ lỗi cho đến khi bạn bấm Re-authorize trên trang chi tiết source và làm lại bước 2. Nên đặt lịch trao quyền lại trước ngày hết hạn.
2. Tạo connection
Khi tạo connection với source là Shopee, Shopee Ads hoặc Shopee Affiliate Marketing Solution:
- Select 1 or many type of data: chọn loại dữ liệu cần lấy. Danh sách tuỳ theo source (xem mục 3, 4, 5). Mỗi loại là một bảng ở destination.
- First run loads from: ngày bắt đầu lấy dữ liệu ở lần chạy đầu tiên. Một số loại dữ liệu bị Shopee giới hạn số ngày lấy lại được. Nếu ngày bạn chọn cũ hơn giới hạn, Elton bắt đầu từ ngày cũ nhất được phép (xem cột Giới hạn ở từng mục).
- Later runs rescan: các lần chạy sau, Elton lấy tiếp từ mốc đã lấy ở lần trước, lùi lại số ngày này (1, 3, 7 hoặc 30 ngày). Nhờ vậy đơn đã đổi trạng thái, hay số liệu quảng cáo được Shopee tính lại, vẫn được cập nhật.
Một số loại dữ liệu không theo hai tuỳ chọn ngày ở trên: chúng được lấy toàn bộ mỗi lần chạy, hoặc có số ngày lấy lại cố định. Cột Cách lấy ở từng mục ghi rõ.
Bản ghi được cập nhật theo khoá của bảng: lấy lại cùng một bản ghi thì dòng cũ được thay, không bị nhân đôi.
3. Shopee: dữ liệu được đồng bộ
Bảng có tên dạng shopee_<loại>_<account name>, với account name là Account name của source, hoặc tên shop nếu để trống. Ví dụ shopee_order_detail_eltonshop.
| Loại dữ liệu | Bảng | Khoá | Cách lấy | Phân vùng (partition) theo ngày |
|---|---|---|---|---|
| Order | shopee_order_detail_<account name> | order_id | Đơn có update_time trong khoảng lấy | create_time |
| Payment Escrow | shopee_payment_escrow_detail_<account name> | order_id | Theo các đơn của Order | |
| Payment Escrow Listing | shopee_payment_escrow_listing_<account name> | order_id | Khoản tiền có thời điểm giải ngân trong khoảng lấy | |
| Payment Wallet Transaction | shopee_payment_wallet_transaction_<account name> | order_id, transaction_type, withdrawal_id, reason, create_time | Giao dịch có create_time trong khoảng lấy | create_time |
| Tracking Info | shopee_tracking_info_<account name> | order_id | Theo các đơn của Order | order_create_time |
| Tracking Number | shopee_tracking_number_<account name> | order_id | Đơn có update_time trong khoảng lấy, tối đa 180 ngày trước | |
| Product | shopee_product_<account name> | product_id | Toàn bộ sản phẩm, mỗi lần chạy | create_time |
shopee_product_extra_info_<account name> (tự thêm khi chọn Product) | product_id, elton_record_date | Snapshot mỗi ngày | elton_record_date | |
| Product Review | shopee_product_review_<account name> | comment_id | Đánh giá của toàn bộ sản phẩm, mỗi lần chạy | create_time |
| Return | shopee_return_<account name> | return_id | Yêu cầu trả hàng có update_time trong khoảng lấy | create_time |
| Return Detail | shopee_return_detail_<account name> | return_id | Theo các yêu cầu của Return | create_time |
| Return Reverse Tracking Info | shopee_return_reverse_tracking_info_<account name> | return_id | Theo các yêu cầu của Return | return_create_time |
| SBS Current Inventory | shopee_sbs_current_inventory_<account name> | warehouse_item_id, elton_record_date | Snapshot mỗi ngày | elton_record_date |
| SBS Stock Movement | shopee_sbs_stock_movement_<account name> | warehouse_item_id, record_date | Theo ngày, luôn lấy lại 7 ngày, tối đa 365 ngày trước | record_date |
| SBS Expiry Report | shopee_sbs_expiry_report_<account name> | warehouse_item_id, elton_record_date | Snapshot mỗi ngày | elton_record_date |
| SBS Stock Aging | shopee_sbs_stock_aging_<account name> | warehouse_item_id, elton_record_date | Snapshot mỗi ngày | elton_record_date |
shopee_sbs_bound_whs_info_<account name> (tự thêm khi chọn một loại SBS) | shop_id, whs_region | Toàn bộ, mỗi lần chạy | ||
| Account Health Shop Performance | shopee_account_health_shop_performance_<account name> | metric_id, elton_record_date | Snapshot mỗi ngày | elton_record_date |
"Snapshot mỗi ngày" nghĩa là mỗi lần chạy lấy trạng thái hiện tại và ghi kèm ngày chạy (elton_record_date). Chạy nhiều lần trong ngày thì dòng của ngày đó được thay bằng lần chạy mới nhất; các ngày trước được giữ lại, nên bạn xem được lịch sử theo ngày.
Trên BigQuery, cột dạng object hoặc danh sách được lưu dạng RECORD hoặc mảng (REPEATED), không phải một chuỗi JSON: ví dụ item_list, package_list, recipient_address là RECORD (dùng UNNEST để tách item_list), còn sku_list, tracking_info là mảng chuỗi JSON. Ở destination là cơ sở dữ liệu (MySQL, PostgreSQL, SQL Server), các cột này lưu dạng chuỗi JSON. Cột elton_created_at (thời điểm Elton lấy bản ghi) có trong danh sách cột của từng bảng, nhưng trên BigQuery chỉ được ghi khi connection dùng kiểu ghi Append. Với Merge (mặc định, cập nhật theo khoá) và Overwrite, bảng ở BigQuery không có cột này.
Order
Order lấy danh sách đơn có update_time trong khoảng lấy, rồi lấy chi tiết từng đơn. Đơn đổi trạng thái (giao xong, huỷ, trả hàng…) sẽ được cập nhật ở lần chạy sau.
| Cột | Ý nghĩa |
|---|---|
order_id | Mã đơn (order_sn trên Shopee) |
order_status | Trạng thái đơn: UNPAID, READY_TO_SHIP, PROCESSED, SHIPPED, COMPLETED, IN_CANCEL, CANCELLED, TO_RETURN… |
create_time, update_time, pay_time, ship_by_date, pickup_done_time | Thời điểm tạo, cập nhật, thanh toán, hạn giao, lấy hàng xong |
total_amount, currency, cod, payment_method | Tổng tiền, tiền tệ, có phải COD, phương thức thanh toán |
estimated_shipping_fee, actual_shipping_fee, actual_shipping_fee_confirmed, reverse_shipping_fee | Phí vận chuyển ước tính, thực tế, đã xác nhận chưa, phí vận chuyển chiều về |
shipping_carrier, checkout_shipping_carrier, days_to_ship | Đơn vị vận chuyển và số ngày chuẩn bị hàng |
buyer_user_id, buyer_username, recipient_address | Người mua và địa chỉ nhận (JSON: tên, SĐT, quận, thành phố, địa chỉ đầy đủ…) |
item_list | Sản phẩm trong đơn (JSON): item_id, item_sku, model_id, model_sku, số lượng, giá gốc, giá sau giảm, khuyến mãi |
package_list | Các kiện hàng (JSON): mã kiện, trạng thái vận chuyển, đơn vị vận chuyển |
cancel_by, cancel_reason, buyer_cancel_reason | Ai huỷ và lý do |
message_to_seller, note | Lời nhắn của người mua, ghi chú của shop |
Tất cả cột của shopee_order_detail_<account name>: order_id, region, currency, cod, total_amount, order_status, shipping_carrier, payment_method, estimated_shipping_fee, message_to_seller, create_time, update_time, days_to_ship, ship_by_date, buyer_user_id, buyer_username, recipient_address, actual_shipping_fee, goods_to_declare, note, note_update_time, item_list, pay_time, dropshipper, dropshipper_phone, split_up, buyer_cancel_reason, cancel_by, cancel_reason, actual_shipping_fee_confirmed, buyer_cpf_id, fulfillment_flag, pickup_done_time, package_list, invoice_data, checkout_shipping_carrier, reverse_shipping_fee, order_chargeable_weight_gram, edt_from, edt_to, prescription_images, prescription_check_status, pending_terms, pending_description, booking_sn, advance_package, return_request_due_date, can_full_cancel_order, can_partial_cancel_order, buyer_preference_for_partial_cancellation, affiliate_sample_type, elton_created_at
Các trường của mỗi sản phẩm trong item_list: item_id, item_name, item_sku, model_id, model_name, model_sku, model_quantity_purchased, model_original_price, model_discounted_price, wholesale, weight, add_on_deal, main_item, add_on_deal_id, promotion_type, promotion_id, order_item_id, promotion_group_id, image_info, product_location_id, is_prescription_item, is_b2c_owned_item, line_item_id, is_fulfillment_mapping, bundle_sku_id, components
Payment Escrow
Cần chọn cùng Order. Mỗi dòng là chi tiết doanh thu (escrow) của một đơn trong Order: số tiền shop nhận được và các khoản phí, giảm giá đã trừ.
| Cột | Ý nghĩa |
|---|---|
order_id, buyer_user_name | Mã đơn, người mua |
escrow_amount | Số tiền shop nhận được cho đơn |
buyer_total_amount, original_price | Tổng người mua trả, giá gốc |
seller_discount, shopee_discount, voucher_from_seller, voucher_from_shopee, coins | Giảm giá và voucher từ shop, từ Shopee, xu |
commission_fee, service_fee, seller_transaction_fee, campaign_fee, order_ams_commission_fee | Phí cố định, phí dịch vụ, phí thanh toán, phí chiến dịch, hoa hồng affiliate |
final_shipping_fee, actual_shipping_fee, shopee_shipping_rebate, buyer_paid_shipping_fee | Phí vận chuyển cuối cùng, thực tế, Shopee hỗ trợ, người mua trả |
seller_return_refund, drc_adjustable_refund | Tiền hoàn cho người mua khi trả hàng |
withholding_vat_tax, withholding_pit_tax, escrow_tax | Các khoản thuế bị khấu trừ |
items | Sản phẩm và giảm giá theo từng sản phẩm (JSON) |
Tất cả cột của shopee_payment_escrow_detail_<account name>: order_id, buyer_user_name, escrow_amount, buyer_total_amount, original_price, seller_discount, shopee_discount, voucher_from_seller, voucher_from_shopee, voucher_from_external_party, coins, buyer_paid_shipping_fee, buyer_transaction_fee, cross_border_tax, payment_promotion, commission_fee, service_fee, seller_transaction_fee, seller_lost_compensation, seller_coin_cash_back, escrow_tax, final_shipping_fee, final_return_to_seller_shipping_fee, actual_shipping_fee, order_chargeable_weight, shopee_shipping_rebate, shipping_fee_discount_from_3pl, seller_shipping_discount, estimated_shipping_fee, seller_voucher_code, drc_adjustable_refund, cost_of_goods_sold, original_cost_of_goods_sold, original_shopee_discount, seller_return_refund, items, escrow_amount_pri, buyer_total_amount_pri, original_price_pri, seller_return_refund_pri, commission_fee_pri, service_fee_pri, drc_adjustable_refund_pri, pri_currency, aff_currency, exchange_rate, reverse_shipping_fee, final_product_protection, credit_card_promotion, credit_card_transaction_fee, final_product_vat_tax, final_shipping_vat_tax, campaign_fee, sip_subsidy, sip_subsidy_pri, rsf_seller_protection_fee_claim_amount, rsf_seller_protection_fee_premium_amount, delivery_seller_protection_fee_premium_amount, shipping_seller_protection_fee_amount, final_escrow_product_gst, final_escrow_shipping_gst, buyer_payment_method, instalment_plan, order_ams_commission_fee, sales_tax_on_lvg, withholding_tax, overseas_return_service_fee, prorated_coins_value_offset_return_items, prorated_shopee_voucher_offset_return_items, prorated_seller_voucher_offset_return_items, prorated_payment_channel_promo_bank_offset_return_items, prorated_payment_channel_promo_shopee_offset_return_items, fsf_seller_protection_fee_claim_amount, vat_on_imported_goods, withholding_vat_tax, withholding_pit_tax, withholding_cit_tax, seller_order_processing_fee, buyer_paid_packaging_fee, trade_in_bonus_seller, ads_escrow_top_up_fee_or_technical_support_fee, pay_per_sale, promotion_list, sspl_fee, elton_created_at
Bảng này còn có cột payout_amount và escrow_release_time nhưng chúng luôn trống. Số tiền và thời điểm giải ngân nằm ở bảng shopee_payment_escrow_listing_<account name>.
Payment Escrow Listing
Danh sách khoản tiền đã giải ngân về ví shop, theo thời điểm giải ngân. Không cần chọn Order.
| Cột | Ý nghĩa |
|---|---|
order_id | Mã đơn |
payout_amount | Số tiền giải ngân |
escrow_release_time | Thời điểm giải ngân |
Tất cả cột của shopee_payment_escrow_listing_<account name>: order_id, payout_amount, escrow_release_time, elton_created_at
Payment Wallet Transaction
Giao dịch của ví người bán Shopee: tiền đơn hàng về ví, rút tiền, điều chỉnh…
| Cột | Ý nghĩa |
|---|---|
create_time | Thời điểm giao dịch |
transaction_type, status, money_flow | Loại giao dịch, trạng thái, tiền vào hay ra |
amount, current_balance, transaction_fee | Số tiền, số dư sau giao dịch, phí |
order_id, refund_sn | Đơn hoặc yêu cầu hoàn tiền liên quan |
withdrawal_id, withdrawal_type, root_withdrawal_id | Thông tin lệnh rút tiền |
reason, description | Lý do và mô tả |
Tất cả cột của shopee_payment_wallet_transaction_<account name>: status, transaction_type, amount, current_balance, create_time, order_id, refund_sn, withdrawal_type, transaction_fee, description, buyer_name, shop_name, withdrawal_id, reason, root_withdrawal_id, transaction_tab_type, money_flow, pay_order_list, elton_created_at
Tracking Info và Tracking Number
- Tracking Info cần chọn cùng Order. Elton lấy hành trình theo từng mã đơn, nên mỗi đơn có một dòng (khoá
order_id):order_id,package_number(kiện hàng Shopee trả về),logistics_status,tracking_info(các mốc vận chuyển, JSON) và hành trình chiều về nếu có (reversed_tracking_number,reversed_courier_name,reversed_tracking_info). - Tracking Number lấy mã vận đơn:
order_id,tracking_number,first_mile_tracking_number,pickup_code. Loại này tự lấy danh sách đơn riêng (theoupdate_time, tối đa 180 ngày trước), không cần chọn Order.
Khi chọn Tracking Number, connection hiện thêm ô Tracking number ignore status: các trạng thái đơn được bỏ qua, cách nhau bằng dấu phẩy, ví dụ UNPAID,CANCELLED. Giá trị hợp lệ xem ở tham số order_status trong tài liệu của Shopee. Danh sách này cũng áp dụng cho Tracking Info. Đơn chưa được Shopee phân bổ vận chuyển, hay chưa có kiện hàng, được bỏ qua và lấy lại ở lần chạy sau.
Tất cả cột của shopee_tracking_info_<account name>: order_id, package_number, logistics_status, tracking_info, reversed_tracking_number, reversed_courier_name, reversed_tracking_info, order_create_time, elton_created_at
Tất cả cột của shopee_tracking_number_<account name>: order_id, tracking_number, first_mile_tracking_number, hint, pickup_code, elton_created_at
Product
Product lấy toàn bộ sản phẩm của shop mỗi lần chạy, gồm cả sản phẩm đã ẩn, bị khoá hoặc đã xoá (NORMAL, UNLIST, BANNED, REVIEWING, SELLER_DELETE, SHOPEE_DELETE). Không lấy theo ngày, vì tồn kho thay đổi khi có đơn mà Shopee không cập nhật update_time của sản phẩm. First run loads from và Later runs rescan không áp dụng.
Bảng shopee_product_<account name>:
| Cột | Ý nghĩa |
|---|---|
product_id, item_name, item_sku, category_id, brand | Mã, tên, SKU, danh mục, thương hiệu |
item_status | Trạng thái sản phẩm (xem ở trên) |
create_time, update_time | Thời điểm tạo, cập nhật |
price_info | Giá gốc và giá hiện tại (JSON) |
stock_info_v2 | Tồn kho (JSON) |
has_model, product_model | Có phân loại không, và danh sách phân loại (màu, size…) kèm giá, tồn kho từng phân loại (JSON) |
weight, dimension, logistic_info | Cân nặng, kích thước, các đơn vị vận chuyển bật cho sản phẩm |
attribute_list, image, video_info, description | Thuộc tính, ảnh, video, mô tả |
Bảng shopee_product_extra_info_<account name> (tự lấy khi chọn Product) là snapshot mỗi ngày của: sale (đã bán), views, likes, rating_star, comment_count. Dùng để theo dõi lượt xem và lượt bán theo ngày.
Tất cả cột của shopee_product_<account name>: product_id, category_id, item_name, description, item_sku, create_time, update_time, weight, dimension, condition, size_chart, item_status, deboost, has_model, is_fulfillment_by_shopee, promotion_id, has_promotion, item_dangerous, gtin_code, size_chart_id, compatibility_info, attribute_list, image, promotion_image, logistic_info, pre_order, wholesales, video_info, brand, price_info, stock_info, stock_info_v2, product_model, elton_created_at
Tất cả cột của shopee_product_extra_info_<account name>: product_id, sale, views, likes, rating_star, comment_count, elton_record_date, elton_created_at
Product Review
Đánh giá của toàn bộ sản phẩm, lấy lại mỗi lần chạy. Phản hồi của shop được cập nhật vào đánh giá cũ.
| Cột | Ý nghĩa |
|---|---|
comment_id, item_id, order_sn | Mã đánh giá, sản phẩm, đơn |
rating_star, comment | Số sao, nội dung |
buyer_username, create_time | Người đánh giá, thời điểm |
comment_reply | Phản hồi của shop (JSON) |
hidden, editable | Bị ẩn, còn sửa được không |
Tất cả cột của shopee_product_review_<account name>: order_sn, comment_id, comment, buyer_username, item_id, rating_star, editable, hidden, create_time, comment_reply, elton_created_at
Return, Return Detail, Return Reverse Tracking Info
Return lấy yêu cầu trả hàng/hoàn tiền có update_time trong khoảng lấy. Return Detail và Return Reverse Tracking Info lấy thêm thông tin cho từng yêu cầu đó. Chọn hai loại này mà không chọn Return thì Elton vẫn lấy danh sách trả hàng để biết cần lấy gì, nhưng không ghi bảng return.
shopee_return_<account name>:return_id,order_id,status,reason,text_reason,refund_amount,amount_before_discount,currency,create_time,update_time,due_date,tracking_number,item(sản phẩm trả, JSON),user(người mua, JSON), trạng thái tranh chấp và thương lượng,return_solution,return_refund_type.shopee_return_detail_<account name>: mọi cột trên, thêm bằng chứng của shop (seller_proof), bồi thường (seller_compensation), địa chỉ lấy và trả hàng, trạng thái vận chuyển chiều về, bên chịu phí vận chuyển (shipping_fee_responsibility). Lấy lâu hơn Return vì gọi API cho từng yêu cầu.shopee_return_reverse_tracking_info_<account name>: hành trình vận chuyển chiều về:reverse_logistics_status,tracking_number,tracking_info(JSON), ngày giao dự kiến, và hành trình sau khi trả (post_return_logistics_status,rts_tracking_number). Yêu cầu chỉ hoàn tiền, hoặc chưa gửi hàng về, không có dòng ở bảng này.
Tất cả cột của shopee_return_<account name>: return_id, order_id, create_time, update_time, reason, text_reason, refund_amount, currency, status, due_date, tracking_number, dispute_reason, dispute_text_reason, needs_logistics, amount_before_discount, return_ship_due_date, return_seller_due_date, negotiation_status, seller_proof_status, seller_compensation_status, user, item, image, buyer_videos, return_refund_type, return_solution, validation_type, is_arrived_at_warehouse, is_partial_quantity_return, is_refund_amount_adjusted, elton_created_at
Tất cả cột của shopee_return_detail_<account name>: image, buyer_videos, reason, text_reason, reassessed_request_reason, return_id, refund_amount, currency, create_time, update_time, status, due_date, tracking_number, dispute_reason, dispute_text_reason, needs_logistics, amount_before_discount, user, item, order_id, return_ship_due_date, return_seller_due_date, activity, seller_proof, seller_compensation, negotiation, logistics_status, reverse_logistics_status, return_pickup_address, virtual_contact_number, package_query_number, return_address, return_refund_type, return_solution, is_seller_arrange, is_shipping_proof_mandatory, has_uploaded_shipping_proof, is_reverse_logistics_channel_integrated, reverse_logistics_channel_name, return_refund_request_type, validation_type, is_arrived_at_warehouse, follow_up_action_list, is_partial_quantity_return, is_refund_amount_adjusted, shipping_fee_responsibility, shipping_fee_responsibility_reason, elton_created_at
Tất cả cột của shopee_return_reverse_tracking_info_<account name>: return_id, return_refund_request_type, validation_type, reverse_logistics_status, reverse_logistics_update_time, estimated_delivery_date_max, estimated_delivery_date_min, collection_pin_code, tracking_number, tracking_info, post_return_logistics_status, post_return_logistics_update_time, rts_tracking_number, post_return_logistics_tracking_info, return_create_time, elton_created_at
SBS (kho Shopee)
Chỉ dành cho shop dùng dịch vụ kho SBS (Service by Shopee). Elton lấy danh sách kho của shop (bảng shopee_sbs_bound_whs_info_<account name>: shop_id, whs_region, whs_ids), rồi lấy dữ liệu của từng vùng kho.
| Loại | Mỗi dòng là |
|---|---|
| SBS Current Inventory | Tồn kho hiện tại của một mặt hàng trong kho, snapshot mỗi ngày |
| SBS Stock Movement | Nhập, xuất, tồn của một mặt hàng trong một ngày (record_date) |
| SBS Expiry Report | Hạn sử dụng của hàng trong kho, snapshot mỗi ngày |
| SBS Stock Aging | Tuổi tồn kho (hàng nằm kho bao lâu), snapshot mỗi ngày |
Các bảng SBS có cột warehouse_item_id, item_name, item_image và sku_list: số liệu theo từng SKU, lưu dạng JSON.
SBS Stock Movement luôn lấy lại 7 ngày gần nhất mỗi lần chạy, không theo Later runs rescan. Shopee chỉ trả 365 ngày gần nhất.
Tất cả cột của shopee_sbs_bound_whs_info_<account name>: shop_id, whs_region, whs_ids, elton_created_at
Tất cả cột của shopee_sbs_current_inventory_<account name>: warehouse_item_id, item_name, item_image, sku_list, elton_record_date, elton_created_at
Tất cả cột của shopee_sbs_stock_movement_<account name>: warehouse_item_id, item_name, item_image, sku_list, record_date, elton_created_at
Tất cả cột của shopee_sbs_expiry_report_<account name>: warehouse_item_id, item_name, item_image, sku_list, elton_record_date, elton_created_at
Tất cả cột của shopee_sbs_stock_aging_<account name>: warehouse_item_id, item_name, item_image, sku_list, elton_record_date, elton_created_at
Account Health Shop Performance
Chỉ số sức khoẻ shop (như trong Shopee Seller Centre → Sức khoẻ shop), snapshot mỗi ngày. Mỗi dòng là một chỉ số.
| Cột | Ý nghĩa |
|---|---|
metric_id, metric_name, parent_metric_id, metric_type | Chỉ số và nhóm của nó |
current_period, last_period, unit | Giá trị kỳ này, kỳ trước, đơn vị |
target_value, target_comparator | Mục tiêu Shopee đặt ra và cách so sánh |
overall_rating, overall_fulfillment_failed, overall_listing_failed, overall_custom_service_failed | Đánh giá chung và số chỉ số không đạt ở từng nhóm |
Tất cả cột của shopee_account_health_shop_performance_<account name>: shop_id, metric_id, parent_metric_id, metric_type, metric_name, current_period, last_period, unit, target_value, target_comparator, exemption_end_date, overall_rating, overall_fulfillment_failed, overall_listing_failed, overall_custom_service_failed, elton_record_date, elton_created_at
4. Shopee Ads: dữ liệu được đồng bộ
Bảng có tên dạng shopee_<loại>_<tên shop>. Số liệu quảng cáo của những ngày gần đây còn được Shopee tính lại, nên Elton lấy lại theo Later runs rescan.
| Loại dữ liệu | Bảng | Khoá | Cách lấy | Giới hạn | Phân vùng theo ngày |
|---|---|---|---|---|---|
| CPC Ads Daily Performance | shopee_cpc_ads_daily_performance_<tên shop> | date | Theo ngày | 180 ngày trước | date |
| CPC Ads Hourly Performance | shopee_cpc_ads_hourly_performance_<tên shop> | date, hour_interval | Theo giờ | 180 ngày trước | date |
| Product Campaign Daily Performance | shopee_product_campaign_daily_performance_<tên shop> | date, campaign_id | Theo ngày, lấy lại ít nhất 7 ngày | 180 ngày trước | date |
| Product Campaign Hourly Performance | shopee_product_campaign_hourly_performance_<tên shop> | date, hour_interval, campaign_id | Theo giờ, lấy lại ít nhất 7 ngày | 180 ngày trước | date |
| GMS Campaign Daily Performance | shopee_gms_campaign_daily_performance_<tên shop> | record_date, campaign_id | Theo ngày | 90 ngày trước | record_date |
| GMS Item Daily Performance | shopee_gms_item_daily_performance_<tên shop> | record_date, campaign_id, item_id | Theo ngày | 180 ngày trước | record_date |
"Giới hạn" là số ngày cũ nhất Shopee cho lấy. First run loads from cũ hơn thì Elton bắt đầu từ mốc đó.
CPC Ads Daily / Hourly Performance
Tổng số liệu quảng cáo CPC (trả tiền theo click) của cả shop, theo ngày hoặc theo giờ (hour_interval, 0–23).
| Cột | Ý nghĩa |
|---|---|
impression, clicks, ctr | Lượt hiển thị, lượt click, tỉ lệ click |
expense | Chi phí quảng cáo |
direct_order, direct_item_sold, direct_gmv, direct_conversions, direct_roas | Đơn, sản phẩm bán, doanh thu, chuyển đổi, ROAS trực tiếp (mua đúng sản phẩm được quảng cáo) |
broad_order, broad_item_sold, broad_gmv, broad_conversions, broad_roas | Như trên nhưng gián tiếp (mua bất kỳ sản phẩm nào của shop sau khi click) |
cost_per_conversion | Chi phí cho mỗi chuyển đổi |
Tất cả cột của shopee_cpc_ads_daily_performance_<tên shop>: date, impression, clicks, ctr, direct_order, broad_order, direct_conversions, broad_conversions, direct_item_sold, broad_item_sold, direct_gmv, broad_gmv, expense, cost_per_conversion, direct_roas, broad_roas, elton_created_at
Tất cả cột của shopee_cpc_ads_hourly_performance_<tên shop>: date, hour_interval, impression, clicks, ctr, direct_order, broad_order, direct_conversions, broad_conversions, direct_item_sold, broad_item_sold, direct_gmv, broad_gmv, expense, cost_per_conversion, direct_roas, broad_roas, elton_created_at
Product Campaign Daily / Hourly Performance
Số liệu từng chiến dịch quảng cáo sản phẩm. Elton lấy danh sách chiến dịch của shop trước, rồi lấy số liệu từng chiến dịch. Shopee còn cập nhật số liệu trong khoảng một tuần, nên Elton luôn lấy lại ít nhất 7 ngày dù Later runs rescan chọn ít hơn.
| Cột | Ý nghĩa |
|---|---|
campaign_id, ad_name, ad_type, campaign_placement | Chiến dịch, tên, loại quảng cáo, vị trí hiển thị |
date, hour_interval | Ngày, và giờ (chỉ ở bảng hourly) |
metrics | Số liệu của chiến dịch (JSON): hiển thị, click, chi phí, đơn, doanh thu, ROAS… |
campaign_setting_info | Cài đặt chiến dịch (JSON): ngân sách, thời gian chạy, sản phẩm, từ khoá… |
Tất cả cột của shopee_product_campaign_daily_performance_<tên shop>: date, campaign_id, ad_type, campaign_placement, ad_name, campaign_setting_info, metrics, elton_created_at
Tất cả cột của shopee_product_campaign_hourly_performance_<tên shop>: date, hour_interval, campaign_id, ad_type, campaign_placement, ad_name, campaign_setting_info, metrics, elton_created_at
GMS Campaign / Item Daily Performance
Số liệu chiến dịch GMS theo ngày: cả chiến dịch (Campaign), hoặc từng sản phẩm trong chiến dịch (Item, thêm cột item_id).
| Cột | Ý nghĩa |
|---|---|
record_date, campaign_id | Ngày, chiến dịch |
impression, clicks, expense, cpc | Hiển thị, click, chi phí, chi phí mỗi click |
direct_order, direct_order_amount, direct_cr, direct_roi, direct_cir | Đơn, doanh thu, tỉ lệ chuyển đổi, ROI, tỉ lệ chi phí/doanh thu trực tiếp |
broad_order, broad_order_amount, broad_gmv, broad_roi, broad_cir | Như trên nhưng gián tiếp |
cr, cpdc | Tỉ lệ chuyển đổi, chi phí mỗi chuyển đổi trực tiếp |
Tất cả cột của shopee_gms_campaign_daily_performance_<tên shop>: record_date, campaign_id, broad_cir, broad_order, broad_gmv, broad_order_amount, broad_roi, clicks, expense, cpc, cpdc, cr, direct_cr, direct_cir, direct_order, direct_order_amount, direct_roi, impression, elton_created_at
Tất cả cột của shopee_gms_item_daily_performance_<tên shop>: record_date, campaign_id, item_id, broad_cir, broad_order, broad_gmv, broad_order_amount, broad_roi, clicks, expense, cpc, cpdc, cr, direct_cr, direct_cir, direct_order, direct_order_amount, direct_roi, impression, elton_created_at
5. Shopee Affiliate (AMS)
Source Shopee Affiliate Marketing Solution lấy dữ liệu từ Shopee AMS Open API.
Khi tạo connection:
- Select 1 or many type of data: chọn một hoặc cả hai loại dữ liệu:
- AMS Conversion Report: từng đơn hàng đến từ affiliate.
- AMS Affiliate Performance: số liệu theo ngày của từng affiliate.
- Affiliate Performance Order Type (chỉ hiện khi chọn AMS Affiliate Performance): loại đơn dùng để tính số liệu, mặc định
PlacedOrder. Các giá trị khác xem ở tham sốorder_typetrong tài liệu của Shopee. - First run loads from: ngày bắt đầu lấy ở lần chạy đầu tiên.
Hai loại dữ liệu AMS luôn lấy lại 3 ngày mỗi lần chạy, không theo Later runs rescan. Shopee chỉ trả dữ liệu AMS khoảng 3 tháng gần nhất: nếu First run loads from cũ hơn 85 ngày, Elton bắt đầu từ 85 ngày trước, và dữ liệu cũ hơn không lấy được.
Bảng có tên dạng shopee_<loại>_<account name>, như ở mục 3.
| Loại dữ liệu | Bảng | Khoá | Phân vùng (partition) theo ngày |
|---|---|---|---|
| AMS Conversion Report | shopee_ams_conversion_report_<account name> | order_id, affiliate_id | place_order_time |
| AMS Affiliate Performance | shopee_ams_affiliate_performance_<account name> | record_date, affiliate_id | record_date |
AMS Conversion Report
Mỗi dòng là một đơn hàng của một affiliate. Elton lấy đơn theo cả 4 mốc thời gian: đặt hàng, hoàn thành đơn, hoàn thành chuyển đổi và khấu trừ AMS. Nhờ vậy đơn đặt từ trước nhưng mới hoàn thành vẫn được cập nhật.
| Cột | Ý nghĩa |
|---|---|
order_id | Mã đơn hàng |
order_status, verified_status | Trạng thái đơn và trạng thái xác minh (verified) của đơn trên AMS |
place_order_time, order_completed_time, conversion_completed_time | Thời điểm đặt hàng, hoàn thành đơn, hoàn thành chuyển đổi |
affiliate_id, affiliate_name, affiliate_username, linked_mcn | Affiliate mang lại đơn và MCN của affiliate |
order_brand_commission | Hoa hồng của shop cho đơn |
channel, order_type, buyer_status, campaign_partner | Kênh, loại đơn, người mua mới hay cũ, đối tác chiến dịch |
items | Danh sách sản phẩm trong đơn (JSON) |
Tất cả cột của shopee_ams_conversion_report_<account name>: order_id, order_status, verified_status, place_order_time, order_completed_time, conversion_completed_time, affiliate_id, affiliate_name, affiliate_username, linked_mcn, order_brand_commission, channel, order_type, buyer_status, campaign_partner, items, elton_created_at
AMS Affiliate Performance
Mỗi dòng là số liệu một ngày (record_date) của một affiliate, gộp mọi kênh.
| Cột | Ý nghĩa |
|---|---|
record_date | Ngày của số liệu |
affiliate_id, affiliate_name, affiliate_username | Affiliate |
sales, items_sold, orders | Doanh số, số sản phẩm bán, số đơn |
clicks | Số lượt click |
est_commission, roi | Hoa hồng ước tính và ROI |
total_buyers, new_buyers | Tổng số người mua và số người mua mới |
Tất cả cột của shopee_ams_affiliate_performance_<account name>: record_date, affiliate_id, affiliate_name, affiliate_username, sales, items_sold, orders, clicks, est_commission, roi, total_buyers, new_buyers, elton_created_at
6. Quan hệ giữa các bảng
Các bảng Shopee nối với nhau qua mã đơn, mã sản phẩm, mã trả hàng, mã chiến dịch và mã affiliate. Bảng của Shopee, Shopee Ads và Shopee Affiliate Marketing Solution nối được với nhau khi cùng một shop và cùng một destination. Hậu tố <account name> / <tên shop> ở các bảng cần nối phải là của cùng một shop.
| Bảng | Nối với bảng | Điều kiện nối | Quan hệ |
|---|---|---|---|
shopee_order_detail_<account name> | shopee_payment_escrow_detail_<account name> | order_id = order_id | 1 đơn – 1 dòng doanh thu |
shopee_order_detail_<account name> | shopee_payment_escrow_listing_<account name> | order_id = order_id | 1 đơn – tối đa 1 lần giải ngân |
shopee_order_detail_<account name> | shopee_payment_wallet_transaction_<account name> | order_id = order_id | 1 đơn – nhiều giao dịch ví |
shopee_order_detail_<account name> | shopee_tracking_info_<account name> | order_id = order_id | 1 đơn – 1 dòng hành trình |
shopee_order_detail_<account name> | shopee_tracking_number_<account name> | order_id = order_id | 1 đơn – 1 mã vận đơn |
shopee_order_detail_<account name> | shopee_return_<account name> | order_id = order_id | 1 đơn – nhiều yêu cầu trả hàng |
shopee_order_detail_<account name> | shopee_product_<account name> | item_list[].item_id = product_id (trên BigQuery: UNNEST(item_list)) | nhiều sản phẩm trong 1 đơn |
shopee_order_detail_<account name> | shopee_product_review_<account name> | order_id = order_sn | 1 đơn – nhiều đánh giá |
shopee_order_detail_<account name> | shopee_ams_conversion_report_<account name> | order_id = order_id | 1 đơn – các affiliate mang lại đơn |
shopee_return_<account name> | shopee_return_detail_<account name> | return_id = return_id | 1 – 1 |
shopee_return_<account name> | shopee_return_reverse_tracking_info_<account name> | return_id = return_id | 1 – 0 hoặc 1 |
shopee_product_<account name> | shopee_product_extra_info_<account name> | product_id = product_id | 1 sản phẩm – 1 dòng mỗi ngày |
shopee_product_<account name> | shopee_product_review_<account name> | product_id = item_id | 1 sản phẩm – nhiều đánh giá |
shopee_product_<account name> | shopee_gms_item_daily_performance_<tên shop> | product_id = item_id | 1 sản phẩm – 1 dòng mỗi ngày, mỗi chiến dịch |
shopee_gms_campaign_daily_performance_<tên shop> | shopee_gms_item_daily_performance_<tên shop> | campaign_id = campaign_id và record_date = record_date | 1 chiến dịch-ngày – nhiều sản phẩm |
shopee_product_campaign_daily_performance_<tên shop> | shopee_product_campaign_hourly_performance_<tên shop> | campaign_id = campaign_id và date = date | 1 chiến dịch-ngày – 24 giờ |
shopee_cpc_ads_daily_performance_<tên shop> | shopee_cpc_ads_hourly_performance_<tên shop> | date = date | 1 ngày – 24 giờ |
shopee_ams_affiliate_performance_<account name> | shopee_ams_conversion_report_<account name> | affiliate_id = affiliate_id | 1 affiliate – nhiều đơn |
shopee_sbs_current_inventory_<account name> | shopee_sbs_stock_movement_<account name>, shopee_sbs_expiry_report_<account name>, shopee_sbs_stock_aging_<account name> | warehouse_item_id = warehouse_item_id | Cùng một mặt hàng trong kho |
Lưu ý khi nối:
order_idtrong mọi bảng là mã đơn Shopee (order_sn), dạng chuỗi như240101ABCDEF12. Riêngshopee_product_review_<account name>gọi cột này làorder_sn.- Mã sản phẩm có tên khác nhau:
product_idởshopee_product_<account name>,item_idở các bảng còn lại. - Ví dụ trên BigQuery, tổng doanh thu shop nhận theo ngày đặt hàng:
SELECT DATE(o.create_time) AS order_date,
SUM(e.escrow_amount) AS escrow_amount
FROM `dataset.shopee_order_detail_eltonshop` o
JOIN `dataset.shopee_payment_escrow_detail_eltonshop` e
ON e.order_id = o.order_id
WHERE o.order_status = 'COMPLETED'
GROUP BY order_date
ORDER BY order_date;
7. Lỗi thường gặp
| Lỗi | Nguyên nhân và cách xử lý |
|---|---|
Datasource is not authorized! Please go to the datasource and authorize! | Source chưa được trao quyền. Mở source, bấm Authorize with Shopee và làm theo bước 2. |
Cannot refresh access token! … please try re-authorizing. | Quyền đã hết hạn (theo thời hạn bạn chọn khi trao quyền) hoặc đã bị thu hồi trên Shopee. Bấm Re-authorize ở trang chi tiết source. |
Shopee internal server error! Please try again later! | Shopee lỗi tạm thời; Elton đã tự thử lại nhiều lần. Chạy lại connection sau ít phút. |
ads_rate_limit_total_api | Shopee Ads giới hạn số lần gọi API quảng cáo và shop đã chạm giới hạn. Giảm tần suất chạy, hoặc bớt loại dữ liệu hourly, rồi chạy lại sau. |
No data to load found! Please select data to load in Connection configuration! | Connection chưa chọn loại dữ liệu nào. Sửa connection và chọn ở Select 1 or many type of data. |
| Dữ liệu là của shop khác với mong muốn | Tài khoản có nhiều shop và source đang lấy shop mặc định. Chọn đúng shop ở Shop to sync (bước 3). |
Shop <id> is not covered by this Shopee authorization | Shop được chọn không còn thuộc lần trao quyền hiện tại. Bấm Re-authorize, rồi chọn lại shop. |
Could not get a Shopee token for the selected shop | Shopee không cấp quyền cho shop vừa chọn. Kiểm tra shop còn hoạt động và thuộc tài khoản đã đăng nhập, rồi bấm Re-authorize. |
A token refresh is already running for this datasource, please try again in a moment | Elton đang làm mới quyền truy cập cho source. Đợi vài giây rồi chọn shop lại. |
| Bảng mới xuất hiện, dữ liệu mới không vào bảng cũ | Account name, tên shop (nếu để trống Account name), hoặc shop ở Shop to sync đã đổi. Xem bước 1 và bước 3. |
| Payment Escrow / Tracking Info không có dữ liệu | Hai loại này lấy theo các đơn của Order. Hãy chọn cả Order trong connection. |
| Bảng SBS trống | Shop không dùng kho SBS của Shopee. |
Cách tính Billable Pipeline
Cách tính phí theo số pipeline của từng loại source xem ở đây.
Template báo cáo
Hướng dẫn tạo báo cáo từ mẫu có sẵn của Elton trên Looker Studio xem ở đây.