CorvidReference

ThankYouPage

A thank you page displayed when an order is created.

Table of Contents

PROPERTIES

?
Store values associated with an object.
collapsedIndicates if the element is collapsed or expanded.
globalIndicates if an element appears on all pages or only on the current page.
hiddenIndicates if the element is visible or hidden.
idGets the element's ID.
isVisibleIndicates if the element is actually visible.
parentGets the element's parent element.
renderedIndicates if an element is currently in the DOM structure.
typeGets the element's type.

FUNCTIONS

?
Perform actions on an object.
collapse( )Collapses the element and sets its collapsed property to true.
expand( )Expands the element and sets its collapsed property to false.
getOrder( )Gets the order associated with the current page.
hide( )

Hides the element and sets its hidden property to true, using an effect if specified.

onMouseIn( )

Adds an event handler that runs when the mouse pointer is moved onto the element.

onMouseOut( )

Adds an event handler that runs when the mouse pointer is moved off of the element.

onViewportEnter( )

Adds an event handler that runs when an element is displayed in the viewable part of the current window.

onViewportLeave( )

Adds an event handler that runs when an element is no longer displayed in the viewable part of the current window.

scrollTo( )Scrolls the page to the element using an animation.
show( )

Shows the element and sets its hidden property to false, using an effect if specified.

OBJECTS

?
Objects used when setting, getting, or calling the properties and methods listed above.
AddressAn object that contains address information.
BillingInfoAn object representing an order's billing info.
BuyerInfoAn object containing information about a buyer.
CustomTextFieldAn object representing a custom text field.
LineItemAn object representing a line item in a shopping cart.
MediaItemAn object representing a media item.
OptionAn object representing a line item option.
OrderAn object representing an order.
OrderTotalsAn object representing an order's totals.
PickupDetailsAn object representing an order's shipping details.
ShipmentDetailsAn object representing an order's shipping details.
ShippingInfoAn object representing an order's shipping info.
TotalsAn object representing an order's totals.
VatIdAn object that contains VAT information.

MIXES IN

?
Where some functionality is inherited from.
$w.Element, $w.HiddenCollapsedMixin

collapsed

Indicates if the element is collapsed or expanded.

Description

If collapsed is true, the element is not displayed on the page under any circumstances. A collapsed element, unlike a hidden element, does not take up any space on the page. When collapsed, elements positioned within 70 pixels below the collapsed element and each other move up to take the collapsed element's place where possible. The elements that move up maintain their positions relative to one another.

If collapsed is false, the element may be displayed on the page. Elements that moved up to take the collapsed element's place on the page are moved back down.

However, an expanded element (an element whose collapsed property is false) is still not displayed if:

Even if the element is not be displayed due to the conditions mentioned above, if its collapsed property is false, it's displayed when the conditions no longer apply.

To set the collapsed property on an element, use the element's collapse() and expand() functions.

If you select Collapsed on load in the element's Properties panel in the Editor, the collapsed property is set to true when the page loads.

See Also

collapse( ), expand( ), hide( ), show( ), hidden

Syntax

get collapsed(): boolean
TYPE
?
The kind of data the property stores.
boolean
DEFAULT VALUE
?
The value of a property before you explicitly set it.
false

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Get an element's collapsed status

let isCollapsed = $w("#myElement").collapsed; // false

Toggle an element's collapsed state

if( $w("#myElement").collapsed ) {
  $w("#myElement").expand();
}
else {
  $w("#myElement").collapse();
}

global

Indicates if an element appears on all pages or only on the current page.

Description

If global is true, the element appears on all pages.

If global is false, the element only appears on the current page.

Syntax

get global(): boolean
TYPE
?
The kind of data the property stores.
boolean
DEFAULT VALUE
?
The value of a property before you explicitly set it.
false

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get whether an element is displayed on all pages

let isGlobal = $w("#myElement").global; // false

hidden

Indicates if the element is visible or hidden.

Description

If hidden is true, the element is not displayed on the page under any circumstances. A hidden element, unlike a collapsed element, continues to take up the same space on the page as it did when it was visible.

If hidden is false, the element may be displayed on the page.

However, an element whose hidden property is false is still not displayed if:

Even if the element is not displayed due to the conditions mentioned above, if its hidden property is set to false, it's displayed when the conditions no longer apply.

To determine if the element is actually visible, use the isVisible property.

To set the hidden property on an element, use the element's hide() or show() functions.

If you select Hidden on load in the element's Properties panel in the Editor, the hidden property is set to true when the page loads.

Note

An element's hidden property is not the same as its isVisible property. The hidden property indicates whether the element should be displayed, while isVisible indicates if it is actually displayed.

See Also

hide( ), show( ), collapse( ), expand( ), collapsed, rendered

Syntax

get hidden(): boolean
TYPE
?
The kind of data the property stores.
boolean
DEFAULT VALUE
?
The value of a property before you explicitly set it.
false

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Get an element's hidden status

let isHidden = $w("#myElement").hidden;  // false

Toggle an element's hidden state

if( $w("#myElement").hidden ) {
  $w("#myElement").show();
}
else {
  $w("#myElement").hide();
}

id

Gets the element's ID.

Description

The ID is the element's unique identifier. It is used when selecting elements using the $w() function.

An element's id is set in the Editor using the Properties panel.

Syntax

get id(): string
TYPE
?
The kind of data the property stores.
string

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the ID

let myId = $w("#myElement").id; // "myElement"

isVisible

Indicates if the element is actually visible.

Description

If isVisible is true, the element is displayed on the page.

If isVisible is false, the element is not displayed on the page.

The value of the isVisible property is calculated based on the hidden, collapsed, and rendered properties of the element and all of its ancestors. It is true only if the conditions exist in the element's property values and the property values of its ancestors such that the element is actually displayed on the page.

Note

An element's isVisible property is not the same as its hidden property. The isVisible property indicates whether the element is actually displayed, while hidden indicates if it should be displayed.

The isVisible property of an element remains true even if another element completely covers it so that a user cannot see it.

See Also

hidden, collapsed, rendered

Syntax

get isVisible(): boolean
TYPE
?
The kind of data the property stores.
boolean
DEFAULT VALUE
?
The value of a property before you explicitly set it.
true

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Get whether an element is visible

let isVisible = $w("#myElement").isVisible;  // true

parent

Gets the element's parent element.

Description

Some elements can contain other elements. This occurs when you drag an element onto a container element. The container is the parent of all the elements it contains.

Page, Header, and Footer are top-level elements and have no parent.

See Also

children

Syntax

get parent(): Node
TYPE
?
The kind of data the property stores.
DEFAULT VALUE
?
The value of a property before you explicitly set it.
null

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the parent element and the parent's ID

let parentElement = $w("#myElement").parent;

let parentId = parentElement.id; // "page1"

rendered

Indicates if an element is currently in the DOM structure.

Description

If rendered is true, the element is in the current DOM structure and can be used.

If rendered is false the element is not in the current DOM structure.

An element might not be in the DOM if it is in a slide or a state which is not currently showing.

See Also

collapsed, hidden, isVisible

Syntax

get rendered(): boolean
TYPE
?
The kind of data the property stores.
boolean
DEFAULT VALUE
?
The value of a property before you explicitly set it.
false

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get an element's rendered status

let isRendered = $w("#myElement").rendered;  // true

type

Gets the element's type.

Syntax

get type(): string
TYPE
?
The kind of data the property stores.
string

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the element's type

let myType = $w("#myElement").type; // "$w.Type"

collapse( )

Collapses the element and sets its collapsed property to true.

Description

The collapse() function returns a Promise that is resolved when the element's collapsed property has been set to true.

To learn about the behavior of a collapsed element, see the collapsed property.

You can also collapse an element when the page loads by using the Properties panel in the Editor.

See Also

expand( ), collapsed, hide( )

Syntax

function collapse(): Promise<void>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<void>
Fulfilled - When the element's collapsed property has been set to true.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Collapse an element

$w("#myElement").collapse();

Collapse an element and log a message when done

$w("#myElement").collapse()
  .then( () => {
    console.log("Done with collapse");
  } );

Toggle an element's collapsed state

if( $w("#myElement").collapsed ) {
  $w("#myElement").expand();
}
else {
  $w("#myElement").collapse();
}

expand( )

Expands the element and sets its collapsed property to false.

Description

The expand() function returns a Promise that is resolved when the element's collapsed property has been set to false.

To learn about the behavior of an expanded element, see the collapsed property.

See Also

expand( ), collapsed, show( )

Syntax

function expand(): Promise<void>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<void>
Fulfilled - When the element's collapsed property has been set to false.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Expand an element

$w("#myElement").expand();

Expand an element and log a message when done

$w("#myElement").expand()
  .then( () => {
    console.log("Done with expand");
  } );

Toggle an element's collapsed state

if( $w("#myElement").collapsed ) {
  $w("#myElement").expand();
}
else {
  $w("#myElement").collapse();
}

getOrder( )

Gets the order associated with the current page.

Description

The getOrder() function returns a Promise that is resolved when the information about the order associated with the ThankYouPage is retrieved.

Syntax

function getOrder(): Promise<Order>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<Order>
Fulfilled - When the information associated with the order product has been retrieved.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

hide( )

Hides the element and sets its hidden property to true, using an effect if specified.

Description

The hide() function hides the element and returns a Promise that is resolved when the effect is complete and the element's hidden property has been set to true.

To learn about the behavior of a hidden element, see the hidden property.

You can optionally apply an effect when hiding the element by providing an effectName value. You can also customize the effect by providing the optional effectOptions object.

Effects:

You can also hide an element when the page loads by using the Properties panel in the Editor.

See Also

show( ), hidden, collapse( )

Syntax

function hide([effectName: string], [effectOptions: ArcEffectOptions | BounceEffectOptions | FadeEffectOptions | FlipEffectOptions | FloatEffectOptions | FlyEffectOptions | FoldEffectOptions | GlideEffectOptions | PuffEffectOptions | RollEffectOptions | SlideEffectOptions | SpinEffectOptions | TurnEffectOptions | ZoomEffectOptions]): Promise<void>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<void>
Fulfilled - When the effect is complete and the element's hidden property has been set to true.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Hide an element with no effect

$w("#myElement").hide();

Hide an element with the "fade" effect

$w("#myElement").hide("fade");

Hide an element with the "fade" effect and custom options

let fadeOptions = {
  "duration":   2000,
  "delay":      1000
};

$w("#myElement").hide("fade", fadeOptions);

Hide an element with an effect and log a message when the effect is done

$w("#myElement").hide("fade")
  .then( ( ) => {
    console.log("Done with fade");
} );

Toggle an element's hidden state

if( $w("#myElement").hidden ) {
  $w("#myElement").show();
}
else {
  $w("#myElement").hide();
}

onMouseIn( )

Adds an event handler that runs when the mouse pointer is moved onto the element.

Note

Deprecation note: The $w parameter of event handlers is being deprecated. To get a scoped selector for working with elements in repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context). To learn more, see here.

Syntax

function onMouseIn(handler: MouseEventHandler): Element
callback MouseEventHandler(event: MouseEvent, $w: $w): void
PARAMETERS
?
Values that you pass to a function.
handler
function(event: MouseEvent, $w: $w)

The name of the function or the function expression to run when the mouse pointer is moved onto the element.

?
Values that you pass to a function.
event
The mouse event that occurred.
$w

Deprecated: A selector function. The $w function was used to enable event handlers to work with elements in repeaters. Now, to get a scoped selector for working with repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context).

RETURN VALUE
?
Value that a function evaluates to when it is finished running.
The element to which the event handler was added.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the mouse event info when the mouse enters an element

$w("#myElement").onMouseIn( (event) => {
  let clientX = event.clientX;  // 362
  let clientY = event.clientY;  // 244
  let offsetX = event.offsetX;  // 10
  let offsetY = event.offsetY;  // 12
  let pageX = event.pageX;      // 362
  let pageY = event.pageY;      // 376
  let screenX = event.screenX;  // 3897
  let screenY = event.screenY;  // 362
} );

onMouseOut( )

Adds an event handler that runs when the mouse pointer is moved off of the element.

Note

Deprecation note: The $w parameter of event handlers is being deprecated. To get a scoped selector for working with elements in repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context). To learn more, see here.

Syntax

function onMouseOut(handler: MouseEventHandler): Element
callback MouseEventHandler(event: MouseEvent, $w: $w): void
PARAMETERS
?
Values that you pass to a function.
handler
function(event: MouseEvent, $w: $w)

The name of the function or the function expression to run when the mouse pointer is moved off of the element.

?
Values that you pass to a function.
event
The mouse event that occurred.
$w

Deprecated: A selector function. The $w function was used to enable event handlers to work with elements in repeaters. Now, to get a scoped selector for working with repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context).

RETURN VALUE
?
Value that a function evaluates to when it is finished running.
The element to which the event handler was added.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the mouse event info when the mouse exits an element

$w("#myElement").onMouseOut( (event) => {
  let clientX = event.clientX;  // 362
  let clientY = event.clientY;  // 244
  let offsetX = event.offsetX;  // 10
  let offsetY = event.offsetY;  // 12
  let pageX = event.pageX;      // 362
  let pageY = event.pageY;      // 376
  let screenX = event.screenX;  // 3897
  let screenY = event.screenY;  // 362
} );

onViewportEnter( )

Adds an event handler that runs when an element is displayed in the viewable part of the current window.

Description

An element enters the viewport when the page is scrolled to show any part of the element. An element also enters the viewport if it was hidden or collapsed and is then shown or expanded in the viewable part of the current window. onViewportEnter() is not fired for hidden or collapsed elements even if they are scrolled into view.

Note

Deprecation note: The $w parameter of event handlers is being deprecated. To get a scoped selector for working with elements in repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context). To learn more, see here.

See Also

onViewportLeave( )

Syntax

function onViewportEnter(handler: EventHandler): Element
callback EventHandler(event: Event, $w: $w): void
PARAMETERS
?
Values that you pass to a function.
handler
function(event: Event, $w: $w)

The name of the function or the function expression to run when the element enters the viewport.

?
Values that you pass to a function.
event
The event that occurred.
$w

Deprecated: A selector function. The $w function was used to enable event handlers to work with elements in repeaters. Now, to get a scoped selector for working with repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context).

RETURN VALUE
?
Value that a function evaluates to when it is finished running.
The element on which the event is now registered.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the ID of the element that has entered the viewport

$w("#myElement").onViewportEnter( (event) => {
  let targetId = event.target.id; // "myElement"
});

onViewportLeave( )

Adds an event handler that runs when an element is no longer displayed in the viewable part of the current window.

Description

An element leaves the viewport when the page is scrolled so that the element is completely out of view. An element also leaves the viewport if it was shown or expanded and is then hidden or collapsed from the viewable part of the current window. onViewportLeave() is not fired for hidden or collapsed elements even if they are scrolled out of view.

Note

Deprecation note: The $w parameter of event handlers is being deprecated. To get a scoped selector for working with elements in repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context). To learn more, see here.

See Also

onViewportEnter( )

Syntax

function onViewportLeave(handler: EventHandler): Element
callback EventHandler(event: Event, $w: $w): void
PARAMETERS
?
Values that you pass to a function.
handler
function(event: Event, $w: $w)

The name of the function or the function expression to run when the element leaves the viewport.

?
Values that you pass to a function.
event
The event that occurred.
$w

Deprecated: A selector function. The $w function was used to enable event handlers to work with elements in repeaters. Now, to get a scoped selector for working with repeater items, use the $w.at() function and pass it the context property of the event parameter: $item = $w.at(event.context).

RETURN VALUE
?
Value that a function evaluates to when it is finished running.
The element on which the event is now registered.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Get the ID of the element that has left the viewport

$w("#myElement").onViewportLeave( (event) => {
  let targetId = event.target.id; // "myElement"
});

scrollTo( )

Scrolls the page to the element using an animation.

Description

The scrollTo() function returns a Promise that is resolved when the animated scroll is complete and the element is now in view.

To scroll to a specific location on the page, see the wix-window scrollTo() function.

Calling the scrollTo() function on an element in a repeated item that is selected from the global scope causes an error.

Syntax

function scrollTo(): Promise<void>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<void>
Fulfilled - When the scroll is complete.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.Element

Examples

Scroll the page to an element

$w("#myElement").scrollTo();

Scroll the page to an element and log message when done

$w("#myElement").scrollTo()
  .then( ( ) => {
    console.log("Done with scroll");
} );

show( )

Shows the element and sets its hidden property to false, using an effect if specified.

Description

The show() function shows the element and returns a Promise that is resolved when the effect is complete and the element's hidden property has been set to false.

You can optionally apply an effect when showing the element by providing an effectName value. You can also customize the effect by providing the optional effectOptions object.

Effects:

See Also

hide( ), hidden, expand( )

Syntax

function show([effectName: string], [effectOptions: ArcEffectOptions | BounceEffectOptions | FadeEffectOptions | FlipEffectOptions | FloatEffectOptions | FlyEffectOptions | FoldEffectOptions | GlideEffectOptions | PuffEffectOptions | RollEffectOptions | SlideEffectOptions | SpinEffectOptions | TurnEffectOptions | ZoomEffectOptions]): Promise<void>
RETURN VALUE
?
Value that a function evaluates to when it is finished running.
Promise<void>
Fulfilled - When the effect is complete and the element's hidden property has been set to false.

MIXED IN FROM

?
Where this functionality is inherited from.
$w.HiddenCollapsedMixin

Examples

Show an element with no effect

$w("#myElement").show();

Show an element with the "fade" effect

$w("#myElement").show("fade");

Show an element with the "fade" effect and custom options

let fadeOptions = {
  "duration":   2000,
  "delay":      1000
};

$w("#myElement").show("fade", fadeOptions);

Show an element with an effect and log a message when the effect is done

$w("#myElement").show("fade")
  .then( ( ) => {
    console.log("Done with fade");
  } );

Toggle an element's hidden state

if( $w("#myElement").hidden ) {
  $w("#myElement").show();
}
else {
  $w("#myElement").hide();
}

Address

An object that contains address information.

See Also

Order

Syntax

type Address = {
  addressLine: string
  subdivision: string
  city: string
  postalCode: string
  country: string
  formatted: string
}
MEMBERS
?
The properties of an object.
addressLine
string
Address address line.
subdivision
string
Address subdivision.
city
string
Address city.
postalCode
string
Address postal code.
country
string
Address country.
formatted
string
Address in human readable format.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

BillingInfo

An object representing an order's billing info.

See Also

Order

Syntax

type BillingInfo = {
  firstName: string
  lastName: string
  email: string
  phone: string
  company: string
  vatId: VatId
  address: Address
}
MEMBERS
?
The properties of an object.
firstName
string
First name.
lastName
string
Last name.
email
string
Email address.
phone
string
Phone number.
company
string
Company name.
vatId
Company name.
address
Billing address.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

BuyerInfo

An object containing information about a buyer.

See Also

Order

Syntax

type BuyerInfo = {
  id: string
  email: string
  firstName: string
  lastName: string
  identityType: string
  phone: string
}
MEMBERS
?
The properties of an object.
id
string
Buyer's unique ID.
email
string
Buyer's email address.
firstName
string
Buyer's first name.
lastName
string
Buyer's last name.
identityType
string

Buyer's identity. One of:

  • "ADMIN": Buyer is the site owner.
  • "MEMBER": Buyer is a logged-in site member.
  • "VISITOR": Buyer is not logged in.
  • "CONTACT": A contact has been created for the buyer.
phone
string
Buyer's phone number.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

CustomTextField

An object representing a custom text field.

See Also

Order

Syntax

type CustomTextField = {
  title: string
  value: string
}
MEMBERS
?
The properties of an object.
title
string
Field title.
value
string
Field value.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

LineItem

An object representing a line item in a shopping cart.

See Also

Order

Syntax

type LineItem = {
  name: string
  notes: string
  price: string
  productId: string
  quantity: number
  sku: string
  totalPrice: string
  weight: string
  lineItemType: string
  options: Array<Option>
  mediaItem: MediaItem
  customTextFields: Array<CustomTextField>
  index: number
}
MEMBERS
?
The properties of an object.
name
string
Name of the line item.
notes
string
Notes about the line item.
price
string
Line item price.
productId
string
Line item product ID.
quantity
number
Line item quantity.
sku
string
Line item stock keeping unit.
totalPrice
string
Total price charged to the customer for all line items after any applicable discounts.
weight
string
Line item weight.
lineItemType
string

Type of the line item. One of:

  • "DIGITAL": Digital item.
  • "PHYSICAL": Physical item.
  • "CUSTOM_AMOUNT_ITEM": Item with a custom price.
  • "UNSPECIFIED": Type can't be classified due to an error.
options
Array<Option>
Line item options.
mediaItem
Media item.
customTextFields
Custom text.
index
number
Line item index.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

MediaItem

An object representing a media item.

See Also

Order

Syntax

type MediaItem = {
  mediaType: string
  url: string
  height: number
  width: number
}
MEMBERS
?
The properties of an object.
mediaType
string

Type of the media item. One of:

  • "IMAGE": Image item.
  • "UNSPECIFIED_MEDIA_TYPE_ITEM": Media item type can't be classified due to an error.
url
string
Media item URL.
height
number
Media item height.
width
number
Media item width.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

Option

An object representing a line item option.

See Also

Order

Syntax

type Option = {
  option: string
  selection: string
}
MEMBERS
?
The properties of an object.
option
string
Name of the product option.
selection
string
Selected option.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

Order

An object representing an order.

See Also

getOrder( )

Syntax

type Order = {
  _id: string
  _dateCreated: Date
  number: number
  currency: string
  billingInfo: BillingInfo
  buyerInfo: BuyerInfo
  lineItems: Array<LineItem>
  totals: Totals
  weightUnit: string
  shippingInfo: ShippingInfo
  buyerNote: string
}
MEMBERS
?
The properties of an object.
_id
string
Unique order identifier.
_dateCreated
Date
Date the order was created.
number
number
Running order number.
currency
string
Order currency.
billingInfo
Billing information.
buyerInfo
Buyer information.
lineItems
Array<LineItem>
Order items.
totals
Order totals.
weightUnit
string

The unit in which the order's weight is measured. Either "KG" or "LB".

shippingInfo
Shipping information.
buyerNote
string
A note added by the buyer.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

OrderTotals

An object representing an order's totals.

See Also

Order

Syntax

type OrderTotals = {
  subtotal: number
  shipping: number
  tax: string
  discount: number
  total: number
  weight: number
  quantity: number
}
MEMBERS
?
The properties of an object.
subtotal
number
The subtotal of all the order's line items, excluding tax.
shipping
number
The total shipping price, including tax.
tax
string
The total amount of tax.
discount
number
The total calculated discount amount.
total
number
The total price.
weight
number
The total weight of the order's items.
quantity
number
The total quantity of the the order's line items.

Examples

Get the order's information

$w('#myThanksYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

PickupDetails

An object representing an order's shipping details.

See Also

Order

Syntax

type PickupDetails = {
  pickupInstructions: string
  pickupAddress: Address
  firstName: string
  lastName: string
  email: string
  phone: string
}
MEMBERS
?
The properties of an object.
pickupInstructions
string
Pickup instructions.
pickupAddress
Pickup address.
firstName
string
First name.
lastName
string
Last name.
email
string
Email address.
phone
string
Phone number.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Pickup",
 *     "estimatedDeliveryTime": "3 days",
 *     "shipmentDetails": null,
 *     "pickupDetails": {
 *       "pickupInstructions": "Some pickup instructions.",
 *       "pickupAddress": {
 *         "formatted": "123 Main Street\nNYC, New York 11111",
 *         "city": "NYC",
 *         "country": "USA",
 *         "addressLine": "123 Main Street",
 *         "postalCode": "11111",
 *         "subdivision": "NY"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     }
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

ShipmentDetails

An object representing an order's shipping details.

See Also

Order

Syntax

type ShipmentDetails = {
  address: Address
  firstName: string
  lastName: string
  email: string
  phone: string
}
MEMBERS
?
The properties of an object.
address
Shipping address.
firstName
string
First name.
lastName
string
Last name.
email
string
Email address.
phone
string
Phone number.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

ShippingInfo

An object representing an order's shipping info.

See Also

Order

Syntax

type ShippingInfo = {
  deliveryOption: string
  estimatedDeliveryTime: string
  shipmentDetails: ShipmentDetails
  pickupDetails: PickupDetails
}
MEMBERS
?
The properties of an object.
deliveryOption
string
Delivery option information.
estimatedDeliveryTime
string
Estimated delivery time.
shipmentDetails
pickupDetails

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

Totals

An object representing an order's totals.

See Also

Order

Syntax

type Totals = {
  subtotal: number
  shipping: number
  tax: string
  discount: number
  total: number
  weight: number
  quantity: number
}
MEMBERS
?
The properties of an object.
subtotal
number
The subtotal of all the order's line items, excluding tax.
shipping
number
The total shipping price, including tax.
tax
string
The total amount of tax.
discount
number
The total calculated discount amount.
total
number
The total price.
weight
number
The total weight of the order's items.
quantity
number
The total quantity of the the order's line items.

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */

VatId

An object that contains VAT information.

See Also

Order

Syntax

type VatId = {
  number: string
  type: string
}
MEMBERS
?
The properties of an object.
number
string
VAT number.
type
string
VAT type. Either "CFP" or "CPNJ".

Examples

Get the order's information

$w('#myThankYouPage').getOrder()
  .then( (order) => {
    let orderNumber = order.number;
    let billingEmail = order.billingInfo.email;
    // see example order object below
  } )
  .catch( (error) => {
    console.log(error);
  } );

/*
 * Example order object:
 *
 * {
 *   "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",
 *   "billingInfo": {
 *     "address": {
 *       "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *       "city": "New York",
 *       "country": "USA",
 *       "addressLine": "235 W 23rd St",
 *       "postalCode": "10011"
 *     },
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "email": "john.doe@somedomain.com",
 *     "phone": "5555555555"
 *   },
 *   "buyerInfo": {
 *     "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",
 *     "type": "MEMBER",
 *     "identityType": "MEMBER",
 *     "firstName": "John",
 *     "lastName": "Doe",
 *     "phone": "5555555555",
 *     "email": "john.doe@somedomain.com"
 *   },
 *   "_dateCreated": "2019-06-23T13:58:47.871Z"
 *   "currency": "USD",
 *   "number": 10011,
 *   "shippingInfo": {
 *     "deliveryOption": "Free Shipping",
 *     "shipmentDetails": {
 *       "address": {
 *         "formatted": "235 W 23rd St, New York, NY 10011, USA",
 *         "city": "New York",
 *         "country": "USA",
 *         "addressLine": "235 W 23rd St",
 *         "postalCode": "10011"
 *       },
 *       "firstName": "John",
 *       "lastName": "Doe",
 *       "email": "john.doe@somedomain.com",
 *       "phone": "5555555555"
 *     },
 *     "pickupDetails": null
 *   },
 *   "lineItems": [
 *     {
 *       "index": 1,
 *       "quantity": 1,
 *       "price": 15,
 *       "name": "I'm a product",
 *       "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",
 *       "totalPrice": 15,
 *       "lineItemType": "PHYSICAL",
 *       "options": [],
 *       "customTextFields": [
 *         "title": "CustomField1",
 *         "value": "Custom Value"
 *       ],
 *       "mediaItem": {
 *         "src": "wix:image://v1/...b.jpg/file.jpg#originWidth=1000&originHeight=1000",
 *         "type": "IMAGE"
 *       },
 *       "sku": "36523641234523",
 *       "weight": 0
 *     }
 *   ],
 *   "totals": {
 *     "discount": 0,
 *     "quantity": 1,
 *     "shipping": 0,
 *     "subtotal": 15,
 *     "tax": 0,
 *     "total": 15,
 *     "weight": 0
 *   },
 *   "weightUnit": "KG"
 * }
 */