Activities

Apps in Wix work together by sharing information about site visitor activity. An activity is a visitor’s interaction with the site, such as filling out a contact form, making a purchase, or sharing a page from the site on social media.

You’ll use the WixHive to request information that’s useful for your app, and also post information that your app collects.

Activities are tracked by a visitor’s email, phone, or cookie. If a site visitor is a contact, you will be able to link between the contact and its activities.

Read more about the different activity types and their schemas below.

How it Works

When you register your app in the dev center, you can sign up to receive or post Activities about different events that happens within the website, according to your product needs.

  • Post an activity to report about events that occurred within your app.
  • Get an activity when it was reported to trigger an action within your app.

Post Activity

When posting an Activity to Wix, make sure the data conforms to the specific schema for that type of Activity, so that other apps know what to expect when receiving it. Each type of Activity has its own schema, represented in JSON schema format.

Activities are connected to a session, which is a cookie stored in the site visitor’s browser. This means that when you (or another app) post Activities from the same browser session, they are all linked to the same site visitor. If the site visitor is a Contact, all Activities connected to this session are linked to the Contact, even Activities posted before the Contact was created.

 How to Post an Activity

Use the Wix.Activities.postActivity SDK method.

You can see the full list of parameters in the method documentation, but here’s a quick look at the most important parameters:

  • activity.Info: Build this object using the correct activity schema.  Refer to the list of activities and their schemas.  
  • contactUpdate: Add any information your app has about the site visitor (such as email, phone, or name) in the contactUpdate object. This object links the Activity to a Contact.
  • details.additionalInfoUrl: When an important activity is posted, we display a notification in the site’s dashboard. Users can click on this notification to see more information about the activity, so define this URL when you post the activity. (Check out the section below – “What happens in the site’s dashboard when you post an activity” for more details.)

What happens in your app when you post the activity

Once you post the activity, you’ll receive the Activity ID immediately. If you used the contactUpdate object, we’ll check if the contact exists for this browser session:

  • If a contact already exists for this session, we’ll add the new information you provided to this contact and send you the contact ID.
  • If this contact doesn’t exist yet, we’ll create a new contact and send you its ID. All activities connected to this specific session will be linked to the new contact.

What happens in the site’s dashboard when you post an activity

You can use the points below as a quick check to make sure you implemented the WixHive correctly.

If you provided the site visitor’s email/phone number when you posted the activity, we’ll link the activity to a contact and show the new information to users. Here’s what users will see in the site’s dashboard – and what you should see when testing the WixHive in your app:

  • A notification for important activities: Users can click on this notification to see more information about the activity. You can direct users to a URL with more information – use the additionalInfoUrl parameter in the postActivity method.
    We display notifications for these activities:
    • Form activities (contact-form, subscription-form, form)
    • Scheduler appointment activity
    • eCommerce purchase activity
    • Hotels reservation activity
    • Social track activity

Note: If you think it’s important for us to notify users about an activity posted by your app, let us know!

  • A new message in the Wix Engage app: Users can see important activities that happened in their site – whether it’s done by an existing contact or an anonymous site visitor. (You can see the full list of important activities, above.)

  • New information about site visitors: When users go to the contact’s page, they can see the activity you posted, as well as any new information you sent about the contact. If the site visitor is a new contact, users will see the new contact in the contacts section of the dashboard.
    (You’ll add this information in the contactUpdate parameter in the postActivity method.)

Note: Activities that are not linked to a Contact will not be visible to users.

Get Activity

When you register your app, you can sign up to receive immediate notification when an Activity occurs. These events will be delivered to your app via webhooks and will include the Activity ID. To get the Activity data use the HTTP API or the JavaScript SDK with the relevant Activity ID.

There will be times when your app needs to get a list of Activities that have already occurred on a site. In such cases, you can request these Activities through our JavaScript SDK or through our HTTP API, as shown below.

You can use parameters to filter your search:

  • Use the from and until parameters to retrieve Activities by creation time.
  • Set the scope parameter to app to get Activities that were created by your app. Set the scope parameter to site to get Activities that were created by all apps on a site. Default is site.
  • Use the activityTypes parameter to filter by the type of Activity.

NODEJS

Copy
1
var ONE_HOUR = 60 * 60 * 1000;
2
var oneHourAgo = new Date(new Date().getTime() - ONE_HOUR);
3
contact.getActivities(null,
4
{
5
from: oneHourAgo.toISOString(),
6
until: new Date().toISOString(),
7
activityTypes: [api.Activities.TYPES.ALBUM_FAN.name, api.Activities.TYPES.ALBUM_SHARE.name],
8
scope: 'app',
9
pageSize: 50
10
}).then(
11
function(pagingActivitiesResult){
12
var activities = pagingActivitiesResult.results;
13
console.log(activities);
14
},
15
function(error){
16
console.log(error);
17
}
18
)

RUBY

Copy
1
# Get all Activities
2
client.activities
3
4
# Filter by Activity type
5
client.activities(activityTypes: Hive::Activities::MUSIC_ALBUM_FAN.type)
6
7
# Filter by date range
8
client.activities(from: Time.now.iso8601(3), until: Time.now.iso8601(3))

Activity Schemas

The activities listed below can be posted by your application to report about events that occurred within your app.

Forms

Use the following activities for form events in your app:

  • Contact-Form: when your app submits a contact form.
  • Subscription-Form: when your app submits a subscription from.
  • Form: when your app submits another type of form, like a survey.

You’ll add the site visitor’s details (name, email, etc) in the contactUpdate object, and not in the form activity itself (see more information on posting an activity). So there’s no need to post form fields that ask for these details.

Contact-Form

NameTypeDescription
subject Array[object]Subject the site visitor entered in the contact form
content (required)Object Content the site visitor entered in the contact form
content.messageStringMessage text 
content.mediaArrayMedia (for example, images the site visitor uploaded to the message)
additionalFields Array[object] More details submitted in the form
additionalFields.nameStringKey name
additionalFields.valueStringKey value

Get the Contact-Form Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.FORM_CONTACT_FORM,
3
info:{ subject:"My Subject", content:{message:"My Message"}},
4
details:{ additionalInfoUrl:'http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link}', summary:""},
5
contactUpdate:{ name:{first:"Kanye"}, emails:[{tag:"main",email:"email@email.com"}]}
6
};
7
8
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
9
var onFailure = function(d){console.log("Failure message:" + d)};
10
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Subscription-Form

NameTypeDescription
additionalFields Array[object] More details submitted in the form
additionalFields.nameStringKey name
additionalFields.valueStringKey value

Get the Subscription-Form Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.FORM_SUBSCRIPTION_FORM,
3
info: {additionalFields:[{name:"newsletterType", value:"Fitness"}]},
4
details:{additionalInfoUrl:"http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link", summary:''},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
};
7
8
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
9
var onFailure = function(d){console.log("Failure message:" + d)};
10
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Form

NameTypeDescription
type"CUSTOMER_SATISFACTION", "SURVEY", "EVENT_REGISTRATION", "ORDER", "DONATION", "QUIZ", "OTHER"Type of form submitted: * CUSTOMER_SATISFACTION: Form to give feedback. * SURVEY: Form for a general survey. * EVENT_REGISTRATION: Form to register for an event. * ORDER: Form to place an order. * DONATION: Form to make a donation. * QUIZ: Form to answer general questions. * OTHER: Any other type of form that's not listed here.
 fields Array[object]Fields in the form
nameStringKey name
valueStringKey value

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.FORM_FORM,
3
info:{type:"SURVEY", fields:[{name:"vegan",value:"yes"}]},
4
details:{additionalInfoUrl:"http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link}", summary:""},
5
contactUpdate:{name:{first:"Kanye"}, emails:[{tag:"main", email:"email@email.com"}]}
6
};
7
8
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
9
var onFailure = function(d){console.log("Failure message:" + d)};
10
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Get the Form activity JSON.

Scheduler

Use the following activities for scheduling events that occur in your app:

  • Appointment: when an appointment is made.
  • Cancel: when an appointment is cancelled.
  • Confirmation: when an appointment is confirmed.

Appointment and Confirmation

PropertyTypeDescription
appointmentId (recommended)StringThe unique identifier of a scheduled appointment
source (required)"GUEST" or "STAFF" Indicates who booked/confirmed the appointment
title (required)StringAppointment's title 
description (required)StringAppointment's description
infoLinkStringURL for more details about the appointment
priceObjectAppointment’s price
price.price (required)NumberPrice amount
price.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
price.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
locationObjectAppointment's location
location.addressStringAddress
location.cityStringCity
location.regionStringRegion
location.postalCodeStringPostal Code
location.countryStringCountry
location.urlStringLocation URL
timeObjectAppointment’s scheduled time
time.start (required)DateTimeScheduled start time
time.end (required)DateTimeScheduled end time
time.end (required)StringScheduled time zone
attendeesArray[object]Appointment's attendees
attendees.contactIdStringAttendee's contact ID
attendees.nameObjectAttendee's name
attendees.name.prefixStringName prefix
attendees.name.firstStringFirst name
attendees.name.middleStringMiddle name
attendees.name.lastStringLast name
attendees.name.suffixStringName suffix
attendees.phoneStringAttendee's phone
attendees.emailStringAttendee's email
attendees.notesStringAttendee's notes (like allergies or other restrictions)
attendees.selfBooleanTrue if the Wix user who scheduled the appointment will attend

Get the Appointment Activity and the Confirmation Activity JSONs.

APPOINTMENT

Copy
1
var activity = {
2
type:Wix.Activities.Type.SCHEDULER_APPOINTMENT,
3
info: { appointmentId: '455',
4
source:'GUEST',
5
title: 'AppointmentTitle',
6
description: 'AppointmentDescription',
7
infoLink: 'LinkToAppointment',
8
price: {price: 100, formattedPrice:'Price', currency:'USD'},
9
location: {address: 'address', city: 'NY', country: 'USA'},
10
time: {start:'2013-07-01T08:07:40.802Z', end:'2013-07-01T08:07:40.802Z', timezone:'US Eastern Standard Time'},
11
attendees: [{contactId:'ID', name: {first:'firstName', middle:'middleName', last:'lastName'}, phone: 'phoneNumber', email: 'email@gmail.com'}]},
12
details:{additionalInfoUrl:null, summary:''},
13
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
14
};
15
16
Wix.Activities.postActivity(activity, onSuccess, onFailure);

CONFIRMATION

Copy
1
var activity = {
2
type:Wix.Activities.Type.SCHEDULER_CONFIRMATION,
3
info: { appointmentId: '455',
4
source:'GUEST',
5
title: 'AppointmentTitle',
6
description: 'AppointmentDescription',
7
infoLink: 'LinkToAppointment',
8
price: {price: 100, formattedPrice:'Price', currency:'USD'},
9
location: {address: 'address', city: 'NY', country: 'USA'},
10
time: {start:'2013-07-01T08:07:40.802Z', end:'2013-07-01T08:07:40.802Z', timezone:'US Eastern Standard Time'},
11
attendees: [{contactId:'ID', name: {first:'firstName', middle:'middleName', last:'lastName'}, phone: 'phoneNumber', email: 'email@gmail.com'}]},
12
details:{additionalInfoUrl:null, summary:'testing subscription form'},
13
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
14
};
15
16
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Cancel

PropertyTypeDescription
appointmentId (recommended)StringThe unique identifier of a scheduled appointment
source (required)"GUEST" or "STAFF" Indicates who cancelled the appointment
cancelDate (required)DateTimeReservation cancel date
refund (required)ObjectRefund details
refund.kind (required)"FULL", "PARTIAL", or "NONE"Type of refund
refund.total (required)NumberTotal amount to refund
refund.currency (required)StringRefund currency code (i.e, EUR, USD, CAD)
refund.notesStringNotes about this refund
refund.destination (required)StringRefund's destination (credit card, cash, etc)
title (required)StringAppointment's title 
description (required)StringAppointment's description
infoLinkStringURL for more details about the appointment
priceObjectAppointment’s price
price.price (required)NumberPrice amount
price.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
price.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
locationObjectAppointment's location
location.addressStringAddress
location.cityStringCity
location.regionStringRegion
location.postalCodeStringPostal Code
location.countryStringCountry
location.urlStringLocation URL
timeObjectAppointment’s scheduled time
time.start (required)DateTimeScheduled start time
time.end (required)DateTimeScheduled end time
time.timeZone (required)StringScheduled time zone
attendeesArray[object]Appointment's attendees
attendees.contactIdStringAttendee's contact ID
attendees.nameObjectAttendee's name
attendees.name.prefixStringName prefix
attendees.name.firstStringFirst name
attendees.name.middleStringMiddle name
attendees.name.lastStringLast name
attendees.name.suffixStringName suffix
attendees.phoneStringAttendee's phone
attendees.emailStringAttendee's email
attendees.notesStringAttendee's notes (like allergies or other restrictions)
attendees.selfBooleanTrue if the Wix user who scheduled the appointment will attend

Get the Cancel Appointment Activity JSON.

Example

Copy
1
var activity = {
2
type:Wix.Activities.Type.SCHEDULER_CANCEL,
3
info: { appointmentId: '455',
4
source:'GUEST',
5
cancelDate: '2013-07-01T08:07:40.802Z',
6
refund: {kind: 'FULL', total: 100, currency:'USD'},
7
title: 'AppointmentTitle',
8
description: 'AppointmentDescription',
9
infoLink: 'LinkToAppointment',
10
price: {price: 100, formattedPrice:'Price', currency:'USD'},
11
location: {address: 'address', city: 'NY', country: 'USA'},
12
time: {start:'2013-07-01T08:07:40.802Z', end:'2013-07-01T08:07:40.802Z', timezone:'US Eastern Standard Time'},
13
attendees: [{contactId:'ID', name: {first:'firstName', middle:'middleName', last:'lastName'}, phone: 'phoneNumber', email: 'email@gmail.com'}]},
14
details:{additionalInfoUrl:null, summary:''},
15
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
16
};
17
18
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Social

Use the following activities to track social actions that occur in your app – for example, when a site visitor comments on the site, likes an Instagram photo, or posts a comment through Facebook:

  • Comment: when a site visitor posts a comment on the site – whether the comment is posted on the site only, or also posted to the visitor’s social media page through a plugin on the site.
  • Share-url: when a site visitor shares an item (like a blog post or photo) on social media.
  • Track: when a site visitor takes one of these social media actions on the user’s channel: like, follow, subscribe, pin.

Comment

PropertyTypeDescription
text (required)StringComment text
channel (required)"SITE", "FACEBOOK", "TWITTER", "LINKEDIN", "GOOGLE_PLUS", "PINTEREST", "INSTAGRAM", "TUMBLR", "BLOGGER", "WORDPRESS", or "OTHER"Where the comment was posted. SITE refers to the Wix site
metadataArray[object]Additional information about the comment
metadata.name (required)StringMetadata property name
metadata.value (required)StringMetadata value
commenterObjectDetails about the site visitor who made the comment
commenter.openIdObjectHow the site visitor was authenticated. Read more about openId.
commenter.openId.channel (required)"FACEBOOK", "TWITTER", "LINKEDIN", "GOOGLE_PLUS", "PINTEREST", "INSTAGRAM", "TUMBLR", "BLOGGER", "WORDPRESS", or "OTHER"Account used to authenticate the site visitor
commenter.nameObjectSite visitor's name
commenter.name.prefixStringName prefix
commenter.name.firstStringFirst name
commenter.name.middleStringMiddle name
commenter.name.lastStringLast name
commenter.name.suffixStringName suffix
commenter.emailStringSite visitor's email

Get the Comment Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.SOCIAL_COMMENT,
3
info: { text: 'social text',
4
channel:'FACEBOOK',
5
metadata: [{name:'metadata name', value: 'meta data value'}],
6
commenter:{openId:{channel:'FACEBOOK'},name:{first:'firstName', middle:'middleName', last:'lastName'},email:'email@gmail.com'},
7
details:{additionalInfoUrl:null, summary:'testing social activity'},
8
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
9
};
10
11
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
12
var onFailure = function(d){console.log("Failure message:" + d)};
13
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Share-url

PropertyTypeDescription
channel (required)"FACEBOOK", "TWITTER", "LINKEDIN", "GOOGLE_PLUS", "PINTEREST", "INSTAGRAM", "TUMBLR", "BLOGGER", "WORDPRESS", "SITE" or "OTHER"Where the link was shared
itemInfo (required)ObjectDetails about the item or page the site visitor tracked
itemInfo.itemUrl (required)StringURL of the social media item 
itemInfo.ItemThumbnailStringImageId of the item's thumbnail image
itemInfo.ItemId (required)StringID of this item
itemInfo.ItemType (required)"IMAGE", "VIDEO", "TEXT", "SITE", "ALBUM", or "PAGE"Type of social media item
Copy
1
var activity = {
2
type:Wix.Activities.Type.SOCIAL_SHARE_URL,
3
info: {channel: 'FACEBOOK',
4
itemInfo: {itemUrl : 'http://www.facebook.com/wix/', itemId : '1', itemType : 'PAGE'}},
5
details:{additionalInfoUrl:'http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link', summary:""},contactUpdate:null};
6
7
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
8
var onFailure = function(d){console.log("Failure message:" + d)};
9
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Track

PropertyTypeDescription
type (required)"LIKE", "FOLLOW", "SUBSCRIBE", "PIN_IT", "FAVORITE", "LOVE", "STAR", "OTHER"Social media action taken by the site visitor
channel (required)"FACEBOOK", "TWITTER", "LINKEDIN", "GOOGLE_PLUS", "PINTEREST", "INSTAGRAM", "TUMBLR", "BLOGGER", "WORDPRESS", "SITE" or "OTHER"Social media channel that contains the item the site visitor tracked
itemInfo (required)ObjectDetails about the item or page the site visitor tracked
itemInfo.itemUrl (required)StringURL of the social media item 
itemInfo.ItemThumbnailStringImageId of the item's thumbnail image
itemInfo.ItemId (required)StringID of this item
itemInfo.ItemType (required)"IMAGE", "VIDEO", "TEXT", "SITE", "ALBUM", or "PAGE"Type of social media item
Copy
1
var activity = {
2
type:Wix.Activities.Type.SOCIAL_TRACK,
3
info: {type: 'LIKE',
4
channel: 'FACEBOOK',
5
itemInfo: {itemUrl : 'http://www.facebook.com/wix/', itemId : '1', itemType : 'PAGE'}}, details: {additionalInfoUrl:'http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link}', summary:''},contactUpdate:null};
6
7
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
8
var onFailure = function(d){console.log("Failure message:" + d)};
9
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Hotels

Use the following activities for hospitality events in your app:

  • Purchase: When a site visitor purchases a service offered by the hotel.
  • Purchase-Failed: When the purchase of a hotel service could not be completed.
  • Reservation: When a site visitor reserves a hotel room.
  • Confirmation: When a reservation is confirmed.
  • Cancel: When a reservation is canceled.

Purchase

PropertyTypeDescription
reservationIdStringReservation ID
guests (required)ObjectGuests details
guests.total (required)NumberNumber of guests
guests.adults (required)NumberNumber of adult guests
guests.children (required)NumberNumber of child guests
stay (required)ObjectStay dates
stay.checkin (required)DateTimeCheckin date
stay.checkout (required)DateTimeCheckout date
rates (required)Array[object]Rate details
rates.date (required)DateTimeRate date
rates.subtotal (required)NumberSubtotal amount (without taxes)
rates.taxes (required)Array[object]Tax details
rates.taxes.name (required)StringTax name (occupancy tax, resort fee, etc)
rates.taxes.total (required)NumberTax total amount
rates.taxes.currency (required)StringTax currency code (i.e, EUR, USD, CAD)
rates.total (required)NumberTotal amount
rates.currency (required)StringRate currency code (i.e, EUR, USD, CAD)
payment (required)ObjectPayment details
payment.subtotal (required)NumberPayment subtotal
payment.total (required)NumberPayment total
payment.currency (required)StringPayment currency code (i.e, EUR, USD, CAD)
payment.source (required)StringPayment method (cash, credit, paypal, etc)
customerObjectCustomer details
customer.contactIdStringCustomer’s contact ID
customer.isGuestBooleantrue if the customer a returning guest
customer.nameObjectCustomer's name
customer.name.prefixStringName prefix
customer.name.firstStringFirst name
customer.name.middleStringMiddle name
customer.name.lastStringLast name
customer.name.suffixStringName suffix
customer.phoneStringCustomer's phone number
customer.emailStringCustomer's email
rooms (required)Array[object]Room details
rooms.idStringRoom ID
rooms.beds (required)Array[object]Room's bed list
kind (required)StringType of bed
kind.maxOccupancy (required)NumberRoom's occupancy number
kind.amenities (required)Array[string]List of amenities reserved

Get the Purchase Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.HOTELS_PURCHASE,
3
info: { reservationId: '455', guests:{ total: 1, adults: 1, children: 0},stay: { checkin: new Date(new Date().getTime() - (60 * 60 * 24)), checkout: new Date().toISOString() },rates:[{ date: new Date(new Date().getTime() - (60 * 60 * 24)), subtotal: 22.4, taxes: [ {name: 'stuff', total: 0.6, currency: 'USD'} ], total: 30, currency: 'USD'}],payment: {total: '1', subtotal: '1', currency: 'EUR', source: 'Cash'},customer: {contactId: '123', isGuest:true, name:{ prefix: 'Mr',first: 'Kanye', middle: 'k', last:'West', suffix:'The king'},phone: '1234567',email:'email@email.com'} , rooms:[{ id: 'single123', beds: [ {kind:'king'} ], maxOccupancy: 3, amenities: [ 'air conditioning', 'wifi', 'cable', 'goats']}] },
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Purchase-failed

PropertyTypeDescription
reservationIdStringReservation ID
guests (required)ObjectGuests details
guests.total (required)NumberNumber of guests
guests.adults (required)NumberNumber of adult guests
guests.children (required)NumberNumber of child guests
stay (required)ObjectStay dates
stay.checkin (required)DateTimeCheckin date
stay.checkout (required)DateTimeCheckout date
rates (required)Array[object]Rate details
rates.date (required)DateTimeRate date
rates.subtotal (required)NumberSubtotal amount (without taxes)
rates.taxes (required)Array[object]Tax details
rates.taxes.name (required)StringTax name (occupancy tax, resort fee, etc)
rates.taxes.total (required)NumberTax total amount
rates.taxes.currency (required)StringTax currency code (i.e, EUR, USD, CAD)
rates.total (required)NumberTotal amount
rates.currency (required)StringRate currency code (i.e, EUR, USD, CAD)
payment (required)ObjectPayment details
payment.subtotal (required)NumberPayment subtotal
payment.total (required)NumberPayment total
payment.currency (required)StringPayment currency code (i.e, EUR, USD, CAD)
payment.source (required)StringPayment method (cash, credit, paypal, etc)
payment.errorObjectDetails for payment error
payment.error.errorCodeNumberError code
payment.error.reasonStringReason why the payment failed
customerObjectCustomer details
customer.contactIdStringCustomer’s contact ID
customer.isGuestBooleantrue if the customer a returning guest
customer.nameObjectCustomer's name
customer.name.prefixStringName prefix
customer.name.firstStringFirst name
customer.name.middleStringMiddle name
customer.name.lastStringLast name
customer.name.suffixStringName suffix
customer.phoneStringCustomer's phone number
customer.emailStringCustomer's email
rooms (required)Array[object]Room details
rooms.idStringRoom ID
rooms.beds (required)Array[object]Room's bed list
kind (required)StringType of bed
kind.maxOccupancy (required)NumberRoom's occupancy number
kind.amenities (required)Array[string]List of amenities reserved

Get the Purchased-Failed Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.HOTELS_PURCHASE_FAILED,
3
info: { reservationId: '455', guests:{ total: 1, adults: 1, children: 0},stay: { checkin: new Date(new Date().getTime() - (60 * 60 * 24)), checkout: new Date().toISOString() },rates:[{ date: new Date(new Date().getTime() - (60 * 60 * 24)), subtotal: 22.4, taxes: [ {name: 'stuff', total: 0.6, currency: 'USD'} ], total: 30, currency: 'USD'}],payment: {total: '1', subtotal: '1', currency: 'EUR', source: 'Cash', error:{errorCode:'123', reason:'out of date'} },customer: {contactId: '123', isGuest:true, name:{ prefix: 'Mr',first: 'Kanye', middle: 'k', last:'West', suffix:'The king'},phone: '1234567',email:'email@email.com'} , rooms:[{ id: 'single123', beds: [ {kind:'king'} ], maxOccupancy: 3, amenities: [ 'air conditioning', 'wifi', 'cable', 'goats']}] },
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Confirmation and Reservation

PropertyTypeDescription
source (required)"GUEST" or "STAFF"Indicates who confirmed/reserved the room.
reservationIdStringReservation ID
guests (required)ObjectGuests details
guests.total (required)NumberNumber of guests
guests.adults (required)NumberNumber of adult guests
guests.children (required)NumberNumber of child guests
stay (required)ObjectStay dates
stay.checkin (required)DateTimeCheckin date
stay.checkout (required)DateTimeCheckout date
rates (required)Array[object]Rate details
rates.date (required)DateTimeRate date
rates.subtotal (required)NumberSubtotal amount (without taxes)
rates.taxes (required)Array[object]Tax details
rates.taxes.name (required)StringTax name (occupancy tax, resort fee, etc)
rates.taxes.total (required)NumberTax total amount
rates.taxes.currency (required)StringTax currency code (i.e, EUR, USD, CAD)
rates.total (required)NumberTotal amount
rates.currency (required)StringRate currency code (i.e, EUR, USD, CAD)
invoice (required)ObjectReservation invoice details
invoice.subtotal (required)NumberInvoice subtotal
invoice.total (required)NumberInvoice total
invoice.currency (required)StringInvoice currency code (i.e, EUR, USD, CAD)
customerObjectCustomer details
customer.contactIdStringCustomer’s contact ID
customer.isGuestBooleantrue if the customer a returning guest
customer.nameObjectCustomer's name
customer.name.prefixStringName prefix
customer.name.firstStringFirst name
customer.name.middleStringMiddle name
customer.name.lastStringLast name
customer.name.suffixStringName suffix
customer.phoneStringCustomer's phone number
customer.emailStringCustomer's email
rooms (required)Array[object]Room details
rooms.idStringRoom ID
rooms.beds (required)Array[object]Room's bed list
kind (required)StringType of bed
kind.maxOccupancy (required)NumberRoom's occupancy number
kind.amenities (required)Array[string]List of amenities reserved

Get the Confirmation and the Reservation Activity JSON.

RESERVATION

Copy
1
var activity = {
2
type:Wix.Activities.Type.HOTELS_RESERVATION,
3
info: {source:'GUEST' , reservationId: '455', guests:{ total: 1, adults: 1, children: 0},stay: { checkin: new Date(new Date().getTime() - (60 * 60 * 24)), checkout: new Date().toISOString() },rates:[{ date: new Date(new Date().getTime() - (60 * 60 * 24)), subtotal: 22.4, taxes: [ {name: 'stuff', total: 0.6, currency: 'USD'} ], total: 30, currency: 'USD'}], invoice:{subtotal: 20, total:30, currency:"UDS"},customer: {contactId: '123', isGuest:true, name:{ prefix: 'Mr',first: 'Kanye', middle: 'k', last:'West', suffix:'The king'},phone: '1234567',email:'email@email.com'} , rooms:[{ id: 'single123', beds: [ {kind:'king'} ], maxOccupancy: 3, amenities: [ 'air conditioning', 'wifi', 'cable', 'goats']}] },
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

CONFIRMATION

Copy
1
var activity = {
2
type:Wix.Activities.Type.HOTELS_CONFIRMATION,
3
info: {source:"GUEST" , reservationId: '455', guests:{ total: 1, adults: 1, children: 0},stay: { checkin: new Date(new Date().getTime() - (60 * 60 * 24)), checkout: new Date().toISOString() },rates:[{ date: new Date(new Date().getTime() - (60 * 60 * 24)), subtotal: 22.4, taxes: [ {name: 'stuff', total: 0.6, currency: 'USD'} ], total: 30, currency: 'USD'}], invoice:{subtotal: 20, total:30, currency:"UDS"},customer: {contactId: '123', isGuest:true, name:{ prefix: 'Mr',first: 'Kanye', middle: 'k', last:'West', suffix:'The king'},phone: '1234567',email:'email@email.com'} , rooms:[{ id: 'single123', beds: [ {kind:'king'} ], maxOccupancy: 3, amenities: [ 'air conditioning', 'wifi', 'cable', 'goats']}] },
4
details:{additionalInfoUrl:null, summary:'testing hotel confirmation'},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Cancel

PropertyTypeDescription
cancelDate (required)DateTimeReservation cancel date
refund (required)ObjectRefund details
refund.kind (required)"FULL", "PARTIAL", or "NONE"Type of refund
refund.total (required)NumberTotal amount to refund
refund.currency (required)StringRefund currency code (i.e, EUR, USD, CAD)
refund.notesStringNotes about this refund
refund.destination (required)StringRefund's destination (credit card, cash, etc)
reservationIdStringReservation ID
guests (required)ObjectGuests details
guests.total (required)NumberNumber of guests
guests.adults (required)NumberNumber of adult guests
guests.children (required)NumberNumber of child guests
stay (required)ObjectStay dates
stay.checkin (required)DateTimeCheckin date
stay.checkout (required)DateTimeCheckout date
rates (required)Array[object]Rate details
rates.date (required)DateTimeRate date
rates.subtotal (required)NumberSubtotal amount (without taxes)
rates.taxes (required)Array[object]Tax details
rates.taxes.name (required)StringTax name (occupancy tax, resort fee, etc)
rates.taxes.total (required)NumberTax total amount
rates.taxes.currency (required)StringTax currency code (i.e, EUR, USD, CAD)
rates.total (required)NumberTotal amount
rates.currency (required)StringRate currency code (i.e, EUR, USD, CAD)
invoice (required)ObjectReservation invoice details
invoice.subtotal (required)NumberInvoice subtotal
invoice.total (required)NumberInvoice total
invoice.currency (required)StringInvoice currency code (i.e, EUR, USD, CAD)
customerObjectCustomer details
customer.contactIdStringCustomer’s contact ID
customer.isGuestBooleantrue if the customer a returning guest
customer.nameObjectCustomer's name
customer.name.prefixStringName prefix
customer.name.firstStringFirst name
customer.name.middleStringMiddle name
customer.name.lastStringLast name
customer.name.suffixStringName suffix
customer.phoneStringCustomer's phone number
customer.emailStringCustomer's email
rooms (required)Array[object]Room details
rooms.idStringRoom ID
rooms.beds (required)Array[object]Room's bed list
kind (required)StringType of bed
kind.maxOccupancy (required)NumberRoom's occupancy number
kind.amenities (required)Array[string]List of amenities reserved

Get the Cancel Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.HOTELS_CANCEL,
3
info: {cancelDate: new Date().toISOString() ,refund: {kind:'FULL', total:100, currency:'USD', notes:'too expensive', destination:'Tel Aviv'} ,reservationId: '455', guests:{ total: 1, adults: 1, children: 0},stay: { checkin: new Date(new Date().getTime() - (60 * 60 * 24)), checkout: new Date().toISOString() },rates:[{ date: new Date(new Date().getTime() - (60 * 60 * 24)), subtotal: 22.4, taxes: [ {name: 'stuff', total: 0.6, currency: 'USD'} ], total: 30, currency: 'USD'}], invoice:{subtotal: 20, total:30, currency:"UDS"},customer: {contactId: '123', isGuest:true, name:{ prefix: 'Mr',first: 'Kanye', middle: 'k', last:'West', suffix:'The king'},phone: '1234567',email:'email@email.com'} , rooms:[{ id: 'single123', beds: [ {kind:'king'} ], maxOccupancy: 3, amenities: [ 'air conditioning', 'wifi', 'cable', 'goats']}] },
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Music

Use the following activities for music events in your app:

  • Track-Play: When a request to start playing a song is made
  • Track-Skip: When a track was skipped
  • Track-Played: When a song has completed its run
  • Track-Lyrics: When the track lyrics are requested
  • Track-Share: When a track is shared using the app
  • Album-Share: When an album is shared through your app
  • Album-Fan: When a visitor becomes a fan of an album
  • Album-Played: When an album has completed its run

Track-Play, Track-Skip, Track-Played, and Track-Lyrics

PropertyTypeDescription
track (required)ObjectTrack details
track.name (required)StringTrack name
track.idStringTrack ID
album (required)ObjectAlbum details
album.name (required)StringAlbum name
album.idStringAlbum ID
artistObjectArtist details
artist.name (required)StringArtist name
artist.idStringArtist ID

Get the Track-Play, Track-Skip, Track-Played, and Track-Lyrics Activity JSON.

TRACK-PLAY

Copy
1
var activity = {
2
type:Wix.Activities.Type.TRACK_PLAY,
3
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

TRACK-SKIP

Copy
1
var activity = {
2
type:Wix.Activities.Type.TRACK_SKIP,
3
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:'testing track skip'},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

TRACK-PLAYED

Copy
1
var activity = {
2
type:Wix.Activities.Type.TRACK_PLAYED,
3
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:'testing track played'},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

TRACK-LYRICS

Copy
1
var activity = {
2
type:Wix.Activities.Type.TRACK_LYRICS,
3
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:'testing track lyrics'},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Track-Share

PropertyTypeDescription
track (required)ObjectTrack details
track.name (required)StringTrack name
track.idStringTrack ID
album (required)ObjectAlbum details
album.name (required)StringAlbum name
album.idStringAlbum ID
artistObjectArtist details
artist.name (required)StringArtist name
artist.idStringArtist ID
sharedTo (required)"FACEBOOK", "GOOGLE_PLUS", "TWITTER", "BLOGGER", or "TUMBLR"Where item was shared

Get the Track-Share Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.TRACK_SHARE,
3
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'},sharedTo:'FACEBOOK'},
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Album-Share

PropertyTypeDescription
album (required)ObjectAlbum details
album.name (required)StringAlbum name
album.idStringAlbum ID
artistObjectArtist details
artist.name (required)StringArtist name
artist.idStringArtist ID
sharedTo (required)"FACEBOOK", "GOOGLE_PLUS", "TWITTER", "BLOGGER", or "TUMBLR"Where item was shared

Get the Album-Share Activity JSON.

Example:

Copy
1
var activity = {
2
type:Wix.Activities.Type.ALBUM_SHARE,
3
info: {album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}, sharedTo:'FACEBOOK',
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Album-Fan and Album-Played

album (required)ObjectAlbum details
album.name (required)StringAlbum name
album.idStringAlbum ID
artistObjectArtist details
artist.name (required)StringArtist name
artist.idStringArtist ID

Get the Album-Fan and the Album-Played Activity JSON.

ALBUM-FAN

Copy
1
var activity = {
2
type:Wix.Activities.Type.ALBUM_FAN,
3
info: {album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:''},
5
contactUpdate:{}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

ALBUM-PLAYED

Copy
1
var activity = {
2
type:Wix.Activities.Type.ALBUM_PLAYED,
3
info: {album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
4
details:{additionalInfoUrl:null, summary:'testing music track played'},
5
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
6
}
7
8
Wix.Activities.postActivity(activity, onSuccess, onFailure);

eCommerce

Use the following activities for eCommerce events in your app:

  • Cart-add: An item was added to the cart.
  • Cart-remove: An item was removed from the cart.
  • Cart-abandon: A cart with these items was abandoned.
  • Cart-checkout: A checkout process has begun with this cart.
  • Purchase: The checkout process has completed.

Note: Does your app rely on getting eCommerce activities that happened in the site? Keep in mind that Wix’s eCommerce app, WixStores, currently posts only the purchase activity.

Cart-add and Cart-remove

|Property|Type|Description|
|---|---|---| 
|cartId (required)|String|Cart ID|
|storeId (required)|String|Store ID |
|storeName|String|Name of store|
|item (required)|Array[object]|Item added/removed from cart|
|item.id (required)|String|Item ID|
|item.type|"PHYSICAL" or "DIGITAL"|Item type|
|item.sku|String|Item SKU number|
|item.title (required)|String|Item's title|
|item.quantity (required)|Integer|Item's quantity|
|item**.price|Number|Item's price|
|item.formattedPrice|String|Price format (i.e, €0,99 or $0.99)|
|item.currency (required)|String|Currency code (i.e, EUR, USD, CAD)|
|item.productLink |String|Item's link|
|item.weight|Number|Item's weight|
|item.formattedWeight|String|Weight format|
|item.media|Object|Media details for this item (like a photo)|
|item.media.thumbnail|String|Link to the thumbnail |
|item.variants (required)|Array[object]|Item's variants (like a specific color or size)|
|item.variants.title (required)|String|Variant title|
|item.variants.value|String|Variant value|
|item.categories|Array[string]|Item's categories (such as shirt, summer sale, etc.)|
|item.metadata|Array[object]|Additional information about this item|
|item.metadata.name (required)|String|Metadata name|
|item.metadata.value (required)|String|Metadata value|

Get the Cart-add JSON and the Cart-remove JSON.

CART-ADD

Copy
1
var activity = {
2
type:Wix.Activities.Type.ECOMMERCE_CART_ADD,
3
info:{cartId: '11111', storeId: '11111', storeName: 'WixStore', item:{ id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
4
quantity: 1, price: '1', formattedPrice: '1.1',
5
currency: 'EUR', productLink: 'link', weight: '1',
6
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
7
categories: ['shirt','clothing','wix'],
8
metadata: [ {name: "item", value: "1"} ],
9
variants: [{title: 'title', value: '1'}]}},
10
details:{additionalInfoUrl:null, summary:''},
11
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
12
}
13
14
Wix.Activities.postActivity(activity, onSuccess, onFailure);

CART-REMOVE

Copy
1
var activity = {
2
type:Wix.Activities.Type.ECOMMERCE_CART_REMOVE,
3
info:{cartId: '11111', storeId: '11111', storeName: 'WixStore', item:{ id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
4
quantity: 1, price: '1', formattedPrice: '1.1',
5
currency: 'EUR', productLink: 'link', weight: '1',
6
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
7
categories: ['shirt','clothing','wix'],
8
metadata: [ {name: "item", value: "1"} ],
9
variants: [{title: 'title', value: '1'}]}},
10
details:{additionalInfoUrl:null, summary:'testing cart remove'},
11
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
12
}
13
14
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Cart-abandon and Cart-checkout

|Property |Type |Description|
|---|---|---| 
|cartId (required)|String|Cart ID|
|storeId (required)|String|Store ID |
|storeName|String|Name of store|
|items (required)|Array[object]|Items in cart|
|items.id (required)|String|Item ID|
|items.type|"PHYSICAL" or "DIGITAL"|Item type|
|items.sku|String|Item SKU number|
|items.title (required)|String|Item's title|
|items.quantity (required)|Integer|Item's quantity|
|items**.price|Number|Item's price|
|items.formattedPrice|String|Price format (i.e, €0,99 or $0.99)|
|items.currency (required)|String|Currency code (i.e, EUR, USD, CAD)|
|items.productLink |String|Item's link|
|items.weight|Number|Item's weight|
|items.formattedWeight|String|Weight format|
|items.media|Object|Media details for this item (like a photo)|
|items.media.thumbnail|String|Link to the thumbnail |
|items.variants (required)|Array[object]|Item's variants (like a specific color or size)|
|items.variants.title (required)|String|Variant title|
|items.variants.value|String|Variant value|
|items.categories|Array[string]|Item's categories (such as shirt, summer sale, etc.)|
|items.metadata|Array[object]|Additional information about this item|
|items.metadata.name (required)|String|Metadata name|
|items.metadata.value (required)|String|Metadata value|

Get the Cart-abandon JSON and the Cart-checkout JSON.

CART-CHECKOUT

Copy
1
var activity = {
2
type:Wix.Activities.Type.ECOMMERCE_CART_CHECKOUT,
3
info:{cartId: '11111', storeId: '11111', storeName: 'WixStore', items:[{ id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
4
quantity: 1, price: '1', formattedPrice: '1.1',
5
currency: 'EUR', productLink: 'link', weight: '1',
6
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
7
categories: ['shirt','clothing','wix'],
8
metadata: [ {name: "item", value: "1"} ],
9
variants: [{title: 'title', value: '1'}]}]},
10
details:{additionalInfoUrl:null, summary:''},
11
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
12
}
13
14
Wix.Activities.postActivity(activity, onSuccess, onFailure);

CART-ABANDON

Copy
1
var activity = {
2
type:Wix.Activities.Type.ECOMMERCE_CART_ABANDON,
3
info:{cartId: '11111', storeId: '11111', storeName: 'WixStore', items:[{ id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
4
quantity: 1, price: '1', formattedPrice: '1.1',
5
currency: 'EUR', productLink: 'link', weight: '1',
6
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
7
categories: ['shirt','clothing','wix'],
8
metadata: [ {name: "item", value: "1"} ],
9
variants: [{title: 'title', value: '1'}]}]},
10
details:{additionalInfoUrl:null, summary:'testing music track played'},
11
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
12
}
13
14
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Purchase

|Property |Type |Description|
|---|---|---| 
|cartId (required)|String|Cart ID|
|storeId (required)|String|Store ID|
|storeName|String|Name of store|
|orderId (recommended)|String|Order ID|
|items (required)|Array[object]|Purchased items|
|items.id (required)|String|Item ID|
|items.type|"PHYSICAL" or "DIGITAL"|Item type|
|items.sku|String|Item SKU number|
|items.title (required)|String|Item's title|
|items.quantity (required)|Integer|Item's quantity|
|items**.price|Number|Item's price|
|items.formattedPrice|String|Price format (i.e, €0,99 or $0.99)|
|items.currency (required)|String|Currency code (i.e, EUR, USD, CAD)|
|items.productLink |String|Item's link|
|items.weight|Number|Item's weight|
|items.formattedWeight|String|Weight format|
|items.media|Object|Media details for this item (like a photo)|
|items.media.thumbnail|String|Link to the thumbnail |
|items.variants (required)|Array[object]|Item's variants (like a specific color or size)|
|items.variants.title (required)|String|Variant title|
|items.variants.value|String|Variant value|
|items.categories|Array[string]|Item's categories (such as shirt, summer sale, etc.)|
|items.metadata|Array[object]|Additional information about this item|
|items.metadata.name (required)|String|Metadata name|
|items.metadata.value (required)|String|Metadata value|
|payment (required)|Object|Payment details|
|payment.total (required)|Number|Payment total|
|payment.subTotal (required)|Number|Payment subtotal|
|payment.formattedTotal|String|Formatted total|
|payment.formattedSubTotal|String|Formatted subtotal|
|payment.currency (required)|String|Currency code (i.e, EUR, USD, CAD)|
|payment.coupon|Object|Coupon details|
|payment.coupon.total (required)|Number|Amount the coupon deducted from the total price|
|payment.coupon.FormattedTotal|String|Formatted coupon total|
|payment.coupon.title (required)|String|Coupon title|
|payment.tax|Object|Payment's tax details|
|payment.tax.total (required)|Number|Tax total|
|payment.tax.formattedTotal|String|Formatted tax total|
|payment.shipping|Object|Shipping details|
|payment.shipping.total (required)|Number|Shipping total|
|payment.shipping.formattedTotal|String|Formatted shipping total|
|shippingAddress|Object|Shipping address details|
|shippingAddress.firstName|String|Recipient's first name|
|shippingAddress.lastName|String|Recipient's last name|
|shippingAddress.email|String|Recipient's email|
|shippingAddress.phone|String|Recipient's phone|
|shippingAddress.country|String|Recipient's country|
|shippingAddress.countryCode|String|Recipient's country code|
|shippingAddress.region|String|Recipient's region|
|shippingAddress.regionCode|String|Recipient's region code|
|shippingAddress.city|String|Recipient's city|
|shippingAddress.address1|String|Recipient's address| |shippingAddress.address2|String|Recipient's address, part 2| |shippingAddress.zip|String|Recipient's postal code| |shippingAddress.company|String|Recipient's company| |billingAddress|Object|Billing address details| |billingAddress.firstName|String|Buyer's first name| |billingAddress.lastName|String|Buyer's last name| |billingAddress.email|String|Buyer's email| |billingAddress.phone|String|Buyer's phone| |billingAddress.country|String|Buyer's country| |billingAddress.countryCode|String|Buyer's country code| |billingAddress.region|String|Buyer's region| |billingAddress.regionCode|String|Buyer's region code| |billingAddress.city|String|Buyer's city| |billingAddress.address1|String|Buyer's address| |billingAddress.address2|String|Buyer's address, part 2| |billingAddress.zip|String|Buyer's postal code| |billingAddress.company|String|Buyer's company| |paymentGateway|String|Payment gateway name| |note|String|Notes about the purchase| |buyerAcceptsMarketing|Boolean|True if the buyer opts to receive marketing emails from the vendor|

Get the Purchase Activity JSON.

Example

Copy
1
var activity = {
2
type:Wix.Activities.Type.ECOMMERCE_PURCHASE,
3
info:{
4
cartId:'123', storeId:'123', storeName:'Wix', orderId:'123',
5
items:[{
6
id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
7
quantity: 1, price: '1', formattedPrice: '1.1',
8
currency: 'EUR', productLink: 'link', weight: '1',
9
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
10
categories: ['shirt','clothing','wix'],
11
metadata: [ {name: "item", value: "1"} ],
12
variants: [{title: 'title', value: '1'}]
13
}],
14
payment:{
15
total: '1', subtotal: '1', formattedTotal: '1.0', formattedSubtotal: '1.0', currency: 'EUR',
16
coupon: {total: '1', title: 'Dis'}, tax: {total: 1, formattedTotal: 1},
17
shipping: {total: 1, formattedTotal: 1}},
18
billingAddress: {
19
firstName: 'Wix' , lastName: 'Cool',
20
email: 'wix@example.com', phone: '12345566',
21
city: 'Bitola', address1: 'Marshal Tito', address2: 'Marshal Tito',
22
region: 'Bitola', regionCode: '7000',
23
country: 'USA', countryCode: 'US',
24
zip: '7000',
25
company: 'Wix.com'
26
},
27
paymentGateway: 'PAYPAL',
28
note: 'Note',
29
buyerAcceptsMarketing: true
30
},
31
details:{additionalInfoUrl:null, summary:''},
32
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
33
}
34
35
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Messaging

Use the following activity for chat and other messaging events in your app:

  • im: when a chat/sms message is sent between a Wix user and a site visitor/contact.

im

PropertyTypeDescription
type (required)‘chat’ or ‘sms’Type of message: * chat - message sent to /received from the user’s site. * sms - message sent to / received from the user’s mobile phone
content (required)Array[objects]Information about the message
content.direction (required)‘BUSINESS_TO_CUSTOMER’, ‘CUSTOMER_TO_BUSINESS’Message direction: * BUSINESS_TO_CUSTOMER - the Wix user sent an message to the site visitor/contact. * CUSTOMER_TO_BUSINESS - the Wix user received an message from a site visitor/contact
content.time (required)DateTimeTime the message was sent, as an ISO 8601 timestamp
content.message (required)StringMessage text
content.media (required)Array[objects]Information about any media files sent in the message
content.media.name (required)StringName of the media file
content.media.contentType (required)StringType of media file, i.e: image, video, document
content.media.url (required)StringURL of the media file
threadIdStringA ID for the conversation, to identify all messages that are part of this thread
metadataArray[objects]Additional information about the chat
name (required)StringMetadata property name
value (required)StringMetadata value

Get the im activity JSON.

Example

Copy
1
var activity = {
2
type: Wix.Activities.Type.MESSAGE_IM,
3
info: { type:'CHAT', content: [{ direction: 'CUSTOMER_TO_BUSINESS', time: '2016-09-15T15:53:00', message: 'test message', media: [{name:'image',contentType:'image',url:'http://static.wixstatic.com/media/3cd1de924697419088c1e033bb3384ef.jpg'}] }]},
4
details:{additionalInfoUrl:'http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link}', summary:""},
5
contactUpdate:null
6
};
7
8
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
9
var onFailure = function(d){console.log("Failure message:" + d)};
10
Wix.Activities.postActivity(activity, onSuccess, onFailure);

Events

Use the RSVP activity for RSVPs to events created by Wix users (like conferences, webinars, or parties).

RSVP

PropertyTypeDescription
eventId (required)StringID of the event
eventTitle (required)StringName of the event
eventDescriptionStringEvent description
totalNumberAttendeesNumberHow many guests will attend the event
priceObjectDetails about the event’s price
price.price (required)NumberPrice
price.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
price.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
locationObjectLocation of the event
location.nameStringLocation name
location.address (required)StringLocation address
timeObjectThe date & time of the event
time.start (required)DatetimeScheduled start time
time.endDatetimeScheduled end time
time.timeZone (required)StringTime zone

Get the rsvp activity JSON.

Example

Copy
1
var activity = {
2
type: Wix.Activities.Type.EVENTS_RSVP,
3
info: {
4
eventId: '123456789123456789123456789123456789',
5
eventTitle: 'my appointment',
6
price: {
7
price: '1',
8
currency: 'USD',
9
formattedPrice: '$1.00'
10
},
11
location: {
12
address: '123 meep st.',
13
},
14
time: {
15
start: new Date().toISOString(),
16
end: new Date(new Date().getTime() + (60 * 60 * 24)).toISOString(),
17
timeZone: 'ET'
18
}
19
},
20
contactUpdate: {
21
"name": {
22
first: "firstName",
23
middle: "middleName",
24
last: "lastName"
25
},
26
emails: [{
27
tag: "main",
28
email: "email@gmail.com"
29
}]
30
}
31
}
32
33
Wix.Activities.postActivity(activity, function(res) { console.log(res) }, function(err) { console.log(err) });

Deprecated

  • The EVENTS_EVENT_UPDATE activity is now deprecated. Use the updated RSVP activity instead.
  • The CONTACT_CONTACT_FORM activity is deprecated. Use the updated contact-form activity or our new form activity (for other types of forms), instead.
  • The CONTACT_SUBSCRIPTION_FORM activity is now deprecated. Use the updated subscription-form activity instead.
  • The SEND_MESSAGE activity is deprecated. Use the IM activity instead.
Was this helpful?
Yes
No