Create offer
curl --request POST \
--url https://{domain}/api/v2/network/offers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "string",
"advertiser_id": 1,
"visible_type": 1,
"default_url": "string",
"status": 1,
"currency": "USD",
"external_id": "string",
"description": "Sample description",
"internal_info": "string"
}
'import requests
url = "https://{domain}/api/v2/network/offers"
payload = {
"title": "string",
"advertiser_id": 1,
"visible_type": 1,
"default_url": "string",
"status": 1,
"currency": "USD",
"external_id": "string",
"description": "Sample description",
"internal_info": "string"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'string',
advertiser_id: 1,
visible_type: 1,
default_url: 'string',
status: 1,
currency: 'USD',
external_id: 'string',
description: 'Sample description',
internal_info: 'string'
})
};
fetch('https://{domain}/api/v2/network/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/api/v2/network/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'string',
'advertiser_id' => 1,
'visible_type' => 1,
'default_url' => 'string',
'status' => 1,
'currency' => 'USD',
'external_id' => 'string',
'description' => 'Sample description',
'internal_info' => 'string'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/api/v2/network/offers"
payload := strings.NewReader("{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/api/v2/network/offers")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"offer": {}
}
}{
"status": "error",
"code": 422,
"name": "Unprocessable Entity",
"message": "<string>",
"info": {
"errors": {
"expiration_date": [
"Expiration date cannot be in the past."
]
}
}
}Offers
Create offer
Creates a new offer with optional default goal and landing page.
POST
/
api
/
v2
/
network
/
offers
Create offer
curl --request POST \
--url https://{domain}/api/v2/network/offers \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"title": "string",
"advertiser_id": 1,
"visible_type": 1,
"default_url": "string",
"status": 1,
"currency": "USD",
"external_id": "string",
"description": "Sample description",
"internal_info": "string"
}
'import requests
url = "https://{domain}/api/v2/network/offers"
payload = {
"title": "string",
"advertiser_id": 1,
"visible_type": 1,
"default_url": "string",
"status": 1,
"currency": "USD",
"external_id": "string",
"description": "Sample description",
"internal_info": "string"
}
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
title: 'string',
advertiser_id: 1,
visible_type: 1,
default_url: 'string',
status: 1,
currency: 'USD',
external_id: 'string',
description: 'Sample description',
internal_info: 'string'
})
};
fetch('https://{domain}/api/v2/network/offers', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{domain}/api/v2/network/offers",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'title' => 'string',
'advertiser_id' => 1,
'visible_type' => 1,
'default_url' => 'string',
'status' => 1,
'currency' => 'USD',
'external_id' => 'string',
'description' => 'Sample description',
'internal_info' => 'string'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{domain}/api/v2/network/offers"
payload := strings.NewReader("{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{domain}/api/v2/network/offers")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{domain}/api/v2/network/offers")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"title\": \"string\",\n \"advertiser_id\": 1,\n \"visible_type\": 1,\n \"default_url\": \"string\",\n \"status\": 1,\n \"currency\": \"USD\",\n \"external_id\": \"string\",\n \"description\": \"Sample description\",\n \"internal_info\": \"string\"\n}"
response = http.request(request)
puts response.read_body{
"status": "success",
"code": 200,
"name": "OK",
"message": "<string>",
"info": {
"offer": {}
}
}{
"status": "error",
"code": 422,
"name": "Unprocessable Entity",
"message": "<string>",
"info": {
"errors": {
"expiration_date": [
"Expiration date cannot be in the past."
]
}
}
}Authorizations
Body
application/json
Expiration date in Y-m-d format. When is_expires=1, must be today or a future date in the offer timezone. The offer stops accepting traffic (clicks, impressions, conversions, smart links, promo codes, leads) at 00:00 of the following day in the offer timezone and is treated as Inactive from then on, even before its status is switched to Inactive. Events (registrations, deposits and other /track/event calls) for clicks made before that are still accepted, as they are for any Inactive offer.
Was this page helpful?