Note:
Have a dashboard app? Use Wix.Dashboard.getProducts instead.
Returns a json with pricing information for all of your app’s packages – premium plans and in-app purchase packages.
SDK Version: SDK 1.76.0+
Display: New Editor
Components: Settings Panel, Settings Modal
Syntax:
getProducts([options], onSuccess, [onFailure]).
Parameters:
Name | Type | Description |
---|---|---|
options | Object | Options for this method |
options.currency | String | Currency for your app’s in-app purchase package. Use this parameter to limit your package to a specific currency. If left blank, we’ll display the currency according to the user’s region (locale). |
onSuccess (required) | Function | A callback function to receive the pricing information |
onFailure | Function | A callback function for when an error occurs |
Example:
Wix.Billing.getProducts(OnSuccess, OnError);
//Here is an example of the response
"packages": [ {
"id": "Premium1",
"name": "Comments Premium Package",
"price": "4.95",
"is_active": true,
"freeMonth": true,
"currencyCode": "USD",
"currencySymbol": "US$"
"monthly": {
"price": "4.95",
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=MONTHLY&vendorProductId=package1"
},
"yearly": {
"price": "3.97",
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=YEARLY&vendorProductId=package2"
},
"oneTime": {
"price": "5.99",
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=ONE_TIME&vendorProductId=package3"
},
"bestSellingFeature": "",
"discountPercent": 20
}]