getSkuPayment(data: GetSkuPaymentParams)

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

Description

Query payment information and available payment channels for a specified SKU, returning the payment channel and payment type to be used with getPrepay.

Parameters

ParameterTypeRequiredDescription
YesRequest parameters

Return Value

Type: Promise<GetSkuPaymentResult>
Payment information, including the list of available payment channel configurations

Referenced Types

interfaceGetSkuPaymentResultResult of querying SKU payment information
PropertyTypeDescription
List of available payment channel configurations
enumVasPaymentScope
ValueActual ValueDescription
VasPaymentScope.ALL0All
VasPaymentScope.ONLY_IAP1IAP only
VasPaymentScope.ONLY_NON_IAP2Non-IAP only
VasPaymentScope.AUTO_IAP99Auto-select whether to use IAP
enumVasPaymentOS
ValueActual ValueDescription
VasPaymentOS.ANDROID1Android
VasPaymentOS.IOS2iOS
enumVasOptionType
ValueActual ValueDescription
VasOptionType.NORMAL0Standard payment
VasOptionType.SUBSCRIPTION2Subscription payment

Valid Values

VasPaymentScope
ValueDescriptionSince
0All-
1IAP only-
2Non-IAP only-
99Auto-select whether to use IAP-
VasPaymentOS
ValueDescriptionSince
1Android-
2iOS-
VasOptionType
ValueDescriptionSince
0Standard payment-
2Subscription payment-

Examples

Request example

import { getSkuPayment, VasPaymentScope, VasPaymentOS } from '@tuya-miniapp/cloud-api';

getSkuPayment({
  mallCode: 'your_mall_code',
  shopCode: 'your_shop_code',
  siteCode: 'your_site_code',
  paymentScopeCode: VasPaymentScope.ONLY_NON_IAP,
  os: VasPaymentOS.IOS,
  skuCode: 'your_sku_code',
  optionType: 0,
  optionNo: 0,
  quantity: 1,
  trial: false,
  currency: 'CNY',
  includeBetaPaidProvider: true,
})
  .then(payment => {
    console.log('Payment info:', payment);
  })
  .catch(error => {
    console.error('Failed to query payment info:', error);
  });

Response example

{
  "paidConfigList": [
    {
      "paidProviderName": "your_paid_provider_name",
      "paidTypeName": "your_paid_type_name"
    }
  ]
}