Shopee SDK API Reference - v1.11.0
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: ShopeeConfig

    Methods

    • Add items to shop flash sale

      Use this API to add items to a shop flash sale. Maximum 50 enabled items per flash sale. For items with variations, specify model_id and prices for each variation.

      Parameters

      Returns Promise<AddShopFlashSaleItemsResponse>

      A promise that resolves to the result with any failed items

      const result = await sdk.shopFlashSale.addShopFlashSaleItems({
      flash_sale_id: 802063533822541,
      items: [
      {
      item_id: 3744623870,
      purchase_limit: 5,
      models: [
      {
      model_id: 5414485721,
      input_promo_price: 69.3,
      stock: 100
      }
      ]
      }
      ]
      });
      console.log('Failed items:', result.response.failed_items);
    • Get item criteria for shop flash sale

      Use this API to get the criteria that items must meet to be eligible for shop flash sales. Criteria vary by product category and region.

      Parameters

      Returns Promise<GetItemCriteriaResponse>

      A promise that resolves to the criteria details

      const criteria = await sdk.shopFlashSale.getItemCriteria({});
      console.log('Criteria:', criteria.response.criteria);
      console.log('Category mappings:', criteria.response.pair_ids);
    • Get shop flash sale items

      Use this API to get items and their details in a shop flash sale. Returns both item information and model details for items with variations.

      Parameters

      Returns Promise<GetShopFlashSaleItemsResponse>

      A promise that resolves to the items and their details

      const items = await sdk.shopFlashSale.getShopFlashSaleItems({
      flash_sale_id: 802063533822541,
      offset: 0,
      limit: 50
      });
      console.log('Total items:', items.response.total_count);
      console.log('Items:', items.response.item_info);
      console.log('Models:', items.response.models);
    • Get available time slot IDs

      Use this API to get available time slots for creating shop flash sales. You can only use time slots that start in the future.

      Parameters

      Returns Promise<GetTimeSlotIdResponse>

      A promise that resolves to the list of available time slots

      const now = Math.floor(Date.now() / 1000);
      const slots = await sdk.shopFlashSale.getTimeSlotId({
      start_time: now,
      end_time: now + 7 * 86400 // Next 7 days
      });
      console.log('Available slots:', slots.response);
    • Update shop flash sale status

      Use this API to enable or disable a shop flash sale. Disabling a flash sale will disable all items in the session. Cannot edit flash sales with 'system_rejected' status.

      Parameters

      Returns Promise<UpdateShopFlashSaleResponse>

      A promise that resolves to the updated flash sale information

      const result = await sdk.shopFlashSale.updateShopFlashSale({
      flash_sale_id: 802063533822541,
      status: 1 // enable
      });
      console.log('Flash sale updated:', result.response.status);
    • Update shop flash sale items

      Use this API to update items in a shop flash sale. Can only edit items/models in disabled or enabled status. Cannot modify price or stock of enabled items, must disable first.

      Parameters

      Returns Promise<UpdateShopFlashSaleItemsResponse>

      A promise that resolves to the result with any failed items

      const result = await sdk.shopFlashSale.updateShopFlashSaleItems({
      flash_sale_id: 802063533822541,
      items: [
      {
      item_id: 3744623870,
      purchase_limit: 10,
      models: [
      {
      model_id: 5414485721,
      status: 1, // enable
      input_promo_price: 65.0,
      stock: 150
      }
      ]
      }
      ]
      });
      console.log('Failed items:', result.response.failed_items);