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>
getOrder Parameters
This function does not take any parameters.
Returns
Fulfilled - When the information associated with the order has been retrieved.
Return Type:
NAME
TYPE
DESCRIPTION
Unique order ID.
Date and time the order was updated.
The site's displayed language.
The shopping cart's unique ID.
Channel information.
Identity of the order's operator.
Billing information.
Buyer information.
A note added by the buyer.
Date and time the order was created.
Order currency.
Running order number.
Shipping information.
Order items.
Order totals.
The unit in which the order's weight is measured. Either "KG"
or "LB"
.
Information about a custom field.
Discount information.
Was this helpful?
Get the order's information
1$w('#myThankYouPage').getOrder()2 .then((order) => {3 const orderNumber = order.number;4 const billingEmail = order.billingInfo.email;5 // see example order object below6 })7 .catch((error) => {8 console.log(error);9 });1011/*12 * Example order object:13 *14 * {15 * "_id": "d3e84af3-4597-9a18-36c8-1c6f176c0f52",16 * "_updatedDate": "2019-07-09T22:00:00.000Z",17 * "buyerLanguage": "en",18 * "cartId": "6c1e8c02-4608-4b23-aae9-1f414af7d686",19 * "channelInfo": {20 * "externalOrderId": "03-04896-40604",21 * "externalOrderUrl": "http://www.eBay.com/sh/ord/details?orderid=03-04896-40604",22 * "type": "EBAY"23 * },24 * "enteredBy": {25 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",26 * "identityType": "MEMBER"27 * },28 * "billingInfo": {29 * "address": {30 * "formatted": "235 W 23rd St New York, NY 10011, USA",31 * "city": "New York",32 * "country": "USA",33 * "addressLine": "235 W 23rd St",34 * "postalCode": "10011",35 * "subdivision": "NY"36 * },37 * "lastName": "Doe",38 * "firstName": "John",39 * "email": "john.doe@somedomain.com",40 * "phone": "+15555555555",41 * "company": "My company name",42 * "vatId": {43 * "number": "325.283.507-08",44 * "type": "CPF"45 * }46 * },47 * "buyerInfo": {48 * "id": "f6c2c0f9-4e9f-a58d-a02d-9af2497294d9",49 * "email": "john.doe@domain.com",50 * "firstName": "John",51 * "lastName": "Doe",52 * "phone": "+15555555555",53 * "identityType": "MEMBER",54 * },55 * "buyerNote": "A note written by the buyer",56 * "_dateCreated": "2019-05-23T13:58:47.871Z",57 * "currency": "USD",58 * "number": 10011,59 * "shippingInfo": {60 * "deliverByDate": "2019-06-23T13:58:47.871Z",61 * "deliveryOption": "Free Shipping",62 * "estimatedDeliveryTime": "3 business days",63 * "shippingRegion": "Domestic",64 * // shipmentDetails are not included if pickup was selected as the delivery method65 * "shipmentDetails": {66 * "address": {67 * "formatted": "235 W 23rd St New York, NY 10011, USA",68 * "city": "New York",69 * "country": "US",70 * "addressLine": "235 W 23rd St",71 * "postalCode": "10011",72 * "subdivision": "NY"73 * },74 * "lastName": "Doe",75 * "firstName": "John",76 * "email": "john.doe@somedomain.com",77 * "phone": "+15555555555",78 * "company": "company name",79 * "vatId": {80 * "number": "325.283.507-08",81 * "type": "CPF"82 * },83 * "priceData": {84 * "price": 5,85 * "taxIncludedInPrice": false86 * }87 * },88 * // pickupDetails are not included if shipping was selected as the delivery method89 * "pickupDetails": {90 * "pickupInstructions": "pickupInstructions",91 * "pickupAddress": {92 * "formatted": "123 W 24th St Apt. 12 New York, NY 10012, USA",93 * "city": "New York",94 * "country": "US",95 * "addressLine": "123 W 24th St",96 * "addressLine2" "Apt. 12",97 * "postalCode": "10012",98 * "subdivision": "NY"99 * },100 * "lastName": "Doe",101 * "firstName": "John",102 * "email": "john.doe@somedomain.com",103 * "phone": "+15555555555"104 * },105 * "deliveryDate": "2019-06-23T13:58:47.871Z"106 * },107 * "lineItems": [108 * {109 * "customTextFields": [110 * {111 * "title": "Notes for delivery",112 * "value": "Please leave at front door"113 * }114 * ],115 * "productId": "3fb6a3c8-988b-8755-04bd-5c59ae0b18ea",116 * "lineItemType": "PHYSICAL",117 * "mediaItem": {118 * "altText": "A description of the image",119 * "id": "nsplsh_5386255~mv2_d_2977_3951_s_4_2.jpg",120 * "externalImageUrl": "http://static.wixstatic...al_c,q_90/file.jpg",121 * "src": "wix:image://v1/.../jpg#originWidth=1000&originHeight=1000",122 * "type": "IMAGE"123 * },124 * "name": "I'm a product",125 * "notes": "A product of the highest quality",126 * "options": [127 * {128 * "option": "Size",129 * "selection": "Medium"130 * }131 * ],132 * "quantity": 1,133 * "sku": "36523641234523",134 * "weight": 1.42,135 * "index": 1,136 * "translatedName": "Nombre traducido",137 * "discount": 0,138 * "tax": 5,139 * "priceData": {140 * "price": 35,141 * "totalPrice": 40,142 * "taxIncludedInPrice": true143 * },144 * "taxGroupId": "4",145 * "variantId": "0042-0005-a316f7c67df7",146 * "fulfillerId": "0000-0420-0005-a3dcfd7e6930"147 *148 * }149 * ],150 * "totals": {151 * "discount": 0,152 * "quantity": 1,153 * "shipping": 0,154 * "subtotal": 35,155 * "tax": 5,156 * "total": 40,157 * "weight": 1.42158 * },159 * "weightUnit": "KG",160 * "customField": {161 * "title": "Notes for delivery",162 * "translatedTitle": "Notas para la entrega",163 * "value": "Please call when outside"164 * },165 * "discount": {166 * "appliedCoupon": {167 * "code": "SUMMER2019",168 * "couponId": "558b511f-6eb7-82d3-53fca7374dfa",169 * "name": "Summer sale"170 * }171 * }172 * }173 */