Using the Websand Transaction API

Use the Websand transaction API to connect your customer transactions from your platform into Websand. Once connected, you’ll have a data flow.

The transactional data will update against your customers. Your customers will be updated into any relevant segments. If that segment is part of an automation, they’ll then be included in any marketing automation campaigns you have in place.

That’s how data driven marketing works in Websand.

Websand getting started
Websand Import Data
Websand dynamic segmentation
Websand Email Design
Websand Sending Email Icon
Websand marketing automation

Processing your customer transaction data

Unlike other email marketing systems, Websand also allows you to process ‘transactional’ information.

Websand works as your marketing CRM.  Allowing you to segment your audience based on not only who the audience is, but also what they’ve bought and when they bought it.

Data is a garbage in, garbage out exercise.  So to get the best results from data driven marketing, you want the data you process to be in tip top condition.

API is our preferred method of collecting your data – simply put it makes things easier for everyone and keeps your head out of spreadsheets.

We have a growing list of API’s including WordPress, Eventbrite and Visualsoft.

However, you can’t send email marketing or put your marketing automation processes in place if you haven’t got any data, so you need to be able to import your data into Websand.

Before you put your API in place, you may want to add some test data, or you might simply want to use Websand using manual imports.  Both are perfectly fine.

Websand Transaction API Documentation

Using this document

This document provides details on using the Websand API. That is feeding data from your platform or business system directly into Websand in an automated fashion.

You will need to have a Websand account set up before you start the API process.

If you are using an existing established e-commerce platform we probably already have an API in place (or planned) so please get in touch.

If you are looking to connect your own bespoke data or platform.  Please proceed 🙂

Websand REST API

The Websand API is an HTTPS interface with endpoints for specific actions.

The API follows REST conventions by using HTTPS verbs equivalent to the request type – requests to delete resources use the DELETE HTTPS verb, resource creation requests use the POST verb etc.

Authentication is handled via a HTTPS Token authentication header which can be generated from your Websand instance.

"Authorization: Token {YOUR-API-KEY}"

General Data Endpoints in use by Websand API:

Websand has two API endpoints you can use.

The transactional endpoint accepts customer transactional data (events and the people those events relate to)

The subscriber endpoint which accepts non transactional customer data – i.e. a list of people.   Click here for more details on the Subscriber API

Transaction Endpoint

The transactional endpoint accepts customer transactional data (events and the people those events relate to)

POST https://{{your_websand_name}}.websandhq.com/api/data/transaction

Receives customer transactional data in JSON format for processing and indexing and requires authentication.   That is a transactional event and to whom it relates.

The API supports custom additional fields which can be included in the request as required by the customer, however the below structure is the minimum data required for a useful payload.

Minimal request body is below.  This is the MINIMAL REQUEST.

  • The order id
  • The date of transaction
  • The email address of the customer
  • The item they have bought
  • The price they paid.

You can include any additional information you require.

"transaction": {
	"_id": "12345"	
	"submit_datetime": "2019-11-23T15:33:00Z",  
	"customer": {
			"email": "bob@example.com"  
			},  
	"items": [
		{      
			"name": "Awesome Thing"    
			}  
		],  
	"total": {
		"total": 19.99  
		}
}

If a product category was added to the transaction data, the payload would then look like this.

"transaction": {
	"_id": "12345"	
	"submit_datetime": "2019-11-23T15:33:00Z",  
	"customer": {
			"email": "bob@example.com"  
			},  
	"items": [
		{      
			"name": "Awesome Thing" 
   			“category”: “Awesome”
			}  
		],  
	"total": {
		"total": 19.99  
		}
}

If the transaction contained multiple items, the payload would look like this.

"transaction": {
	"_id": "12345"	
	"submit_datetime": "2019-11-23T15:33:00Z",  
	"customer": {
			"email": "bob@example.com"  
			},  
	"items": [
		{      
			"name": "Awesome Thing" 
   			“category”: “Awesome”
			} ,
		{      
			"name": "Awesome Thing Two” 
   			“category”: “Awesome”
			}   
		],  
	"total": {
		"total": 59.98
		}
}

Response Statuses

2xx responses

2xx responses indicate successful requests.  The beautiful #200’s, it’s all good.

4xx responses

4xx responses indicate issues with request data/authentication – response body should include specific error message(s) to help you go all Sherlock and figure out the issue.  Something wrong at your side – get in touch and let’s see how we can help.

5xx responses

5xx responses indicate server-side issues. OMG. Something wrong at our side – please raise the alarm and let us know.

Notes when using the Websand Transaction API

submit_datetime is the timestamp used for any date-range processing in the WebsandHQ system and is ISO 8601 format.

Any (including custom) properties in the  customer container are merged with the persistent customer profiles upon import.  The newer data supersedes older data.

Need some help?

Need help with the API?

If you need more help using the Websand API, or further help with your email marketing or data strategy. We can help. Get in touch by email support@websand.co.uk, give us a call +44.113.2045925 or schedule some time by clicking the box below 

Lets talk
Websand getting started
Websand Import Data
Websand dynamic segmentation
Websand Email Design
Websand Sending Email Icon
Websand marketing automation