post https://api.belco.io/v1/shops//contacts
Contact types
We currently support the following contact types.
Customers - Customers are people that have signed up or have placed an order on your website.
Leads - Leads are people that contacted you through live-chat, email, phone, or social media. We automatically create leads and convert them to customers once they sign up or place an order.
Visitors - Visitors are people that haven't interacted with the widget yet.
Create or update customers
Syncing customers requires at least an id or email address. When both id and email address are set, the customer will be matched on id and the email address will be updated with the new value.
var request = require("request");
var data = {
id: '1337',
email: '[email protected]',
firstName: 'Elliot',
lastName: 'Alderson
};
var options = {
method: 'POST',
auth: {
bearer: 'Personal access token'
},
url: 'https://api.belco.io/v1/shops/abcdf/contacts',
json: true,
body: data
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});
Adding company data
var request = require("request");
var data = {
id: '1337',
email: '[email protected]',
firstName: 'Elliot',
lastName: 'Alderson,
company: {
id: '1',
name: 'Mr Robot'
}
};
var options = {
method: 'POST',
auth: {
bearer: 'Personal access token'
},
url: 'https://api.belco.io/v1/shops/abcdf/contacts',
json: true,
body: data
};
request(options, function (error, response, body) {
if (error) throw new Error(error);
console.log(body);
});