Wix.Billing

getProducts

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:

Copy
1
getProducts([options], onSuccess, [onFailure]).

Parameters:

NameTypeDescription
optionsObjectOptions for this method
options.currencyStringCurrency 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)FunctionA callback function to receive the pricing information
onFailureFunctionA callback function for when an error occurs

Example:

Copy
1
Wix.Billing.getProducts(OnSuccess, OnError);
2
3
//Here is an example of the response
4
"packages": [ {
5
"id": "Premium1",
6
"name": "Comments Premium Package",
7
"price": "4.95",
8
"is_active": true,
9
"freeMonth": true,
10
"currencyCode": "USD",
11
"currencySymbol": "US$"
12
"monthly": {
13
"price": "4.95",
14
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=MONTHLY&vendorProductId=package1"
15
},
16
"yearly": {
17
"price": "3.97",
18
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=YEARLY&vendorProductId=package2"
19
},
20
"oneTime": {
21
"price": "5.99",
22
“Link”: "https://premium.wix.com/wix/api/tpaStartPurchase?appInstanceId=aaa-bbb&appDefinitionId=a1a2a-b3b4b&paymentCycle=ONE_TIME&vendorProductId=package3"
23
},
24
"bestSellingFeature": "",
25
"discountPercent": 20
26
}]
Was this helpful?
Yes
No