updatePassOffer

Update your pass offer. Read more about all types of offers here.
If property is omitted, it won't be updated.

📘

You can try that method by clicking here

🚧

Warning

This API is no longer supported for offers with localized versions. If you would like to create or modify an offer with localizations, you can do so directly in the Cleeng dashboard.

Parameters

Name

Type

Description

publisherToken*

string

Pass offer id.

offerId*

string

Single offer identifier

offerData*

object

No description

-price*

float

Offer price (in publisher's currency)

-period*

string

Pass period: week / 2weeks / month / 3months / 6months / year

-expiresAt*

string

Alternative to "period", specifies exact date when pass expires

-title*

string

Offer title, up to 70 chars

-url*

string

Url to content

-description*

string

Additional offer description, up to 110 chars

-accessToTags*

array

To 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*

bool

Set "true" to enable geo-restriction on this offer

-geoRestrictionType*

string

Choose type of geo-restriction: whitelist / blacklist

-geoRestrictionCountries*

array

Based on geoRestrictionType, set the array of whitelisted/blacklisted countries.

API Request/Response

Request

{
  "method":"updatePassOffer",
  "params":{
    "publisherToken":"Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x",
    "offerId":"P580476507_US",
    "offerData":{
      "price":"7",
      "period":"week",
      "title":"Get access to every article about finance for whole week!",
      "description":"Whole week you have unlimited access to every article about finance.",
      "url":"http://mywebsite.com/articles/about/finance",
      "accessToTags":[
        "finance"
      ]
    }
  },
  "jsonrpc":"2.0",
  "id":1
}

Response

{
  "result":{
    "id":"S580476507_US",
    "publisherEmail":"[email protected]",
    "price":"7",
    "period":"week",
    "title":"Get access to every article about finance for whole week!",
    "description":"Whole week you have unlimited access to every article about finance.",
    "url":"http://mywebsite.com/articles/about/finance",
    "currency":"EUR",
    "country":"PL",
    "active":"1",
    "createdAt":1353067309,
    "updatedAt":1353067309,
    "accessToTags":[
      "finance"
    ]
  },
  "id":"1",
  "error":null,
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $offerId = 'P123123213_US';

    $offerSetup = array(
    'price' => 14.00,
    "price": "7",
    "period": "week",
    "title": "Get access to every article about finance for whole week!",
    "description": "Whole week you have unlimited access to every article about finance.",
    "url": "http://mywebsite.com/articles/about/finance",
    );

    $cleengApi = new Cleeng_Api();
    $cleengApi->setPublisherToken('Xlrx-SjTLVMCsaRsOf2q2hvWKOlrF57yHknDRRRMX-13Fz-x');

    $cleengApi->updatePassOffer($offerId, $offerSetup);

?>