> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nekt.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Shopee as a data source

> Bring data from Shopee to Nekt.

Shopee is one of Southeast Asia and Latin America's leading e-commerce platforms, providing a marketplace for sellers to list products and manage orders. The Shopee Open Platform API enables access to your seller data including products, orders, advertising campaigns, and shop performance metrics.

<img width="200" src="https://mintcdn.com/nekt/btkzzvcs8sJfG8zh/assets/logo/logo-shopee.jpeg?fit=max&auto=format&n=btkzzvcs8sJfG8zh&q=85&s=44d4a1b9b7effe017e02def3cb859aab" data-path="assets/logo/logo-shopee.jpeg" />

## Configuring Shopee as a Source

In the [Sources](https://app.nekt.ai/sources) tab, click on the "Add source" button located on the top right of your screen. Then, select the Shopee option from the list of connectors.

Click **Next** and you'll be prompted to add your access.

### 1. Add account access

You'll need to authorize Nekt to access your Shopee seller data. Click on the **Shopee Authorization** button and log in with your Shopee seller account. Grant the necessary permissions for the shop you want to extract data from.

The following configurations are available:

* **API URL**: Select the appropriate API endpoint for your region:
  * `https://partner.shopeemobile.com` - Global (Southeast Asia)
  * `https://openplatform.shopee.com.br` - Brazil
  * `https://openplatform.shopee.cn` - China

* **Start Date**: The earliest date from which records will be synced. If not provided, all available historical data will be extracted.

<Warning>
  Make sure you have the correct API permissions enabled in your Shopee Partner account. The connector requires access to Product, Order, Payment, and Ads APIs depending on which streams you select.
</Warning>

Once you're done, click **Next**.

### 2. Select streams

Choose which data streams you want to sync. For faster extractions, select only the streams that are relevant to your analysis. You can select entire groups of streams or pick specific ones.

> Tip: The stream can be found more easily by typing its name.

Select the streams and click **Next**.

### 3. Configure data streams

Customize how you want your data to appear in your catalog. Select the desired layer where the data will be placed, a folder to organize it inside the layer, a name for each table (which will effectively contain the fetched data) and the type of sync.

* **Layer**: choose between the existing layers on your catalog. This is where you will find your new extracted tables as the extraction runs successfully.
* **Folder**: a folder can be created inside the selected layer to group all tables being created from this new data source.
* **Table name**: we suggest a name, but feel free to customize it. You have the option to add a **prefix** to all tables at once and make this process faster!
* **Sync Type**: you can choose between INCREMENTAL and FULL\_TABLE.
  * Incremental: every time the extraction happens, we'll get only the new data - which is good if, for example, you want to keep every record ever fetched.
  * Full table: every time the extraction happens, we'll get the current state of the data - which is good if, for example, you don't want to have deleted data in your catalog.

Once you are done configuring, click **Next**.

### 4. Configure data source

Describe your data source for easy identification within your organization, not exceeding 140 characters.

To define your [Trigger](https://docs.nekt.com/runs/scheduling-and-triggers), consider how often you want data to be extracted from this source. This decision usually depends on how frequently you need the new table data updated (every day, once a week, or only at specific times).

Optionally, you can define some additional settings:

* Configure Delta Log Retention and determine for how long we should store old states of this table as it gets updated. Read more about this resource [here](https://docs.nekt.com/get-started/core-concepts/resource-control).
* Determine when to execute an **Additional [Full Sync](https://docs.nekt.com/get-started/core-concepts/types-of-sync#additional-full-sync)**. This will complement the incremental data extractions, ensuring that your data is completely synchronized with your source every once in a while.

Once you are ready, click **Next** to finalize the setup.

### 5. Check your new source

You can view your new source on the [Sources](https://app.nekt.ai/sources) page. If needed, manually trigger the source extraction by clicking on the arrow button. Once executed, your data will appear in your Catalog.

<Warning>For you to be able to see it on your [Catalog](https://app.nekt.ai/catalog), you need at least one successful source run.</Warning>

# Streams and Fields

Below you'll find all available data streams from Shopee and their corresponding fields:

<AccordionGroup>
  <Accordion title="Products">
    Complete product catalog with detailed information including pricing, inventory, media, and attributes.

    | Field                      | Type    | Description                                                                                                                                                                                                                                 |
    | :------------------------- | :------ | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
    | `item_id`                  | Integer | Unique identifier for the product                                                                                                                                                                                                           |
    | `item_name`                | String  | Product name/title                                                                                                                                                                                                                          |
    | `item_sku`                 | String  | SKU code                                                                                                                                                                                                                                    |
    | `description`              | String  | Product description                                                                                                                                                                                                                         |
    | `description_type`         | String  | Type of description                                                                                                                                                                                                                         |
    | `category_id`              | Integer | Category identifier                                                                                                                                                                                                                         |
    | `condition`                | String  | Product condition (new, used)                                                                                                                                                                                                               |
    | `item_status`              | String  | Current status (NORMAL, BANNED, UNLIST, REVIEWING, SELLER\_DELETE, SHOPEE\_DELETE)                                                                                                                                                          |
    | `create_time`              | Integer | When the product was created (Unix timestamp)                                                                                                                                                                                               |
    | `update_time`              | Integer | When the product was last updated (Unix timestamp)                                                                                                                                                                                          |
    | `price_info`               | Array   | Price information per currency with currency, original\_price, current\_price, inflated\_price\_of\_original\_price, inflated\_price\_of\_current\_price, sip\_item\_price, sip\_item\_price\_source, local\_price, local\_promotion\_price |
    | `image`                    | Object  | Product images with image\_id\_list, image\_url\_list, image\_ratio                                                                                                                                                                         |
    | `video_info`               | Array   | Product videos with video\_url, thumbnail\_url, duration                                                                                                                                                                                    |
    | `promotion_image`          | Array   | Promotional images                                                                                                                                                                                                                          |
    | `attribute_list`           | Array   | Product attributes with attribute\_id, original\_attribute\_name, is\_mandatory, attribute\_value\_list                                                                                                                                     |
    | `weight`                   | Float   | Product weight                                                                                                                                                                                                                              |
    | `dimension`                | Object  | Package dimensions with package\_length, package\_width, package\_height                                                                                                                                                                    |
    | `logistic_info`            | Array   | Logistics options with logistic\_id, logistic\_name, enabled, shipping\_fee, size\_id, is\_free, estimated\_shipping\_fee                                                                                                                   |
    | `stock_info_v2`            | Object  | Detailed stock information with summary\_info, seller\_stock, shopee\_stock (includes if\_saleable), advance\_stock                                                                                                                         |
    | `brand`                    | Object  | Brand information with brand\_id, original\_brand\_name                                                                                                                                                                                     |
    | `gtin_code`                | String  | GTIN/EAN barcode                                                                                                                                                                                                                            |
    | `authorised_brand_id`      | Integer | Authorized brand ID                                                                                                                                                                                                                         |
    | `ssp_id`                   | String  | SSP identifier                                                                                                                                                                                                                              |
    | `pre_order`                | Object  | Pre-order settings with is\_pre\_order, days\_to\_ship                                                                                                                                                                                      |
    | `wholesales`               | Array   | Wholesale pricing tiers with min\_count, max\_count, unit\_price, inflated\_price\_of\_unit\_price                                                                                                                                          |
    | `purchase_limit_info`      | Object  | Purchase limits with min\_purchase\_limit, max\_purchase\_limit                                                                                                                                                                             |
    | `deboost`                  | String  | Whether product is deboost (visibility reduced)                                                                                                                                                                                             |
    | `has_model`                | Boolean | Whether product has variations/models                                                                                                                                                                                                       |
    | `has_promotion`            | Boolean | Whether currently on promotion                                                                                                                                                                                                              |
    | `promotion_id`             | Integer | Active promotion ID                                                                                                                                                                                                                         |
    | `is_fulfillment_by_shopee` | Boolean | Whether fulfilled by Shopee (FBS)                                                                                                                                                                                                           |
    | `item_dangerous`           | Integer | Dangerous goods indicator                                                                                                                                                                                                                   |
    | `scheduled_publish_time`   | Integer | Scheduled publish time (Unix timestamp)                                                                                                                                                                                                     |
    | `size_chart`               | String  | Size chart content                                                                                                                                                                                                                          |
    | `size_chart_id`            | Integer | Size chart identifier                                                                                                                                                                                                                       |
    | `tag`                      | Object  | Product tags with kit flag                                                                                                                                                                                                                  |
    | `description_info`         | Object  | Extended description with extended\_description containing field\_list                                                                                                                                                                      |
    | `compatibility_info`       | Object  | Vehicle compatibility with vehicle\_info\_list                                                                                                                                                                                              |
    | `tax_info`                 | Object  | Tax details by region (ncm, cfop codes, tax rates for Brazil; vat\_rate for Poland; hs\_code for India; tax\_type for Taiwan)                                                                                                               |
    | `complaint_policy`         | Object  | Warranty and complaint settings with warranty\_time, exclude\_entrepreneur\_warranty, complaint\_address\_id, additional\_information                                                                                                       |
    | `certification_info`       | Object  | Product certifications with certification\_list containing permit\_id, certification\_no, expiry\_date, certification\_proofs                                                                                                               |
  </Accordion>

  <Accordion title="FBS Stock">
    FBS (Fulfillment by Shopee) warehouse stock per product and warehouse location.

    | Field         | Type    | Description                                          |
    | :------------ | :------ | :--------------------------------------------------- |
    | `item_id`     | Integer | Identifier of the associated item.                   |
    | `location_id` | String  | Shopee warehouse location identifier.                |
    | `stock`       | Integer | Stock quantity available at this warehouse location. |
    | `if_saleable` | Boolean | Whether the warehouse stock is ready for sale.       |
  </Accordion>

  <Accordion title="Orders">
    Complete order details including buyer information, items, payments, and shipping.

    | Field                           | Type    | Description                                                                                                                                                                                                                                                                                                                                   |
    | :------------------------------ | :------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | `order_sn`                      | String  | Unique order serial number                                                                                                                                                                                                                                                                                                                    |
    | `order_status`                  | String  | Order status                                                                                                                                                                                                                                                                                                                                  |
    | `region`                        | String  | Order region/country                                                                                                                                                                                                                                                                                                                          |
    | `currency`                      | String  | Order currency                                                                                                                                                                                                                                                                                                                                |
    | `cod`                           | Boolean | Cash on delivery flag                                                                                                                                                                                                                                                                                                                         |
    | `total_amount`                  | Float   | Total order amount                                                                                                                                                                                                                                                                                                                            |
    | `message_to_seller`             | String  | Buyer's message                                                                                                                                                                                                                                                                                                                               |
    | `pending_terms`                 | Array   | Array of pending terms                                                                                                                                                                                                                                                                                                                        |
    | `pending_description`           | Array   | Array of pending descriptions                                                                                                                                                                                                                                                                                                                 |
    | `create_time`                   | Integer | Order creation time (Unix timestamp)                                                                                                                                                                                                                                                                                                          |
    | `update_time`                   | Integer | Last update time (Unix timestamp, replication key)                                                                                                                                                                                                                                                                                            |
    | `pay_time`                      | Integer | Payment time                                                                                                                                                                                                                                                                                                                                  |
    | `ship_by_date`                  | Integer | Ship by deadline                                                                                                                                                                                                                                                                                                                              |
    | `days_to_ship`                  | Integer | Days allowed to ship                                                                                                                                                                                                                                                                                                                          |
    | `note_update_time`              | Integer | When seller note was last updated                                                                                                                                                                                                                                                                                                             |
    | `buyer_user_id`                 | Integer | Buyer's user ID                                                                                                                                                                                                                                                                                                                               |
    | `buyer_username`                | String  | Buyer's username                                                                                                                                                                                                                                                                                                                              |
    | `buyer_cpf_id`                  | String  | Buyer's CPF (Brazil)                                                                                                                                                                                                                                                                                                                          |
    | `recipient_address`             | Object  | Delivery address with name, phone, full\_address, town, district, city, state, region, zipcode, geolocation                                                                                                                                                                                                                                   |
    | `item_list`                     | Array   | Ordered items with item\_id, item\_name, item\_sku, model\_id, model\_name, model\_sku, model\_quantity\_purchased, model\_original\_price, model\_discounted\_price, weight, wholesale, add\_on\_deal info, promotion details, order\_item\_id, image\_info, product\_location\_id, prescription flags, consultation\_id, hot\_listing\_item |
    | `shipping_carrier`              | String  | Carrier name                                                                                                                                                                                                                                                                                                                                  |
    | `checkout_shipping_carrier`     | String  | Selected carrier at checkout                                                                                                                                                                                                                                                                                                                  |
    | `estimated_shipping_fee`        | Float   | Estimated shipping cost                                                                                                                                                                                                                                                                                                                       |
    | `actual_shipping_fee`           | Float   | Actual shipping cost                                                                                                                                                                                                                                                                                                                          |
    | `actual_shipping_fee_confirmed` | Boolean | Fee confirmation status                                                                                                                                                                                                                                                                                                                       |
    | `reverse_shipping_fee`          | Float   | Return shipping fee                                                                                                                                                                                                                                                                                                                           |
    | `order_chargeable_weight_gram`  | Integer | Chargeable weight                                                                                                                                                                                                                                                                                                                             |
    | `fulfillment_flag`              | String  | Fulfillment type                                                                                                                                                                                                                                                                                                                              |
    | `pickup_done_time`              | Integer | Pickup completion time                                                                                                                                                                                                                                                                                                                        |
    | `goods_to_declare`              | Boolean | Customs declaration required                                                                                                                                                                                                                                                                                                                  |
    | `package_list`                  | Array   | Packages with package\_number, logistics\_status, logistics\_channel\_id, shipping\_carrier, allow\_self\_design\_awb, item\_list, parcel\_chargeable\_weight, parcel\_chargeable\_weight\_gram, group\_shipment\_id, virtual\_contact\_number, package\_query\_number, sorting\_group                                                        |
    | `payment_method`                | String  | Payment method                                                                                                                                                                                                                                                                                                                                |
    | `payment_info`                  | Array   | Payment details with payment\_method, payment\_processor\_register, card\_brand, transaction\_id, payment\_amount                                                                                                                                                                                                                             |
    | `cancel_by`                     | String  | Who cancelled                                                                                                                                                                                                                                                                                                                                 |
    | `cancel_reason`                 | String  | Cancellation reason                                                                                                                                                                                                                                                                                                                           |
    | `buyer_cancel_reason`           | String  | Buyer's cancellation reason                                                                                                                                                                                                                                                                                                                   |
    | `invoice_data`                  | Object  | Invoice details with number, series\_number, access\_key, issue\_date, total\_value, products\_total\_value, tax\_code                                                                                                                                                                                                                        |
    | `prescription_images`           | Array   | Array of prescription image URLs                                                                                                                                                                                                                                                                                                              |
    | `prescription_check_status`     | String  | Check status                                                                                                                                                                                                                                                                                                                                  |
    | `pharmacist_name`               | String  | Pharmacist name                                                                                                                                                                                                                                                                                                                               |
    | `prescription_approval_time`    | Integer | Approval time                                                                                                                                                                                                                                                                                                                                 |
    | `prescription_rejection_time`   | Integer | Rejection time                                                                                                                                                                                                                                                                                                                                |
    | `edt_from`                      | Integer | Estimated delivery time from                                                                                                                                                                                                                                                                                                                  |
    | `edt_to`                        | Integer | Estimated delivery time to                                                                                                                                                                                                                                                                                                                    |
    | `booking_sn`                    | String  | Booking serial number                                                                                                                                                                                                                                                                                                                         |
    | `advance_package`               | Boolean | Advance package flag                                                                                                                                                                                                                                                                                                                          |
    | `dropshipper`                   | String  | Dropshipper name                                                                                                                                                                                                                                                                                                                              |
    | `dropshipper_phone`             | String  | Dropshipper phone                                                                                                                                                                                                                                                                                                                             |
    | `note`                          | String  | Seller notes                                                                                                                                                                                                                                                                                                                                  |
    | `split_up`                      | Boolean | Order split flag                                                                                                                                                                                                                                                                                                                              |
    | `return_request_due_date`       | Integer | Return request deadline                                                                                                                                                                                                                                                                                                                       |
    | `is_buyer_shop_collection`      | Boolean | Shop collection flag                                                                                                                                                                                                                                                                                                                          |
    | `buyer_proof_of_collection`     | Array   | Array of collection proof images                                                                                                                                                                                                                                                                                                              |
    | `hot_listing_order`             | Boolean | Hot listing order flag                                                                                                                                                                                                                                                                                                                        |
  </Accordion>

  <Accordion title="Escrow Details">
    Financial breakdown per order, including marketplace commission data.

    | Field                  | Type   | Description                          |
    | :--------------------- | :----- | :----------------------------------- |
    | `order_sn`             | String | Order serial number.                 |
    | `buyer_user_name`      | String | Buyer username                       |
    | `buyer_payment_info`   | Object | Buyer payment information.           |
    | `order_income`         | Object | Order income breakdown.              |
    | `return_order_sn_list` | Array  | List of return order serial numbers. |
  </Accordion>

  <Accordion title="Product Analytics">
    Product engagement and sales metrics.

    | Field           | Type    | Description                |
    | :-------------- | :------ | :------------------------- |
    | `item_id`       | Integer | Product identifier         |
    | `sale`          | Integer | Total sales count          |
    | `views`         | Integer | Number of product views    |
    | `likes`         | Integer | Number of likes/favorites  |
    | `rating_star`   | Float   | Average rating             |
    | `comment_count` | Integer | Number of reviews/comments |
  </Accordion>
</AccordionGroup>

# Use Cases for Data Analysis

This guide outlines valuable business intelligence use cases when consolidating Shopee data, along with ready-to-use SQL queries that you can run on [Explorer](https://app.nekt.ai/explorer).

### 1. Product Performance Overview

Analyze product performance combining catalog data with engagement metrics.

**Business Value:**

* Identify best-selling and most-viewed products
* Understand conversion from views to sales
* Optimize product listings based on engagement

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      WITH product_metrics AS (
         SELECT
            p.item_id,
            p.item_name,
            p.item_status,
            p.category_id,
            pa.sale AS total_sales,
            pa.views AS total_views,
            pa.likes AS total_likes,
            pa.rating_star,
            pa.comment_count,
            CASE 
               WHEN pa.views > 0 THEN ROUND(pa.sale * 100.0 / pa.views, 2)
               ELSE 0 
            END AS conversion_rate
         FROM
            nekt_raw.shopee_products p
            LEFT JOIN nekt_raw.shopee_product_analytics pa ON p.item_id = pa.item_id
         WHERE
            p.item_status = 'NORMAL'
      )
      SELECT
         item_id,
         item_name,
         total_sales,
         total_views,
         total_likes,
         rating_star,
         comment_count,
         conversion_rate
      FROM
         product_metrics
      ORDER BY
         total_sales DESC
      LIMIT 50
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      WITH product_metrics AS (
         SELECT
            p.item_id,
            p.item_name,
            p.item_status,
            p.category_id,
            pa.sale AS total_sales,
            pa.views AS total_views,
            pa.likes AS total_likes,
            pa.rating_star,
            pa.comment_count,
            CASE 
               WHEN pa.views > 0 THEN ROUND(SAFE_DIVIDE(pa.sale * 100.0, pa.views), 2)
               ELSE 0 
            END AS conversion_rate
         FROM
            `nekt_raw.shopee_products` p
            LEFT JOIN `nekt_raw.shopee_product_analytics` pa ON p.item_id = pa.item_id
         WHERE
            p.item_status = 'NORMAL'
      )
      SELECT
         item_id,
         item_name,
         total_sales,
         total_views,
         total_likes,
         rating_star,
         comment_count,
         conversion_rate
      FROM
         product_metrics
      ORDER BY
         total_sales DESC
      LIMIT 50
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | item\_id  | item\_name                 | total\_sales | total\_views | total\_likes | rating\_star | comment\_count | conversion\_rate |
  | --------- | -------------------------- | ------------ | ------------ | ------------ | ------------ | -------------- | ---------------- |
  | 123456789 | Wireless Bluetooth Earbuds | 2,450        | 45,230       | 1,890        | 4.8          | 856            | 5.42             |
  | 234567890 | Phone Case Premium         | 1,890        | 32,450       | 1,234        | 4.6          | 423            | 5.82             |
  | 345678901 | USB-C Fast Charger         | 1,567        | 28,900       | 987          | 4.7          | 312            | 5.42             |
  | 456789012 | Screen Protector Pack      | 1,234        | 18,450       | 567          | 4.5          | 234            | 6.69             |
</Accordion>

### 2. Order Status Analysis

Track order distribution by status to monitor fulfillment health.

**Business Value:**

* Monitor order processing efficiency
* Identify bottlenecks in fulfillment
* Track cancellation rates and reasons

<Accordion title="SQL query">
  <Tabs>
    <Tab title="AWS">
      ```sql theme={null}
      WITH order_stats AS (
         SELECT
            order_status,
            COUNT(*) AS order_count,
            SUM(total_amount) AS total_revenue,
            AVG(total_amount) AS avg_order_value
         FROM
            nekt_raw.shopee_orders
         WHERE
            FROM_UNIXTIME(create_time) >= CURRENT_DATE - INTERVAL '30' DAY
         GROUP BY
            order_status
      ),
      total AS (
         SELECT SUM(order_count) AS total_orders FROM order_stats
      )
      SELECT
         os.order_status,
         os.order_count,
         ROUND(os.order_count * 100.0 / t.total_orders, 2) AS percentage,
         ROUND(os.total_revenue, 2) AS total_revenue,
         ROUND(os.avg_order_value, 2) AS avg_order_value
      FROM
         order_stats os, total t
      ORDER BY
         os.order_count DESC
      ```
    </Tab>

    <Tab title="GCP">
      ```sql theme={null}
      WITH order_stats AS (
         SELECT
            order_status,
            COUNT(*) AS order_count,
            SUM(total_amount) AS total_revenue,
            AVG(total_amount) AS avg_order_value
         FROM
            `nekt_raw.shopee_orders`
         WHERE
            TIMESTAMP_SECONDS(create_time) >= TIMESTAMP_SUB(CURRENT_TIMESTAMP(), INTERVAL 30 DAY)
         GROUP BY
            order_status
      ),
      total AS (
         SELECT SUM(order_count) AS total_orders FROM order_stats
      )
      SELECT
         os.order_status,
         os.order_count,
         ROUND(SAFE_DIVIDE(os.order_count * 100.0, t.total_orders), 2) AS percentage,
         ROUND(os.total_revenue, 2) AS total_revenue,
         ROUND(os.avg_order_value, 2) AS avg_order_value
      FROM
         order_stats os, total t
      ORDER BY
         os.order_count DESC
      ```
    </Tab>
  </Tabs>
</Accordion>

<Accordion title="Sample Result">
  | order\_status   | order\_count | percentage | total\_revenue | avg\_order\_value |
  | --------------- | ------------ | ---------- | -------------- | ----------------- |
  | COMPLETED       | 1,245        | 62.25      | 89,234.50      | 71.67             |
  | SHIPPED         | 456          | 22.80      | 31,245.00      | 68.52             |
  | READY\_TO\_SHIP | 189          | 9.45       | 14,523.00      | 76.84             |
  | CANCELLED       | 110          | 5.50       | 7,856.00       | 71.42             |
</Accordion>

## Implementation Notes

<AccordionGroup>
  <Accordion title="Timestamps">
    Shopee uses Unix timestamps (seconds since epoch) for date/time fields. To convert in queries:

    ```sql theme={null}
    -- AWS Athena
    FROM_UNIXTIME(create_time) AS created_at

    -- GCP BigQuery
    TIMESTAMP_SECONDS(create_time) AS created_at
    ```
  </Accordion>

  <Accordion title="Regional API Endpoints">
    The connector supports multiple regional API endpoints:

    * **Global (SEA)**: Singapore, Malaysia, Thailand, Vietnam, Philippines, Indonesia, Taiwan
    * **Brazil**: Specific endpoint for Brazilian marketplace
    * **China**: Mainland China operations

    Make sure to select the correct API URL for your shop's region.
  </Accordion>

  <Accordion title="Incremental Sync">
    The connector supports incremental sync for:

    * **Products**: Uses `update_time` as the replication key
    * **Orders**: Uses `update_time` as the replication key

    For products and orders, only records modified since the last sync will be extracted.
  </Accordion>

  <Accordion title="Authentication and Token Management">
    The connector automatically manages access token refresh to prevent authentication failures:

    * Access tokens are refreshed proactively 30 minutes before expiration
    * The signing key is dynamically updated when generating new tokens
    * Refresh tokens are stored securely in the Meltano database
    * Token expiration defaults to 4 hours if not specified by the API
  </Accordion>

  <Accordion title="Nested Data Structures">
    Shopee data contains nested structures. When querying:

    * Use `UNNEST` to flatten arrays (e.g., `item_list` in orders)

    Example for order items:

    ```sql theme={null}
    -- AWS Athena
    SELECT o.order_sn, i.item_name, i.model_quantity_purchased
    FROM orders o
    CROSS JOIN UNNEST(o.item_list) AS t(i)

    -- GCP BigQuery
    SELECT o.order_sn, i.item_name, i.model_quantity_purchased
    FROM orders o, UNNEST(o.item_list) AS i
    ```
  </Accordion>
</AccordionGroup>

## Skills for agents

<Snippet file="agent-skills-intro.mdx" />

<Card title="Download Shopee skills file" icon="wand-magic-sparkles" href="/sources/shopee.md">
  Shopee connector documentation as plain markdown, for use in AI agent contexts.
</Card>
