CorvidReference

Events

Events that are fired by actions relating to paid plans.

Wix paid plan events are fired on your site's backend when certain events occur related to site paid plans. You can write event handlers that react to these events. Event handler functions receive data that corresponds to the event that fired. Use event handlers to create custom responses to paid plan events.

Note that backend events don't work when previewing your site.

To add a paid plan event handler, add an events.js file to the Backend section of your site if one does not already exist. All event handler functions for your site are defined in this file.

Event handler functions are defined using the following pattern:

 export function <wixAppName>_<eventName>(event) { }

For example, an event handler that handles paid plan purchases looks like this:

 export function wixPaidPlans_onPlanPurchased(event) { }

Table of Contents

FUNCTIONS

?
Perform actions on an object.
onPlanPurchased( )An event that fires when a user purchases a plan.

OBJECTS

?
Objects used when setting, getting, or calling the properties and methods listed above.
OrderAn object representing a new paid plan order.
PeriodAn object representing the period for which a plan is valid.
PlanPurchasedEventAn object representing a new paid plan purchase.
PriceAn object representing the price of a purchased plan.
ValidForAn object representing how long a plan is valid.

onPlanPurchased( )

An event that fires when a user purchases a plan.

Description

The onPlanPurchased() event handler runs when a user purchases a paid plan. The received PlanPurchasedEvent object contains order information about the plan, such as order ID, and until when the order is valid, and so on.

Note

Backend events don't work when previewing your site.

Syntax

function onPlanPurchased(event: PlanPurchasedEvent): void

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/

Order

An object representing a new paid plan order.

See Also

onPlanPurchased( )

Syntax

type Order = {
  id: string
  paymentStatus: string
  price: Price
  cancellationReason: string
  validFrom: Date
  planName: string
  recurring: boolean
  dateCreated: Date
  status: string
  roleID: string
  planDescription: string
  memberId: string
  orderType: string
  planId: string
  validFor: ValidFor
  wixPayOrderId: string
  validUntil: Date
}
MEMBERS
?
The properties of an object.
id
string
Order ID of the purchase of the plan, auto-generated when an order is created.
paymentStatus
string
Status of the payment for the plan. Can be PAID, REFUNDED, FAILED, UNPAID, and PAYMENT_STATUS_UNDEFINED.
price
Object containing the price of the plan.
cancellationReason
string
If plan is cancelled, the reason why. Can be OWNER_CANCELED, PAYMENT_PROVIDER_CANCELED, PAYMENT_FAILED, UOU_CANCELED, and CANCELLATION_REASON_UNDEFINED.
validFrom
Date
Date and time from which the plan is valid.
planName
string
Name of the plan.
recurring
boolean
If the plan is recurring. If true, the price is deducted weekly, monthly, or yearly.
dateCreated
Date
Date and time the order was created.
status
string
Status of the order. Can be ACTIVE, PENDING, CANCELED, EXPIRED, PENDING_CANCELLATION, and ORDER_STATUS_UNDEFINED.
roleID
string
Role assigned after purchasing the plan.
planDescription
string
Description of the plan.
memberId
string
ID for the visitor who purchased the plan.
orderType
string
How the plan was purchased, either ONLINE pr OFFLINE.
planId
string
ID of the plan.
validFor
Object containing properties about how long the plan is valid.
wixPayOrderId
string
ID of the plan for wix Pay. If plan is free, this ID is blank.
validUntil
Date
Date and time until which the plan is valid.

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/

Period

An object representing the period for which a plan is valid.

See Also

onPlanPurchased( )

Syntax

type Period = {
  amount: number
  unit: string
}
MEMBERS
?
The properties of an object.
amount
number
The number of units until the plan expires.
unit
string
Time period for billing the plan, such as MONTH.

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/

PlanPurchasedEvent

An object representing a new paid plan purchase.

See Also

onPlanPurchased( )

Syntax

type PlanPurchasedEvent = {
  order: Order
}
MEMBERS
?
The properties of an object.
order
Object containing the details about the plan's order.

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/

Price

An object representing the price of a purchased plan.

See Also

onPlanPurchased( )

Syntax

type Price = {
  currency: string
  amount: number
}
MEMBERS
?
The properties of an object.
currency
string

Payment currency. A three-letter ISO-4217 currency code.

amount
number
The cost of the plan.

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/

ValidFor

An object representing how long a plan is valid.

See Also

onPlanPurchased( )

Syntax

type ValidFor = {
  forever: boolean
  period: Period
}
MEMBERS
?
The properties of an object.
forever
boolean
If true, the plan does not expire.
period
Object containing the period for which the plan is valid.

Examples

An event when a paid plan is purchased

This example adds purchased plan event data to a manually-created planEvents database. The database has a data field.

When a plan is purchased and the onPlanPurchased event is triggered, the JSON format of the object is inserted into the data field.

// Place this code in the events.js file
// of your site's Backend section.


// For inserting data about a plan transaction:
import wixData from 'wix-data';



export function wixPaidPlans_onPlanPurchased(event) {

  // Insert a title reflecting the type of transaction, and
  // the event's order object (json) into 
  // the collection's data field.
  if (event.order.price.amount === 0) {
     let orderData = {
       "title": "Free plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData);
  } else {
     let orderData = {
       "title": "Regular plan purchased",
       "data": event.order
     };
     wixData.insert("planEvents", orderData); 
  }
}


/*  Event object for a free, one-month purchase, ordered using Thailand baht currency:
*
*   When the purchase is free, the `wixPayOrderId` is blank,
*   the `price.amount` is 0, and the paymentStatus is marked `PAID`. 
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"THB",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Platinum Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":false,
*         "period":{  
*            "amount":1,
*            "unit":"MONTH"
*         }
*      }
*   }
*  }
*
*
*  Event object for a purchase that is valid until the user cancels:
*
*   When the purchase is valid until the user cancels, `validFor.forever` is true, and 
*   `validFor.forever.period.amount` is 0.
*
*   {  
*    "order":{  
*      "paymentStatus":"PAID",
*      "validUntil":"2019-09-12T05:43:53.246Z",
*      "price":{  
*         "currency":"USD",
*         "amount":0
*      },
*      "cancellationReason":"CANCELLATION_REASON_UNDEFINED",
*      "validFrom":"2019-08-12T05:43:53.246Z",
*      "planName":"valid 1 week",
*      "wixPayOrderId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "recurring":false,
*      "id":"b8401bab-8e5d-4bf6-944b-b2d56698d4c9",
*      "dateCreated":"2019-08-12T05:43:53.246Z",
*      "status":"ACTIVE",
*      "roleId":"",
*      "planDescription":"Gold Plan",
*      "memberId":"42d90dcb-b9ad-47be-9a36-488be3dec679",
*      "orderType":"ONLINE",
*      "planId":"a52f41cc-8129-4812-9e1c-fafa2807a25d",
*      "validFor":{  
*         "forever":true,
*         "period":{  
*            "amount":0,
*            "unit":"MONTH"
*         }
*      }
*   }
* }
*
*/