getSubscribeList(data: GetSubscribeListParams)

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

Description

Retrieve the list of subscription plans for the currently logged-in user, returning subscription status, renewal cycle, next billing time, and related order information.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<GetSubscribeListResult>
Paginated result. data is an array of subscription plans; each item includes the subscription ID, status, renewal cycle, next billing time, and associated order information.

Referenced Types

interfaceGetSubscribeListResultResult of querying the subscription plan list
PropertyTypeDescription
pageNumnumberCurrent page number
pageSizenumberPage size
indexnumberData offset for the current page
pageCountnumberTotal number of pages
totalRecordnumberTotal record count
Subscription plan list

Examples

Request example

import { getSubscribeList } from '@tuya-miniapp/cloud-api';

getSubscribeList({
  pageNo: 1,
  pageSize: 10,
})
  .then(result => {
    console.log('Total subscriptions:', result.totalRecord);
    console.log('Subscription list:', result.data);
  })
  .catch(error => {
    console.error('Failed to query subscription plan:', error);
  });

Response example

{
  "pageNum": 1,
  "pageSize": 10,
  "index": 0,
  "pageCount": 1,
  "totalRecord": 1,
  "data": [
    {
      "subscribeId": "your_subscribe_id",
      "status": 3,
      "paidProvider": 4,
      "regularUnit": 3,
      "regularInterval": 1,
      "gmtNextTime": 1731600000000,
      "orderListModel": {
        "orderId": "your_order_id",
        "orderStatus": "FINISH",
        "orderGmtCreate": 1699977600000,
        "quantity": 1,
        "amountOrigin": 99,
        "amountTrade": 99,
        "currency": "USD",
        "mallInfo": {
          "mallCode": "your_mall_code",
          "siteCode": "your_site_code",
          "shopCode": "your_shop_code"
        },
        "orderItemList": [
          {
            "commodityCode": "your_commodity_code",
            "skuCode": "your_sku_code",
            "skuPic": "https://example.com/sku.png",
            "title": "Value-added service product",
            "skuValueList": ["Yearly"],
            "quantity": 1,
            "currency": "USD",
            "amountTrade": 99,
            "amountOrigin": 199
          }
        ]
      }
    }
  ]
}