Receiving Lead Updates (for suppliers)

Follow

We provide you with the ability for your suppliers to get an update as to whether a lead has been sold or not (essentially whether it is billable).  When leads are submitted to the API,  suppliers receive one of two responses; either an "OK" (valid lead for processing) or an Error (lead rejected by LeadByte).  

If your campaign is set to the type Buyer Delivery Accept (PPBA), this means that you only award a payout to a supplier if the lead has been accepted by the buyer.  A lead that initially receives the response "OK", may end up being sold or unsold; either way the supplier needs to know.  This can be achieved in real-time as feedback to their CRM or by them logging to your account as a supplier.

Please note that if your supplier is a LeadByte client, the feedback loop of whether a lead is sold/unsold happens automatically so you don't have to set up a key.

Setting The Scene
You create a campaign which is set as Buyer Delivery Accept (PPBA).  You buy from your suppliers and sell to your buyer, acting as a broker and only paying for a lead when sold.  Supplier ABC Ltd sends you 1,000 leads; you accept 800 and reject 200.  The supplier will receive 800 "OK" responses, which will look something like this: 

{"code":1,"response":"OK","info":[],"leadId":5697371,"processTime":0.43,"timestamp":"2018-07-21T12:59:03Z","payout":"Pending"}

NB:
The payout is "pending", indicating that further processing needs to be done i.e. submit the lead to the buyer's API.  At this stage the lead has not been purchased so no payout is awarded to the supplier.

From the 800 valid leads submitted by the supplier for processing, 350 we sold to the buyer.  The supplier is paid £2.00 per sold lead therefore the payout is 350*2.00=700.00 (not 800*2.00=1600).  It is very important that your suppliers recognise that when the payout is "Pending" the lead is not yet billable else this can cause confusion at the end of the month.


Prerequisites (for this to work)
For this to work within LeadByte you need to ensure the following:

  • Your campaign is set to Buyer Delivery Accept (PPBA)
  • You have created and activated a Supplier REST API key with access to read Leads and the API Queue

    Screenshot_2019-10-04_09.18.48.png

  • You have sent the supplier the API key

 

LeadByte Steps

Creating a Supplier REST API Key
Go to Admin > REST API within your LeadByte portal and select "Add New API Key".  Next, you need to select the key type "Supplier" and give the key a reference i.e. FeedbackLoop.  Tick "activate API key" and under permissions tick "Read" against the API Queue.  

The implementation notes are available against the key, however you can share the below with your supplier. 

How To Receive Updates

To get an update on whether a lead has been sold/unsold the supplier will need to make a GET request to the following URL:

https://{account}.leadbyte.co.uk/restapi/v1.2/leads/{id}?key={key}


Response(s)

SOLD

 

{
	"status": "Success",
	"message": "OK",
	"leads": [
		{
			"id": "2220221591",
			"received": "2019-10-04T07:51:14Z",
			"campaign": {
				"name": "EXAMPLECAMPAIGN",
				"reference": "EXAMPLECAMPAIGN"
			},
			"payout": {
				"timestamp": "2019-10-04T07:51:14Z",
				"type": "Pay per buyer accept",
				"status": "Valid",
				"commission": "2.00",
				"currency": "GBP"
			},
			"history": [
				{
					"timestamp": "2019-10-04T07:51:14Z",
					"payoutType": "Pay per buyer accept",
					"status": "Pending",
					"commission": "0.00",
					"currency": "GBP",
					"current": false
				},
				{
					"timestamp": "2019-10-04T07:51:14Z",
					"payoutType": "Pay per buyer accept",
					"status": "Valid",
					"commission": "2.00",
					"currency": "GBP",
					"current": true
				}
			]
		}
	]
}

 

UNSOLD

{
	"status": "Success",
	"message": "OK",
	"leads": [
		{
			"id": "2220116679",
			"received": "2019-10-04T06:08:23Z",
			"campaign": {
				"name": "EXAMPLECAMPAIGN",
				"reference": "EXAMPLECAMPAIGN"
			},
			"payout": {
				"timestamp": "2019-10-04T06:08:24Z",
				"type": "Pay per buyer accept",
				"status": "Buyer Rejection",
				"commission": "0.00",
				"currency": "GBP"
			},
			"history": [
				{
					"timestamp": "2019-10-04T06:08:23Z",
					"payoutType": "Pay per buyer accept",
					"status": "Pending",
					"commission": "0.00",
					"currency": "GBP",
					"current": false
				},
				{
					"timestamp": "2019-10-04T06:08:24Z",
					"payoutType": "Pay per buyer accept",
					"status": "Buyer Rejection",
					"commission": "0.00",
					"currency": "GBP",
					"current": true
				}
			]
		}
	]
}

 

Receiving update via a callback - An alternative to using the REST API


If you want the outcome of a lead to be posted back to your own end-point all you need to do is include a callback URL into the JSON.  If you are a supplier reading this article you will need to get your account manager to enable API Call Back against your key and subscribe you to the correct event i.e. lead Leads Approved, Leads Rejected.

 

Was this article helpful?
0 out of 0 found this helpful

Comments