createSubscriptionOffer()


Creates new subscription offer assigned to your publisher acccount. New offers inherit your currency and country.
Read more about all types of offers in Tutorial 2 - Creating Offers.

Parameters:

Name Type Description
publisherToken string You can find your publisher token at api-keys page.
offerData object No description
-pricefloatOffer price (in publisher's currency), value between 0.14 and 99.99 in publishers currency. It will be taken from customer at a specific time period.
-periodstringSubscription period: week / month / 3months / 6months / year.
-titlestringTitle of your subscription offer. Up to 70 chars
-urlstringUrl to your content described in the offer
-description stringDescribe your subscription offer here. Up to 110 chars
-associateEmail stringAvailable only for enterprise account
-freePeriods intSet your free periods number
-freeDays intSet your free days number
-accessToTags arrayTo which tags customer has access. Multiple tags are defined as "OR" (not "AND"). Set "(all)" if you want to give access to all of your offers.
-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.

- required parameter


Request:

{
    "method": "createSubscriptionOffer",
    "params": {
        "publisherToken": "VNUNiFwbWJwJMD6aXbfqsTWouI8wbVKwQPh2ABnyb8dHnPtR",
        "offerData": {
            "price": "25",
            "period": "week",
            "title": "test",
            "url": "http:\/\/test.com\/page_with_content",
            "description": "my first offer with Cleeng",
            "accessToTags": []
        }
    },
    "jsonrpc": "2.0",
    "id": 1
}

Response:

{
    "result": {
        "id": "S580476507_US",
        "publisherEmail": "publisher@email.com",
        "title": "test",
        "description": "my first offer with Cleeng",
        "url": "http:\/\/test.com\/page_with_content",
        "currency": "EUR",
        "country": "PL",
        "period": "week",
        "active": true,
        "price": 25,
        "createdAt": 1353067309,
        "updatedAt": 1353067309,
        "accessToTags": [
            ""
        ]
    },
    "id": "1",
    "error": null,
    "jsonrpc": "2.0"
}

Example:

<?php
                            
    $offerSetup = array(
    'title' => 'Bip Bip and Coyote cartoon',
    'price' => 19.00,
    'url' => 'http://your-site.com/watch/bipbip/',
    'description' => 'Get access to every Bip Bip and Coyote episode for 19$/month',
    'period' => 'month',
    'accessToTags' => array('Bip Bip and Coyote')
    );

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

    $cleengApi->createSubscriptionOffer($offerSetup);
    
?>

Remember! you can always check it by yourself using API Console - createSubscriptionOffer()

Back to Subscription Offers


We use cookies to ensure that we provide you the best service and website experience. Read our Cookie policy for more details.