LogoLogo
Build appsContact API support
Storefronts
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
Storefronts
  • Ecwid storefronts overview
  • Get started
    • Storefront customization options
    • Quickstart: customize storefront with Ecwid JS API
  • Track Storefront events
    • "Page is loaded" events
    • "Customer logged in" event
    • "Cart details are changed" event
    • "New order is placed" event
    • "Instant Site section load" events
  • Get Storefront details
    • Get Ecwid store ID
    • Get storefront language and currency
    • Get visitor location
    • Get public app details
  • Manage customers on the storefront
    • Get logged in customer's details
    • Manage customer's cookie consent
    • Log out customer
  • Open page on the storefront
    • Overview of open page options
    • Open product pages with params
    • Open category pages with params
    • Open search page with params
    • Open account pages with params
  • Manage cart and checkout
    • Get cart details
    • Add product to the cart
    • Remove product from the cart
    • Fully clear the cart
    • Create pre-filled shopping carts
    • Calculate cart details
    • Send customer to the checkout
    • Set customer's email for the checkout
    • Set customer's comments for order
    • Set customer's shipping and billing addresses
    • Set custom order referer
  • Store configuration settings
    • Overview
    • Behavioral configs
    • Design configs

Lightspeed® 2025

On this page

Was this helpful?

  1. Track Storefront events

"New order is placed" event

Ecwid.OnOrderPlaced

This event allows tracking placed orders on the storefront and receiving order details in a callback function with an order argument.

Code example:

Ecwid.OnAPILoaded.add(() => {
    Ecwid.OnOrderPlaced.add((order) => {
        console.log(order.total);
    });
});

// prints
// 829

order callback argument

Name
Type
Description

items

Details about products in order.

productsQuantity

number

Total quantity of products in order.

weight

number

Total order weight.

paymentMethod

string

Selected payment method name. undefined if no method is selected.

shippingMethod

string

Selected shipping method name. undefined if no method is selected.

shippingCarrierName

string

Selected shipping carrier name. undefined if no method is selected.

total

number

Order total cost including subtotal, discounts, coupons, taxes, fees, and shipping.

totalWithoutTax

number

Order total without taxes.

subtotal

number

Order subtotal (product cost before shipping cost applied).

subtotalWithoutTax

number

Order subtotal without taxes.

tax

number

Order total tax.

couponName

string

Applied discount coupon name. undefined if no discount coupon is applied.

couponDiscount

number

Value of coupon discount applied to order.

volumeDiscount

number

Value of discount applied to subtotal (doesn't include discount coupon).

customerGroupDiscount

number

Discount based on customer group.

discount

number

Total discount applied to order.

shipping

number

Order shipping cost.

shippingWithoutTax

number

Order shipping cost without taxes.

handlingFee

number

Order handling fee.

handlingFeeWithoutTax

number

Order handling fee without taxes.

shippingAndHandling

number

Sum of shipping and handlingFee fields.

billingPerson

Customer billing address.

shippingPerson

Customer shipping address.

affiliateId

string

Affiliate ID used in order.

orderNumber

number

Internal order ID. Use ID from vendorNumber instead.

vendorNumber

string

Order ID. Matches order id in REST API and customer emails.

date

string

Order creation datetime in UNIX timestamp, for example, "1484638550".

paymentStatus

string

Payment status of an order.

One of:

AWAITING_PAYMENT

PAID

CANCELLED

REFUNDED

PARTIALLY_REFUNDED

INCOMPLETE

CUSTOM_PAYMENT_STATUS_1

CUSTOM_PAYMENT_STATUS_2

CUSTOM_PAYMENT_STATUS_3

fulfillmentStatus

string

Fulfillment status of an order.

One of:

AWAITING_PROCESSING

PROCESSING

SHIPPED

DELIVERED

WILL_NOT_DELIVER

RETURNED

READY_FOR_PICKUP

CUSTOM_FULFILLMENT_STATUS_1

CUSTOM_FULFILLMENT_STATUS_2

CUSTOM_FULFILLMENT_STATUS_3

customer

Customer's email and name.

extraFields

Order extra field details.

items

Name
Type
Description

quantity

number

Quantity of this product in order.

product

object product

Product details.

options

array

Selected product options.

product

Name
Type
Description

id

Integer

Product ID.

name

String

Product name.

price

Integer

Product price.

shortDescription

String

Product description truncated to 120 characters.

sku

String

Product SKU.

url

String

Link to a product page.

weight

Integer

Product weight.

billingPerson

Name
Type
Description

name

string

Customer's name.

phone

string

Customer's phone number.

companyName

string

Customer's company name.

street

string

Address: street.

city

string

Address: city.

countryName

string

Address: country name.

countryCode

string

Address: country code.

stateOrProvinceName

string

Address: state name.

stateOrProvinceCode

string

Address: state code.

postalCode

string

Address: zip code.

shippingPerson

Name
Type
Description

name

string

Customer's name.

phone

string

Customer's phone number.

companyName

string

Customer's company name.

street

string

Address: street.

city

string

Address: city.

countryName

string

Address: country name.

countryCode

string

Address: country code.

stateOrProvinceName

string

Address: state name.

stateOrProvinceCode

string

Address: state code.

postalCode

string

Address: zip code.

customer

Name
Type
Description

name

string

Customer's name.

email

string

Customer's email.

extraFields

Name
Type
Description

orderBy

number

Sorting position for order details page in Ecwid admin. Starts with 0 (highest position).

title

string

Extra field name.

orderDetailsDisplaySection

string

Section where the extra field is displayed.

type

string

Extra field type.

value

string

Extra field value.

Last updated 2 months ago

Was this helpful?

array of objects

object

object

object

object

items
billingPerson
shippingPerson
customer
extraFields