Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update required params in wix-pricing-plans.v2 #2678

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
1195bc2
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Jan 25, 2024
bfb7ea4
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Jan 25, 2024
9870037
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Jan 27, 2024
b74f60d
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Jan 28, 2024
3a6e7f8
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 5, 2024
a5a2ba1
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 5, 2024
1730568
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 7, 2024
14464be
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 8, 2024
5b4c69f
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 8, 2024
27fee30
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 9, 2024
869823f
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 11, 2024
9c4239a
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 12, 2024
c4278f6
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 12, 2024
7f62984
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 12, 2024
402738e
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 19, 2024
1795dd6
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 21, 2024
c69d700
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 21, 2024
7934d92
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 26, 2024
b63bcad
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Feb 26, 2024
a194212
updated articles
ryangec Mar 3, 2024
cfc3366
updated relative link to pricing-models article on intro
ryangec Mar 3, 2024
734c167
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Mar 3, 2024
769225b
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Mar 5, 2024
f3049fe
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Mar 10, 2024
e8e8cdf
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds Apr 30, 2024
a693127
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds May 1, 2024
6587e69
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds May 27, 2024
8316deb
Auto commit to autodocs-wix-pricing-plans-v2 from WixDocs Server
wix-docs-feds May 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,332 changes: 1,976 additions & 356 deletions wix-pricing-plans-v2/wix-pricing-plans-v2/Events.service.json

Large diffs are not rendered by default.

3,906 changes: 3,699 additions & 207 deletions wix-pricing-plans-v2/wix-pricing-plans-v2/Orders.service.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ title: Introduction



The Pricing Plans Orders API allows you to manage orders for your pricing plans.
The Orders API allows you to manage orders for your pricing plans.

With the Pricing Plans Orders API, you can:
- [Get](wix-pricing-plans-v2/orders/managementgetorder) and [list](wix-pricing-plans-v2/orders/managementlistorders) orders.
- [Create](wix-pricing-plans-v2/orders/createofflineorder) offline orders.
- [Mark](wix-pricing-plans-v2/orders/markaspaid) offline orders as paid.
- [Preview](wix-pricing-plans-v2/orders/getpricepreview) the pricing details of an order.
- [Pause](wix-pricing-plans-v2/orders/pauseorder), [resume](wix-pricing-plans-v2/orders/resumeorder), or [cancel](requestcancellation) orders.
- [Pause](wix-pricing-plans-v2/orders/pauseorder), [resume](wix-pricing-plans-v2/orders/resumeorder), or [cancel](wix-pricing-plans-v2/orders/cancelorder) orders.
- [Extend the duration](wix-pricing-plans-v2/orders/postponeenddate) of orders.


Expand Down
2,822 changes: 2,444 additions & 378 deletions wix-pricing-plans-v2/wix-pricing-plans-v2/Plans.service.json

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -391,6 +391,91 @@
"isVeloEvent": false,
"syntaxName": "find"
},
{
"name": "ge",
"params": [
{
"name": "propertyName",
"type": [
{
"nativeType": "string"
}
],
"doc": "Property whose value is compared with `value`.",
"required": false
},
{
"name": "value",
"type": [
{
"nativeType": "any"
}
],
"doc": "Value to compare against.\n",
"required": false
}
],
"requiredFields": [],
"ret": {
"type": [
{
"referenceType": "wix-pricing-plans-v2.Plans.PlansQueryBuilder"
}
],
"doc": null
},
"docs": {
"summary": "Refines a query to match items where the specified property is greater than or equal to the specified value.",
"description": [
"The `ge()` function refines a `PlansQueryBuilder` to match only items where the value of the specified `propertyName` is greater than or equal to the specified `value`.",
"`ge()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string.",
"If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.",
"The following types of properties can be compared:",
"- Number: Compares numerically.",
"- Date: Compares JavaScript Date objects. ",
"- String: Compares lexicographically, so `'abc'` is greater than `'ABC'`."
],
"examples": [
{
"title": "Add a `ge` filter to a query",
"body": [
"const query = plans.queryPublicPlans.ge('_createdDate', '2021-03-01');",
""
]
},
{
"title": "Create a query, add a `ge` filter, and run it",
"body": [
"import { plans } from 'wix-pricing-plans.v2';",
"",
"export async function myQueryFunction() {",
" const results = await plans",
" .queryPublicPlans()",
" .ge('_createdDate', '2021-03-01')",
" .find();",
"",
" if (results.items.length > 0) {",
" const items = results.items;",
" const firstItem = items[0];",
" const pageSize = results.pageSize;",
" const hasNext = results.hasNext();",
" const hasPrev = results.hasPrev();",
" const length = results.length;",
" const query = results.query;",
"",
" return items;",
" } else {",
" // Handle if no matching items found",
" }",
"}",
""
]
}
]
},
"isVeloEvent": false,
"syntaxName": "ge"
},
{
"name": "gt",
"params": [
Expand Down Expand Up @@ -651,6 +736,91 @@
"isVeloEvent": false,
"syntaxName": "in"
},
{
"name": "le",
"params": [
{
"name": "propertyName",
"type": [
{
"nativeType": "string"
}
],
"doc": "Property whose value is compared with `value`.",
"required": false
},
{
"name": "value",
"type": [
{
"nativeType": "any"
}
],
"doc": "Value to compare against.\n",
"required": false
}
],
"requiredFields": [],
"ret": {
"type": [
{
"referenceType": "wix-pricing-plans-v2.Plans.PlansQueryBuilder"
}
],
"doc": null
},
"docs": {
"summary": "Refines a query to match items where the specified property is less than or equal to the specified value.",
"description": [
"The `le()` function refines a `PlansQueryBuilder` to match only items where the value of the specified `propertyName` is less than or equal to the specified `value`.",
"`le()` matches only values of the same type. For example, `0` stored as a number doesn't match `'0'` stored as a string.",
"If a property contains a number stored as a string (for example, `'0'`), that value is compared alphabetically and not numerically. If a property doesn't have a value, that value is ranked lowest.",
"The following types of properties can be compared:",
"- Number: Compares numerically.",
"- Date: Compares JavaScript Date objects. ",
"- String: Compares lexicographically, so `'ABC'` is less than `'abc'`."
],
"examples": [
{
"title": "Add an `le` filter to a query",
"body": [
"const query = plans.queryPublicPlans.le('_createdDate', '2021-03-01');",
""
]
},
{
"title": "Create a query, add an `le` filter, and run it",
"body": [
"import { plans } from 'wix-pricing-plans.v2';",
"",
"export async function myQueryFunction() {",
" const results = await plans",
" .queryPublicPlans()",
" .le('_createdDate', '2021-03-01')",
" .find();",
"",
" if (results.items.length > 0) {",
" const items = results.items;",
" const firstItem = items[0];",
" const pageSize = results.pageSize;",
" const hasNext = results.hasNext();",
" const hasPrev = results.hasPrev();",
" const length = results.length;",
" const query = results.query;",
"",
" return items;",
" } else {",
" // Handle if no matching items found",
" }",
"}",
""
]
}
]
},
"isVeloEvent": false,
"syntaxName": "le"
},
{
"name": "limit",
"params": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
{
"name": "currentPage",
"type": [
{
"nativeType": "undefined"
},
{
"nativeType": "number"
}
Expand Down Expand Up @@ -209,6 +212,9 @@
{
"name": "totalCount",
"type": [
{
"nativeType": "undefined"
},
{
"nativeType": "number"
}
Expand Down Expand Up @@ -245,6 +251,9 @@
{
"name": "totalPages",
"type": [
{
"nativeType": "undefined"
},
{
"nativeType": "number"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ title: Introduction
The Pricing Plans Plans API allows you to manage your pricing plans.

With the Pricing Plans Plans API, you can:
- [Create](wix-pricing-plans-v2/plans/createplan) and [update](wix-pricing-plans-v2/plans/updateplans) orders.
- [Create](wix-pricing-plans-v2/plans/createplan) and [update](wix-pricing-plans-v2/plans/updateplan) plans.
- [Get](wix-pricing-plans-v2/plans/getplan), [list](wix-pricing-plans-v2/plans/listplans) and [query](wix-pricing-plans-v2/plans/querypublicplans) plans.
- [Set visibility](wix-pricing-plans-v2/plans/setplanvisibility) for which plans are public and which are hidden.
- [Archive](archivePlan) plans.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
title: Pricing Models
---

# Pricing models
Pricing models contain the [pricing and duration options](https://support.wix.com/en/article/pricing-plans-creating-a-plan#step-3-setting-the-price-and-duration-of-your-plan) for a plan.

Plans are based on a pricing model, which is defined with the plan's `pricing` property. A pricing model can be one of the following:
+ **A subscription:** A plan with recurring payment cycles.

*Example:* A 1-year subscription with monthly, recurring payments. Each payment is $25, so the total price for the plan is $300. In this example, the subscription is in its third month.

`cycleDuration` is the length of one payment cycle. Multiply `cycleDuration`'s `count` by `cycleCount` to get the subscription duration. Currently, `cycleDuration` only supports a value of `1`.

`index` of `currentCycle` is the current payment cycle for the subscription. `index` is `0` when the order is in a free trial period. In all other cases, the `index` starts with `1` for the first payment cycle in the subscription. For orders with a single payment, the `index` will remain `1` throughout the duration.
```javascript
"pricing": {
"subscription": {
"cycleDuration": {
// Payment recurs every month
"count": 1,
"unit": "MONTH"
},
// for 12 times
"cycleCount": 12
},
"prices": [{
"duration": {
"cycleFrom": 1,
"numberOfCycles": 12
},
"price": {
"subtotal": "25",
"discount": "0",
"total": "25",
"currency": "USD"
}
}]
},
...
"currentCycle": {
"index": 3,
"startedDate": "2022-03-01T13:45:53.129Z",
"endedDate": "2022-04-01T13:45:53.129Z"
},
```
+ **A Single Payment for Duration plan:** A plan paid for with a single payment. The plan does not renew after the duration.

*Example:* A plan with a single payment of $35 for 3 months.

The `duration` `cycleFrom` and `numberOfCycles` will both be `1`, as the single price applies to the entirety of the subscription.

`index` of `currentCycle` will remain `1` throughout the duration.
```javascript
"pricing": {
"singlePaymentForDuration": {
// Plan duration is 3 months
"count": 3,
"unit": "MONTH"
},
"prices": [{
"duration": {
"cycleFrom": 1,
"numberOfCycles": 1
},
"price": {
"subtotal": "35",
"discount": "0",
"total": "35",
"currency": "USD"
}
}]
},
...
"currentCycle": {
"index": 1,
"startedDate": "2022-01-01T13:45:53.129Z",
"endedDate": "2022-04-01T13:45:53.129Z"
},
```
+ **A Single Payment Unlimited plan:** A plan paid for with a single payment. The plan does not expire and remains valid until canceled.

*Example:* An unlimited plan that is paid for in advance with one payment of $200.

`singlePaymentUnlimited` is `true`.

The `duration` `cycleFrom` and `numberOfCycles` will remain `1` throughout the duration of the plan.

`index` of `currentCycle` will remain `1` throughout the duration. `singlePaymentUnlimitedPlans` don't return an `endedDate` in `currentCycle`.
```javascript
"pricing": {
"singlePaymentUnlimited": true,
"prices": [{
"duration": {
"cycleFrom": 1,
"numberOfCycles": 1
},
"price": {
"subtotal": "200",
"discount": "0",
"total": "200",
"currency": "USD"
}
}]
},
...
"currentCycle": {
"index": 1,
"startedDate": "2021-06-015T13:45:53.129Z"
},
```

### Free plans and free trial periods
A free plan that is valid until canceled is a `singlePaymentUnlimited` pricing model. A free plan with a limited duration is treated as a `singlePaymentForDuration` pricing model.

A site owner can also add a free trial period, in days, to a `subscription` pricing model. When the free trial is over, the first payment cycle begins and the buyer is billed. During the free trial period, the `index` of `currentCycle` is `0`. A buyer only receives the free trial period for the first time they purchase a plan. For example, a buyer purchases a monthly plan for 3 months that includes a 7-day free trial period. The buyer may purchase the same plan again, for another 3 months, but will not receive the 7-day free trial period.

When a buyer cancels their order during the free trial period, their subscription will expire at the end of the free trial period and they will not be billed. A site owner can [cancel an ordered plan](wix-pricing-plans-v2/orders/cancelorder) during the free trial period and choose to apply the cancellation `IMMEDIATELY` or at the `NEXT_PAYMENT_DATE`.

Canceling `IMMEDIATELY` ends the subscription for the buyer immediately, even during the free trial period, and the buyer won't be billed. Canceling at the `NEXT_PAYMENT_DATE` allows the buyer to continue using the benefits of the subscription until the end of the free trial period. Then, the subscription ends and the buyer is not billed.

### Pricing plan types and visibility

+ **Public pricing plans** are visible plans that site members and visitors can see on the site and purchase. By default, pricing plans are public when created.

+ **Hidden pricing plans** are plans whose `public` property has been set to `false`. These plans cannot be seen on the site by the site member or visitor. For example, consider hiding a plan if it has reached its maximum capacity and temporarily is not available for purchase.

Changing a plan’s visibility with the `public` property does not impact existing purchases. All purchases for hidden plans are still active and keep their terms and payment options.

+ **Active pricing plans** include all non-archived plans, such as public plans and hidden plans.

+ **Archived pricing plans** are plans that are no longer needed on the site. For example, discontinued plans. When a plan is archived, it is no longer visible as a public plan that can be chosen by site visitors.

The `public` property is automatically set to `false` when a plan is archived. Archived plans cannot be purchased.

Site owners can see archived plans in the Dashboard under **Pricing Plans -> Archived Plans**.

Archiving cannot be reversed. Once archived, a plan cannot be set as active again for purchase. Archiving does not impact existing purchases made for the plan. All purchases are still active and keep their pricing and terms.
Loading