Search.../

WixHive

About WixHive

The WixHive platform allows you to communicate with other apps installed on the website and to work as part of a full solution.

WixHive has two core objects, Contact and Activity, which are described below. All apps installed on the user’s site share Activities and Contacts, and WixHive enables these apps to communicate with each other to share object data.

Contact

A contact is a person relevant to the user’s business, either a site visitor who has performed a meaningful interaction within the site or a person who has been added directly by the user.

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. Activities are tracked by a visitor’s email, phone, or cookies. If a site visitor is a contact, you will be able to link between the contact and its activities.

How it Works

The WixHive collects information from the user’s website or business, including contacts and activities. This information is saved in the scope of a website, and every component installed in that website should report all data it collects. Using the information collected by the website, allows you to enhance your app capabilities.

The WixHive allows you to post and get activities and contacts information, accessible from the HTTP API and the JavaScript SDK.

Implementation

Once we approve your mockups and you’re in the development stage, you can start implementing the WixHive.

Here’s how:

  1. Understand how to use the WixHive. Read more about our Contacts and Activities. We’ll explain how and when to use the SDK and HTTP API for WixHive requests.
  2. Let us know what you’re using the WixHive for. Request permissions to use the WixHive:
    1. In your app’s page in the Dev Center, go to the WixHive API tab.
      Note: You’ll only see this tab once your mockups were approved. You won’t see this tab in test apps or if you’re in the proposal/mockup review stages.
    2. Under Select WixHive Permissions, check the WixHive operations that are relevant for you app.  
    3. Explain how these operations are relevant for your app.
      Note: Before you submit your app, all methods are available for you to use – except for getContacts and getContactById. (If you need these two methods to test a feature in your app, let us know.) After you submit, we’ll review your WixHive permission request and approve the relevant permissions.
  3. Learn about signing your requestsThis is needed when sending requests via the HTTP API only.
  4. (Optional) You can get webhooks about new activities and contacts in the site. Register in the Dev Center to receive contact and activity webhooks.

Was this helpful?

Contacts

A contact is someone relevant to the Wix user’s business – either a site visitor who has performed a meaningful interaction within the site, or a person who was added directly by the user.

Users can manage their contacts from the Wix Dashboard – they can add, view, or delete contacts, including the contacts your app will create.

How it Works

With the WixHive, you can get information about contacts and also share information your app collects – like a contact’s name, email, address, etc. (see the Contact Schema for all properties):

  • When a user adds or updates a contact using your app, share it with the WixHive to create or update the contact. This is for any app that allows users to manage contacts or contact information (hotel guests, shipping addresses, etc).
  • When your app needs to use information about contacts, get it from the WixHive. You’ll be able to get information about all contacts – not just the ones created by your app.

Important: If your app collects contact information when site visitors perform actions on the site (like purchases or reservations), don’t use the methods shown below. Instead, post the activity – we’ll create the contact while also linking the contact to its activity on the site.

Create/Update Contacts

When you have information about a contact, there are three ways to share it with the WixHive – choose the one that best describes your use case:

Once you share the information, the contact is immediately created/updated, and users can see it in the Contacts section of the Wix Dashboard (it may take a few seconds to update).

Report Information About a Contact

This is the most common way to add information about a contact. You simply report the data your app collected, making sure to include at least one of these details – the contact’s email or phone number.

We’ll check if the contact already exists – if it does, we’ll update it. If not, we’ll create a new contact.

When to use it:

  • You don’t have the Contact ID
  • You have a lot of information about a specific contact (it’ll save you the hassle of posting each one separately!)

Here’s how:

Share all the information you have about the contact using the Wix.Contacts.reconcileContact SDK method or the POST /Contacts (version=2.0.0) HTTP API endpoint.

Remember to include the email or phone number in your request – we need it to create/update the contact.

Once posted, we’ll check if the contact already exists and immediately send you a response with this information:

  • If this contact doesn’t exist, we’ll create it and send you the Contact ID.
  • If the contact already exists, we’ll add the new information and send you:
    • The Contact ID
    • The reconciled information (we’ll send this only if your app has read permissions from the WixHive)
    • Any rejected data – if this contact already has a value for a property you sent, and the data type isn’t an array, we’ll dismiss it and send you the rejected data.
      You can override the existing information with your data by prompting the user to use your value instead – here’s how.

 Note: If we find more than one contact that matches the information you sent, we’ll return the contact that was created first.

JS SDK

var contactInfo = {
name: {first:"firstName", middle:"middleName", last:"lastName"},
emails: [{tag:"main", email:"email@gmail.com"}]
};
Wix.Contacts.reconcileContact(contactInfo, function(ContactData), function(errorType));
JavaScript | Copy Code

HTTP API

POST /v1/contacts?version=2.0.0 HTTP/1.1
Accept: "*/*"
User-Agent: Restler for node.js
Host: openapi.wix.com
Accept-Encoding: gzip, deflate
x-wix-application-id: 13d6663a-d101-36f6-16e8-24723992a8bf
x-wix-instance-id: 13d6669a-1a08-51bc-0360-43e7a980348e
x-wix-timestamp: 2015-07-07T13:49:43.084Z
Content-Length: 82
content-type: application/json
x-wix-signature: MTQ2MmE0_QxNy1lMmExLWM5NWItM2Q2MzhkOTI2OTA0
Connection: keep-alive
{
"emails":[{
"tag":"work",
"email":"karen_meep@wix.com",
"emailStatus":"recurring"
}]
}
HTTP | Copy Code

Add Specific Information to an Existing Contact

When you already have the Contact ID, you can add a value to a specific property – as long as its data type is an array: email, phone, address, URL, and date. See the Contact Schema for a list of all properties and their data type.

What if the property’s data type isn’t an array? In that case, just report the information you have about the contact.

How to add a value to a specific property:

Use any one of the POST /Contacts/{ContactId}/* HTTP API endpoints (for example: POST /Contacts/{ContactId}/address).

Once posted, we’ll add the new information to the contact.

POST /v1/contacts/280ea988-9a4a-4804-8b62-90c5d7fc7391/address?version=1.0.0&modifiedAt=2015-07-09T13%3A24%3A08.653Z HTTP/1.1
Accept: "*/*"
User-Agent: Restler for node.js
Host: openapi.wix.com
Accept-Encoding: gzip, deflate
x-wix-application-id: 13d6663a-d101-36f6-16e8-24723992a8bf
x-wix-instance-id: 13d6669a-1a08-51bc-0360-43e7a980348e
x-wix-timestamp: 2015-07-09T13:24:12.367Z
Content-Length: 151
content-type: application/json
x-wix-signature: MTQ2MmE0_QxNy1lMmExLWM5NWItM2Q2MzhkOTI2OTA0
Connection: keep-alive
{
"tag":"work",
"address":"500 Terry A Francois",
"neighborhood":"Awesomeville",
"city":"San Francisco",
"region":"CA",
"country":"USA",
"postalCode":"94158"
}
HTTP | Copy Code

Override Information for an Existing Contact

You can override data as long as the Wix user approves the change – so make sure your UI includes the option for the user to select the correct data.

Here’s an example: The Wix user updated a contact’s name using your app. Your app reports this change – but since the contact already has a name, your data is rejected. All is not lost, though – just prompt the user to approve the change, and then override existing data with newer information from your app.

To use this method, you need:

  1. The Contact ID
  2. The user’s approval to override the information.
  3. If the property is an array, you need the ID of the specific value you are changing.

How to override information:

Once the user approves, you can update the value for a specific property – use any one of the PUT /Contacts/{ContactId}/* HTTP API endpoints.

PUT /v1/contacts/3ea03b98-0d73-4e18-af4e-da42c4f1e5c6/address/1?version=1.0.0&modifiedAt=2015-07-09T13%3A24%3A07.311Z HTTP/1.1
Accept: "*/*"
User-Agent: Restler for node.js
Host: openapi.wix.com
Accept-Encoding: gzip, deflate
x-wix-application-id: 13d6663a-d101-36f6-16e8-24723992a8bf
x-wix-instance-id: 13d6669a-1a08-51bc-0360-43e7a980348e
x-wix-timestamp: 2015-07-09T13:24:11.009Z
Content-Length: 140
content-type: application/json
x-wix-signature: MTQ2MmE0_QxNy1lMmExLWM5NWItM2Q2MzhkOTI2OTA0
Connection: keep-alive
{
"tag":"Wix NYC Lounge",
"address":"235 W 23rd St",
"neighborhood":"Wixville",
"city":"NYC",
"region":"NY",
"country":"USA",
"postalCode":"10011"
}
HTTP | Copy Code

Get Contact Details

There are three ways for your app to get information about contacts – it all depends on what you need:

  • Get information about a specific contact
  • Get a list of all contacts in a site
  • Get notifications when a contact is created or updated

Get information about a specific contact

If you have the Contact ID, your app can get information about a specific contact – use the GET /Contacts/{ContactID} HTTP API endpoint or the Wix.Contacts.getContactById SDK method.

Note: Don’t have the Contact ID? There might be another way to get the information you need: If you have the contact’s email, phone, first or last name, you can get a list of all contacts in the site, and then filter the response to get details for this contact only.

JS SDK

Wix.Contacts.getContactById(id, function(data), function(errorType));
JavaScript | Copy Code

HTTP API

GET /v1/contacts/280ea988-9a4a-4804-8b62-90c5d7fc7391?version=1.0.0&application-id=13d6663a-d101-36f6-16e8-24723992a8bf&instance-id=13d6669a-1a08-51bc-0360-43e7a980348e×tamp=2015-07-09T13%3A24%3A11.949Z&signature=MTQ2MmE0_QxNy1lMmExLWM5NWItM2Q2MzhkOTI2OTA0 HTTP/1.1
Accept: "*/*"
User-Agent: Restler for node.js
Host: openapi.wix.com
Accept-Encoding: gzip, deflate
Content-Length: 0
Connection: keep-alive
Response:
HTTP/1.1 200 OK
X-Seen-By: sputnik1.aus_dsp
Date: Thu, 09 Jul 2015 13:24:09 GMT
Content-Type: application/json;charset=UTF-8
Content-Length: 1281
Server: sputnik1.aus
"id":"280ea988-9a4a-4804-8b62-90c5d7fc7391",
"tags": [
"contacts/create",
"contacts_server/new",
"contacts_server/show"
],
"notes":[ ],
"emails":[ ],
"phones":[ {
"tag":"work",
"phone":"+1-415-639-5555",
"id":1,
"normalizedPhone":"+14156395555"
}],
"addresses":[ ],
"dates":[ ],
"urls":[ ],
"custom":[ ],
"createdAt":"2015-07-09T13:24:08.653Z",
"links":[ {
"rel":"unsubscribe",
"href":"http://www.wix.com/my-account/contacts/unsubscribe?siteName=musicplayer&metaSiteId=0dc99bdb-6e44-4a74-b1ce-fb6c251d2d18&unsubscribeToken=abcefd4d5885911e7f4ea863ecce180388e169a39e4c714f1a99cb3376c2b706e7cbc8d202eefd38f12421e34429d44e519c1fc8b0663814dfb9334838ef939e76a9b40bdbcf57e8ff46f13272035cbb445fe65559299dd1ed48d4aea7087f26d4638b3196b3cb46baa73228a6278fed6fbe79df7882e3ba226ced0cd911ebfd3769603b1210035089e13c1b1107ceebb7c47679b5775d33927c49bcef2a3fa87bca94aa039d3b2f67c94643e5c9263b0bbd1e9f7a59b20a9e6eac2bc26783519b212256947ba9a90aca638d01b6323687c1a93c0e0fae3dd8ff1cbee9337c4b4b78a078f4f1c1f104c5677222e5fbd83ac7746dfda06c43d551a09a7fd4daf38c4272539bb80dddcd8e5c7c5fbb9e81f2f7a5a041bdb78ea0188700a880624c29ab180ec978fec93ba93bd3a5486a519bfe211a3d0b40d27590606ebc4ea07c81150cef0849e6a9156b5b4bda362c803ba602a0326bc0346938aa1550cf85f4b8abe3cf11a0271287d7ba45acfe670d",
"id":1
}],
"modifiedAt":"2015-07-09T13:24:08.653Z"
}
HTTP | Copy Code

Get a List of All Contacts in a Site

Your app can get a list of all contacts in a site, including their information – use the Wix.Contacts.getContacts SDK method or the GET /contacts HTTP API endpoint.

In the response, we send all the information we have for each contact in the site. If you’re using the HTTP API endpoint, you can specify what we send in the response:

  • To keep the response size small, you can request only certain fields – like the contacts’ emails. In the fields parameter, enter one or more values, like NAME, EMAIL, or ADDRESS (use a comma to separate the values).
  • If you only need information for specific contacts (and not all contacts in the site), you can tell us which results to send in the response. Specify one or more values in the following parameters: email, phone, name.first, or name.last. This is a great way to get details about a contact when you don’t have the Contact ID.

JS SDK

Wix.Contacts.getContacts(function(WixDataCursor), function(errorType));
JavaScript | Copy Code

HTTP API

GET /v1/contacts?version=1.0.0&pageSize=53&application-id=13d6663a-d101-36f6-16e8-24723992a8bf&instance-id=13d6669a-1a08-51bc-0360-43e7a980348e×tamp=2015-07-09T13%3A26%3A47.679Z&signature=MTQ2MmE0_QxNy1lMmExLWM5NWItM2Q2MzhkOTI2OTA0 HTTP/1.1
Accept: "*/*"
User-Agent: Restler for node.js
Host: openapi.wix.com
Accept-Encoding: gzip, deflate
Content-Length: 0
Connection: keep-alive
HTTP | Copy Code

Get notifications when a contact is created or updated

You can sign up in your app’s page in the Dev Center to receive immediate notifications. These events will be delivered to your app via webhooks and will include the Contact ID.

Contacts Schema

NameTypeDescription
idStringContact's ID
nameObjectContact's name
name.prefixStringName prefix 
name.firstStringFirst name
name.middleStringMiddle name
name.lastStringLast name
name.suffixStringName suffix
pictureStringURL of the contact's photo
companyObjectContact's company details
company.roleStringContact's role in the company
company.nameStringContact's company name
emailsArray[Objects]Contact's email addresses
emails.idNumberID of this email within the array
emails.tagStringTag for this email - home, work, etc
emails.emailStringEmail address
emails.emailStatus‘optOut’, ‘transactional’, ‘recurring’The subscription status of the current email
emails.deliveryStatus‘valid’, ‘spam’, ‘complaint’, ‘rejected’, ‘deferral’, ‘bounce’Email delivery status: valid: When emails are delivered successfully. spam: When emails are marked as spam by the recipient. complaint: When the recipient of the email has made a complaint to the email provider. rejected: When the email is rejected by email provider. deferral: When your email provider refuses to send emails. bounce: When the mailbox is full, email address doesn't exist, etc.
phonesArray[Objects]Contact's phone numbers
phones.idNumberID of this phone number within the array
phones.tagStringTag for this phone number - home, work, etc
phones.phoneStringPhone number
phones.normalizedPhoneStringNormalized phone number
addressesArray[Objects]Contact's addresses
addresses.idNumberID of this address within the array
addresses.tagStringTag for this address - home, work, etc
addresses.addressStringStreet address
addresses.neighborhoodStringNeighborhood
addresses.cityStringCity
addresses.regionStringRegion, like a U.S state or a province in Canada
addresses.countryStringCountry
addresses.postalCodeStringPostal code
urlsArray[Objects]URLs associated with the contact, like Facebook or LinkedIn
urls.idNumberID of this URL within the array
urls.tagStringTag for this URL - personal, work, etc
urls.urlStringThe URL
datesArray[Objects]Important dates for this Contact, like birthday
dates.idNumberID of this date within the array
dates.tagStringTag for this date - birthday, anniversary, etc
dates.dateDatetimeThe date, as an ISO 8601 timestamp
createdAtDateThe date this contact was created, as an ISO 8601 timestamp
linksArray[Objects]An array of HATEOAS links to operations applicable to the Contact resource
links.hrefStringThe href of the operation relevant to this resource
links.relStringThe relationship of this operation to the returned resource
modifiedAtTimestampDate and time this contact was modified, as an ISO 8601 timestamp

Was this helpful?

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

var ONE_HOUR = 60 * 60 * 1000;
var oneHourAgo = new Date(new Date().getTime() - ONE_HOUR);
contact.getActivities(null,
{
from: oneHourAgo.toISOString(),
until: new Date().toISOString(),
activityTypes: [api.Activities.TYPES.ALBUM_FAN.name, api.Activities.TYPES.ALBUM_SHARE.name],
scope: 'app',
pageSize: 50
}).then(
function(pagingActivitiesResult){
var activities = pagingActivitiesResult.results;
console.log(activities);
},
function(error){
console.log(error);
}
)
JavaScript | Copy Code

RUBY

# Get all Activities
client.activities
# Filter by Activity type
client.activities(activityTypes: Hive::Activities::MUSIC_ALBUM_FAN.type)
# Filter by date range
client.activities(from: Time.now.iso8601(3), until: Time.now.iso8601(3))
Ruby | Copy Code

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:

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

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:

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

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:

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

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

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

CONFIRMATION

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

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

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

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:

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

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
var activity = {
type:Wix.Activities.Type.SOCIAL_SHARE_URL,
info: {channel: 'FACEBOOK',
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};
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
var onFailure = function(d){console.log("Failure message:" + d)};
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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
var activity = {
type:Wix.Activities.Type.SOCIAL_TRACK,
info: {type: 'LIKE',
channel: 'FACEBOOK',
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};
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
var onFailure = function(d){console.log("Failure message:" + d)};
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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:

var activity = {
type:Wix.Activities.Type.HOTELS_PURCHASE,
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']}] },
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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:

var activity = {
type:Wix.Activities.Type.HOTELS_PURCHASE_FAILED,
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']}] },
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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

var activity = {
type:Wix.Activities.Type.HOTELS_RESERVATION,
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']}] },
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

CONFIRMATION

var activity = {
type:Wix.Activities.Type.HOTELS_CONFIRMATION,
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']}] },
details:{additionalInfoUrl:null, summary:'testing hotel confirmation'},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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:

var activity = {
type:Wix.Activities.Type.HOTELS_CANCEL,
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']}] },
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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

var activity = {
type:Wix.Activities.Type.TRACK_PLAY,
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

TRACK-SKIP

var activity = {
type:Wix.Activities.Type.TRACK_SKIP,
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
details:{additionalInfoUrl:null, summary:'testing track skip'},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

TRACK-PLAYED

var activity = {
type:Wix.Activities.Type.TRACK_PLAYED,
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
details:{additionalInfoUrl:null, summary:'testing track played'},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

TRACK-LYRICS

var activity = {
type:Wix.Activities.Type.TRACK_LYRICS,
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
details:{additionalInfoUrl:null, summary:'testing track lyrics'},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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:

var activity = {
type:Wix.Activities.Type.TRACK_SHARE,
info: { track:{name: 'Stronger', id:'123'}, album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'},sharedTo:'FACEBOOK'},
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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:

var activity = {
type:Wix.Activities.Type.ALBUM_SHARE,
info: {album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}, sharedTo:'FACEBOOK',
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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

var activity = {
type:Wix.Activities.Type.ALBUM_FAN,
info: {album: {name:'Graduation', id:'123'}, artist:{name:'Kanye West', id:'123'}},
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

ALBUM-PLAYED

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

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

PropertyTypeDescription
cartId (required)StringCart ID
storeId (required)StringStore ID
storeNameStringName of store
item (required)Array[object]Item added/removed from cart
item.id (required)StringItem ID
item.type"PHYSICAL" or "DIGITAL"Item type
item.skuStringItem SKU number
item.title (required)StringItem's title
item.quantity (required)IntegerItem's quantity
item.price**NumberItem's price
item.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
item.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
item.productLink StringItem's link
item.weightNumberItem's weight
item.formattedWeightStringWeight format
item.mediaObjectMedia details for this item (like a photo)
item.media.thumbnailStringLink to the thumbnail 
item.variants (required)Array[object]Item's variants (like a specific color or size)
item.variants.title (required)StringVariant title
item.variants.valueStringVariant value
item.categoriesArray[string]Item's categories (such as shirt, summer sale, etc.)
item.metadataArray[object]Additional information about this item
item.metadata.name (required)StringMetadata name
item.metadata.value (required)StringMetadata value

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

CART-ADD

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

CART-REMOVE

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

Cart-abandon and Cart-checkout

PropertyTypeDescription
cartId (required)StringCart ID
storeId (required)StringStore ID
storeNameStringName of store
items (required)Array[object]Items in cart
items.id (required)StringItem ID
items.type"PHYSICAL" or "DIGITAL"Item type
items.skuStringItem SKU number
items.title (required)StringItem's title
items.quantity (required)IntegerItem's quantity
items.price**NumberItem's price
items.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
items.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
items.productLink StringItem's link
items.weightNumberItem's weight
items.formattedWeightStringWeight format
items.mediaObjectMedia details for this item (like a photo)
items.media.thumbnailStringLink to the thumbnail 
items.variants (required)Array[object]Item's variants (like a specific color or size)
items.variants.title (required)StringVariant title
items.variants.valueStringVariant value
items.categoriesArray[string]Item's categories (such as shirt, summer sale, etc.)
items.metadataArray[object]Additional information about this item
items.metadata.name (required)StringMetadata name
items.metadata.value (required)StringMetadata value

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

CART-CHECKOUT

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

CART-ABANDON

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

Purchase

PropertyTypeDescription
cartId (required)StringCart ID
storeId (required)StringStore ID
storeNameStringName of store
orderId (recommended)StringOrder ID
items (required)Array[object]Purchased items
items.id (required)StringItem ID
items.type"PHYSICAL" or "DIGITAL"Item type
items.skuStringItem SKU number
items.title (required)StringItem's title
items.quantity (required)IntegerItem's quantity
items.price**NumberItem's price
items.formattedPriceStringPrice format (i.e, €0,99 or $0.99)
items.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
items.productLink StringItem's link
items.weightNumberItem's weight
items.formattedWeightStringWeight format
items.mediaObjectMedia details for this item (like a photo)
items.media.thumbnailStringLink to the thumbnail 
items.variants (required)Array[object]Item's variants (like a specific color or size)
items.variants.title (required)StringVariant title
items.variants.valueStringVariant value
items.categoriesArray[string]Item's categories (such as shirt, summer sale, etc.)
items.metadataArray[object]Additional information about this item
items.metadata.name (required)StringMetadata name
items.metadata.value (required)StringMetadata value
payment (required)ObjectPayment details
payment.total (required)NumberPayment total
payment.subTotal (required)NumberPayment subtotal
payment.formattedTotalStringFormatted total
payment.formattedSubTotalStringFormatted subtotal
payment.currency (required)StringCurrency code (i.e, EUR, USD, CAD)
payment.couponObjectCoupon details
payment.coupon.total (required)NumberAmount the coupon deducted from the total price
payment.coupon.FormattedTotalStringFormatted coupon total
payment.coupon.title (required)StringCoupon title
payment.taxObjectPayment's tax details
payment.tax.total (required)NumberTax total
payment.tax.formattedTotalStringFormatted tax total
payment.shippingObjectShipping details
payment.shipping.total (required)NumberShipping total
payment.shipping.formattedTotalStringFormatted shipping total
shippingAddressObjectShipping address details
shippingAddress.firstNameStringRecipient's first name
shippingAddress.lastNameStringRecipient's last name
shippingAddress.emailStringRecipient's email
shippingAddress.phoneStringRecipient's phone
shippingAddress.countryStringRecipient's country
shippingAddress.countryCodeStringRecipient's country code
shippingAddress.regionStringRecipient's region
shippingAddress.regionCodeStringRecipient's region code
shippingAddress.cityStringRecipient's city
shippingAddress.address1StringRecipient's address
shippingAddress.address2StringRecipient's address, part 2
shippingAddress.zipStringRecipient's postal code
shippingAddress.companyStringRecipient's company
billingAddressObjectBilling address details
billingAddress.firstNameStringBuyer's first name
billingAddress.lastNameStringBuyer's last name
billingAddress.emailStringBuyer's email
billingAddress.phoneStringBuyer's phone
billingAddress.countryStringBuyer's country
billingAddress.countryCodeStringBuyer's country code
billingAddress.regionStringBuyer's region
billingAddress.regionCodeStringBuyer's region code
billingAddress.cityStringBuyer's city
billingAddress.address1StringBuyer's address
billingAddress.address2StringBuyer's address, part 2
billingAddress.zipStringBuyer's postal code
billingAddress.companyStringBuyer's company
paymentGatewayStringPayment gateway name
noteStringNotes about the purchase
buyerAcceptsMarketingBooleanTrue if the buyer opts to receive marketing emails from the vendor

Get the Purchase Activity JSON.

Example

var activity = {
type:Wix.Activities.Type.ECOMMERCE_PURCHASE,
info:{
cartId:'123', storeId:'123', storeName:'Wix', orderId:'123',
items:[{
id: 1, type:'PHYSICAL', sku: 'sky', title: 'title',
quantity: 1, price: '1', formattedPrice: '1.1',
currency: 'EUR', productLink: 'link', weight: '1',
formattedWeight: '1.0KG', media: {thumbnail: 'PIC'},
categories: ['shirt','clothing','wix'],
metadata: [ {name: "item", value: "1"} ],
variants: [{title: 'title', value: '1'}]
}],
payment:{
total: '1', subtotal: '1', formattedTotal: '1.0', formattedSubtotal: '1.0', currency: 'EUR',
coupon: {total: '1', title: 'Dis'}, tax: {total: 1, formattedTotal: 1},
shipping: {total: 1, formattedTotal: 1}},
billingAddress: {
firstName: 'Wix' , lastName: 'Cool',
email: 'wix@example.com', phone: '12345566',
city: 'Bitola', address1: 'Marshal Tito', address2: 'Marshal Tito',
region: 'Bitola', regionCode: '7000',
country: 'USA', countryCode: 'US',
zip: '7000',
company: 'Wix.com'
},
paymentGateway: 'PAYPAL',
note: 'Note',
buyerAcceptsMarketing: true
},
details:{additionalInfoUrl:null, summary:''},
contactUpdate:{"name":{first:"firstName", middle:"middleName", last:"lastName"}, emails:[{tag:"main", email:"email@gmail.com"}]}
}
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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

var activity = {
type: Wix.Activities.Type.MESSAGE_IM,
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'}] }]},
details:{additionalInfoUrl:'http://www.wix.com/my-account/app/{app-def-id}/{instance-id}/{app-related-deep-link}', summary:""},
contactUpdate:null
};
var onSuccess = function(d){console.log("Activity ID: " + d.activityId + ", Contact ID: " + d.contactId)};
var onFailure = function(d){console.log("Failure message:" + d)};
Wix.Activities.postActivity(activity, onSuccess, onFailure);
JavaScript | Copy Code

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

var activity = {
type: Wix.Activities.Type.EVENTS_RSVP,
info: {
eventId: '123456789123456789123456789123456789',
eventTitle: 'my appointment',
price: {
price: '1',
currency: 'USD',
formattedPrice: '$1.00'
},
location: {
address: '123 meep st.',
},
time: {
start: new Date().toISOString(),
end: new Date(new Date().getTime() + (60 * 60 * 24)).toISOString(),
timeZone: 'ET'
}
},
contactUpdate: {
"name": {
first: "firstName",
middle: "middleName",
last: "lastName"
},
emails: [{
tag: "main",
email: "email@gmail.com"
}]
}
}
Wix.Activities.postActivity(activity, function(res) { console.log(res) }, function(err) { console.log(err) });
JavaScript | Copy Code

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?

)}