Skip to main content
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

X-API-Key
string
header
required

Preferred authentication method. Pass the API key in the X-API-Key HTTP request header. The user account must have api_status enabled.

Body

application/json
title
string
required

Offer title (max 128 characters).

Maximum string length: 128
advertiser_id
integer
required

Advertiser ID. Create: POST /api/v2/network/advertisers.

visible_type
integer
required

1=private, 2=public, 3=require_approval.

default_url
string
required

Default landing page URL. Auto-creates default landing page.

status
integer

Offer status.

currency
string

ISO 4217 currency code.

Maximum string length: 3
external_id
string

External identifier for integration.

description
string

Public offer description.

internal_info
string

Internal notes (not visible to affiliates).

timezone
string

Timezone identifier used to determine whether expiration_date is in the past.

Maximum string length: 32
image
string

Image URL.

image_data
string

Base64-encoded image data.

Mark as featured: 1=yes, 0=no.

Available options:
0,
1
is_expires
enum<integer>

Enable expiration: 1=yes, 0=no.

Available options:
0,
1
expiration_date
string

Expiration date in Y-m-d format. When is_expires=1, must be today or a future date in the offer timezone.

ask_approval_questions
enum<integer>

Require approval questions: 1=yes, 0=no.

Available options:
0,
1
questions
string

Approval questions configuration.

categories
string

Comma-separated category IDs.

categories_ids
integer[]
tags
integer[]

Array of tag IDs.

traffic_types
integer[]

Array of traffic type IDs.

traffic_types_denied
integer[]
preview_url
string
goal_type
integer

Default goal type ID.

goal_title
string
goal_revenue
number
goal_payout
number
block_traffic
enum<integer>
Available options:
0,
1
block_traffic_vpn
enum<integer>
Available options:
0,
1
block_traffic_proxy
enum<integer>
Available options:
0,
1
block_traffic_bot
enum<integer>
Available options:
0,
1

Response

Offer created.

status
string
Example:

"success"

code
integer
Example:

200

name
string
Example:

"OK"

message
string
info
object