createSingleOffer

Creates new single offer assigned to your publisher acccount. New offers inherit your currency and country.
Read more about all types of offers here

📘

You can try that method by clicking here

Parameters

NameTypeDescription
publisherToken*stringYou can find your publisher token at api-keys page.
offerData*objectAll data describing new offer.
-pricefloatOffer price (in publisher's currency), value between 0.14 and 99.99
-titlestringTitle of the offer, up to 70 chars.
-urlstringUrl to your content.
-description*stringAdditional offer description, up to 110 chars
-videoId*stringLink offer with unique video asset id
-contentExternalId*stringThis parameter is for your own usage. You can put here id of article or video, anything what can make your offer clearer for you.
-contentExternalData*stringIf you want to store a few extra elements related to the sale you can use this string to store additional data.
-tags*arrayTags attached to offer
-geoRestrictionEnabled*boolSet "true" to enable geo-restriction on this offer
-geoRestrictionType*stringChoose type of geo-restriction: whitelist / blacklist
-geoRestrictionCountries*arrayBased on geoRestrictionType, set the array of whitelisted/blacklisted countries.

API Request/Response

Request

{
  "method":"createSingleOffer",
  "params":{
    "publisherToken":"VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP",
    "offerData":{
      "price":"19",
      "title":"Monetize your content",
      "url":"http:\/\/your-site.url\/page_with_content",
      "description":"Great article how you can monetize your content using Cleeng",
      "videoId":"",
      "contentExternalId":"",
      "contentExternalData":"",
      "tags":[
        "sport",
        "hockey"
      ]
    }
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
  "result":{
    "id":"A233973213_US",
    "publisherEmail":"[email protected]",
    "url":"http:\/\/your-site.url",
    "title":"Monetize your content",
    "description":"Great article how you can monetize your content using Cleeng",
    "currency":"EUR",
    "videoId":"",
    "contentExternalId":"",
    "contentExternalData":"",
    "averageRating":4,
    "active":false,
    "createdAt":1353067309,
    "updatedAt":1353067309,
    "price":12,
    "tags":[
      "sport",
      "hockey"
    ]
  },
  "id":"1",
  "error":null,
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $offerSetup = array(
    'title' => 'Bip Bip and Coyote - Episode 12',
    'price' => 0.49,
    'url' => 'http://your-site.com/watch/bipbip_12/',
    'description' => 'See how Bip Bip and Coyote are chasing each other for the 12th time. Watch it directly from your browser for a few pennies.',
    'tags' => array('sport', 'hockey')
    );

    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('VIJYHWzJEP4mt1DZThD7DV_FinBG0Yo3Q9oHfCFAjqA22jXP');

    $cleengApi->createSingleOffer($offerSetup);

?>