Create Deliveries via REST API

Follow

This article outlines how you can create deliveries via REST API and includes additional information that may be useful to know when wanting to create deliveries via REST API.


You can create any type of delivery via REST API - additionally, you can choose which advanced distribution hybrid group to add the delivery to. You can also create new hybrid groups by targeting a group number that doesn't exist yet in the API call, and dictate which advanced distribution method the new group will run on.

To see the most up to date documentation for all of our REST API calls including creating deliveries, this information can be found on the REST API key page, after selecting specific permissions the documentation for each call can be found further down the page. This information includes a range of payload examples, detailing all the available parameters:

 

 

Please note: before creating deliveries to live inside an advanced distribution on a new campaign - the campaign must have a single delivery manually created first and added to the advanced distribution, so you can set the advanced distribution to use the hybrid group method initially, before deliveries can be created via REST API.

Getting Started

In order to search via the REST API, you'll need a REST API key with the correct permissions.

Head to the Admin tab > Tech Hub > REST API to get started:

1) Create yourself an Administrator Key

2) Ensure the Administrator Key has the Delivery > Create permission

3) Activate your Administrator Key

Creating your Delivery

In order to create your Delivery, you'll be making a JSON Post to the below URL:

https://[ACCOUNT].leadbyte.com/restapi/v1.3/deliveries/create

Body -

Parameter Required? Description
campaign_code Yes Campaign Reference
delivery_type Yes Which type of delivery to create (Store Lead / Email / SMS)
credit_amount Yes Add credit amount to buyer. Use 0 for no credit added.
sms_recipient Yes Send SMS to recipients (only if delivery_type = SMS)
email_recipient Yes Send Email to recipients (only if delivery_type = Email)
delivery_name Yes Name of delivery
revenue Yes Add revenue to delivery
bid Yes Buyer ID
company Yes Your buyer name (only if create_buyer = yes)
rules No Used to create rule for delivery
field No Used to determine which field is checked on your rules
operator No Specifies which rule operator is used
value No Which values are checked in the rule
create_buyer No Yes = Create a buyer
No = Does not create buyer
street1 No Buyer address
towncity No Name of town/city
county No Name of county
postcode No Postcode
country_name No Name of country
phone No Phone number
external_ref No Buyer external reference
external_ref_2 No Buyer external reference 2
external_ref_3 No Buyer external reference 3
external_ref_4 No Buyer external reference 4
external_ref_5 No Buyer external reference 5

 

Headers -
X_KEY: [YOUR API KEY]

 

You're expecting to see the following success response -

{
	"status": "Success",
	"message": "Delivery record created",
	"deliveryId": 1234
}

 

FAQs

Q - Deliveries usually need to be tested before they can move from "saved" to "inactive/active" - how do I complete this step when creating deliveries via REST API?

A - When creating deliveries via REST API, the testing step is bypassed and the deliveries will be made active on creation.

 

Q - I'm looking to ONLY create a Buyer, no delivery, can I do this?

A - Sure thing. Check this article instead - Create Buyers via REST API

 

As always, if you have any further questions please don't hesitate to raise a support ticket.

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

Comments