getVasSpuList(data: GetVasSpuListParams)

Requires:
@tuya-miniapp/cloud-api≥1.5.0

Description

Retrieve the list of value-added service commodities for the specified business, filter by bound target and tags, and optionally return SKU, pricing, and capability information.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<GetVasSpuListResult>
Array of value-added service commodities; each item includes commodity information, redirect link, order parameters, and an optional SKU list

Referenced Types

typeGetVasSpuListResultResult of querying the value-added service product list
VasCommodity[]
enumVasBindingObjectType
ValueActual ValueDescription
VasBindingObjectType.PID0PID
VasBindingObjectType.MINI_APP1Mini App
VasBindingObjectType.APP2APP
enumVasPaymentScope
ValueActual ValueDescription
VasPaymentScope.ALL0All
VasPaymentScope.ONLY_IAP1IAP only
VasPaymentScope.ONLY_NON_IAP2Non-IAP only
VasPaymentScope.AUTO_IAP99Auto-select whether to use IAP

Valid Values

VasBindingObjectType
ValueDescriptionSince
0PID-
1Mini App-
2APP-
VasPaymentScope
ValueDescriptionSince
0All-
1IAP only-
2Non-IAP only-
99Auto-select whether to use IAP-

Examples

Request example

import { getVasSpuList, VasBindingObjectType } from '@tuya-miniapp/cloud-api';

getVasSpuList({
  bindingObjectType: VasBindingObjectType.APP,
  bindingObjectCode: 'your_app_id',
  catalogCode: 'your_catalog_code',
  bindingTags: ['your_binding_tag'],
  needSkuList: true,
  clientInfo: {
    appScheme: 'your_app_scheme',
    osSystem: 'iOS',
  },
})
  .then(products => {
    console.log('Value-added service products:', products);
  })
  .catch(error => {
    console.error('Failed to query value-added service products:', error);
  });

Response example

[
  {
    "commodityCode": "your_commodity_code",
    "title": "Value-added service products",
    "subTitle": "",
    "mainPicture": "https://example.com/product.png",
    "mallCode": "your_mall_code",
    "siteCode": "your_site_code",
    "bindingTag": "your_binding_tag",
    "commodityUrl": "your_app_scheme://miniApp?uniqueCode=entryxnoib655wnyms&commodityCode=your_commodity_code&mallCode=your_mall_code&siteCode=your_site_code",
    "targetUrlType": 1,
    "requiredCheckoutParams": [
      {
        "code": "your_param_group_code",
        "paramGroup": "your_param_group",
        "paramNames": ["your_param_name"]
      }
    ],
    "skuList": [
      {
        "commodityCode": "your_commodity_code",
        "skuCode": "your_sku_code",
        "extendSkuCode": "",
        "skuName": "Yearly",
        "priceList": [
          {
            "optionType": 0,
            "optionNo": 0,
            "periodType": 0,
            "periodUnit": 1,
            "periodValue": 1,
            "currency": "CNY",
            "price": 99,
            "originalPrice": 199,
            "marketingStrategy": {
              "periodNo": 1,
              "periodUnit": 1,
              "periodValue": 1,
              "orderNo": 0,
              "discountType": 0,
              "discount": 0,
              "appleIapId": ""
            }
          }
        ],
        "capability": {
          "catalogCode": "your_catalog_code",
          "externalCode": "your_external_code",
          "capabilityType": 1,
          "meteringRule": {},
          "performanceRule": {
            "consumeType": 2,
            "consumeInCurrentMonth": false
          }
        },
        "subCapabilities": []
      }
    ]
  }
]