Sello

Developers

WebHooks

What are WebHooks?

Webhooks allow you to collect information about events as they happen in near real-time. Provide a URL and what event you want to receive data about, and we’ll send it to you as the events take place.

For general reading on Webhooks, read the PBWiki Webhooks page.

To test our Webhooks before setting up scripts, the RequestBin tool is an excellent utility that helps you see data come across as various events happen in our system.

Configuring WebHooks

Webhooks are configured from your Sello account. Here are the basic steps:

  1. Log in to your Sello account
  2. Navigate to Settings
  3. Click WebHooks

Configuration is simple: Enter a valid url for us to contact, then select the event and you want to have sent to you.

Securing Webhooks

We currently support either HTTP or HTTPS urls, so you can have security by using an SSL-enabled url. But keep in mind that your endpoint is going to be wide-open on the internet, and you might not want others to be able to submit random data to your systems. At this time, aside from trying to keep the URL private, our best suggestion is to simply include a secret key in the URL your provide and check that parameter in your scripts.

Supported Events

Our Webhooks implementation currently support the following events:

Event Data

When an event occurs that you have turned on, we’ll send a HTTP POST request to the URL you’ve specified. If that URL is unavailable, returns a 500-ish status code or takes too long to respond (more than 15 seconds), we’ll cancel the request and try again later. Retries happen over the course of one hour and 15 minutes. This may be tweaked as we receive feedback from users.

We’ll return various data based on each event. Below is sample data for the order events (both provides the same data). You can also see this using the RequestBin tool mentioned above. Generally speaking, you’ll see each event has a type and a firedAt field to help you track the type of event and get a RFC 1123 timestamp (in GMT) for the event.

firedAt => Thu, 05 Feb 2015 20:00:13 GMT
event => orderPaid
data => [
	  {
		"id": 10263410,
		"total": 219.00,
		"shipping": 0.00,
		"status": {
		  "id": 2578171,
		  "title": "Betalning mottagen",
		  "color": "#c0ffc0",
		  "is_paid": true,
		  "is_delivered": false,
		  "is_active": true
		},
		"note": null,
		"order_id": 10187,
		"deleted": false,
		"updated": null,
		"created": "2015-02-05 21:33:18",
		"reminder_sent": false,
		"market": 10,
		"market_reference": "47335091",
		"new": true,
		"integration": 274029,
		"weight": "0",
		"deliver_date": null,
		"rows": [
		  {
			"id": 9086694,
			"quantity": 1,
			"title": "Mobilskal 62613-BRU",
			"reference": "62613-BRU",
			"price": 219,
			"market_reference": "26971426",
			"tax": "25",
			"created": "2015-02-05 21:33:18",
			"product_id": null,
			"integration": 274021,
			"vat": 43.8
		  }
		],
		"customer": {
		  "contact": {
			"id": 934714,
			"alias": "Jane Doe",
			"email": "jane@doe.com",
			"phone": "0812839183",
			"mobile": "0721231234"
		  },
		  "address": {
			"id": 934714,
			"first_name": "Jane",
			"last_name": "Doe Svensson",
			"address": "Kungsgatan 6",
			"address2": "",
			"zip": "37450",
			"city": "Asarum",
			"country": {
			  "name": "Sverige",
			  "code": "se"
			}
		  },
		  "invoice": {
			"id": 934714,
			"first_name": "Jane",
			"last_name": "Doe Svensson",
			"address": "Kungsgatan 6",
			"address2": "",
			"zip": "37450",
			"city": "Asarum",
			"country": {
			  "name": "Sverige",
			  "code": "se"
			}
		  }
		},
		"history": [
		  {
			"id": "4457827",
			"created": "2015-02-05 21:33:18",
			"message": "Ny orderrad: 1 st Mobilskal 62613-BRU"
		  }
		],
		"icon": [  
		]
	  }
]