Pass an object containing the current device ID. getPanelAgentCreditsPlans({ devId }).
getPanelAgentCreditsPlans
Requires:
@tuya-miniapp/cloud-api≥1.7.4
Additional notesRead the full notes
Requires user login and access permission for the current device. The corresponding cloud capability must also be linked in the development settings on the MiniApp Developer Platform.
When enabled, returns the free tier and valid paid tiers in their existing configuration order. Use externalCode in plans to query entitlements or associate a VAS SKU.
When enabled, an empty array indicates that no valid paid services are available. When disabled, freePlan is null and plans is an empty array.
If Highway fails, the original error is preserved. If a successful response is missing required fields, the request is rejected with CREDITS_INVALID_PLANS.
When enabled, returns the free tier and valid paid tiers in their existing configuration order. Use externalCode in plans to query entitlements or associate a VAS SKU.
When enabled, an empty array indicates that no valid paid services are available. When disabled, freePlan is null and plans is an empty array.
If Highway fails, the original error is preserved. If a successful response is missing required fields, the request is rejected with CREDITS_INVALID_PLANS.
Method signature
getPanelAgentCreditsPlans(params: )Description
Query the Credits plans available for the current device and business model.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| Yes | devId of the current device |
Return Value
Type: Promise<GetPanelAgentCreditsPlansResult>
Current business model, free tier, and valid paid tiers
Referenced Types
type
GetPanelAgentCreditsPlansResultValid Credits plans for the current device and business modelValid Values
GetPanelAgentCreditsPlansResult.businessMode
| Value | Description | Since |
|---|---|---|
1 | - | - |
2 | - | - |
Examples
Request example
Response example
When Credits is disabled or unconfigured, freePlan is null and plans is an empty array. When enabled, freePlan.externalCode is null. Use the externalCode of a paid plan to match VAS SKUs.
Plan fields
When enabled, businessMode is 1 (distribution) or 2 (redemption). freePlan is the free plan applicable to the device. plans lists eligible paid plans in server order and is empty when no paid plans are eligible.