getOfferDetails

Returns information about offer and price based on customer location.

If you are using (getPrice/getMulticurrencyPrice) and (getSubscriptionOffer/getRentalOffer/getSingleOffer/getPassOffer) separately, use getOfferDetails as one method to get all data in one response. Method is offer type independent. Read more about all types of offers here.

This method gathers data from several methods:

  • getPrice
  • getMulticurrencyPrice
  • getSubscriptionOffer
  • getRentalOffer
  • getSingleOffer
  • getPassOffer

Parameters

Name

Type

Description

offerId*

string

Type id of an offer you whant to get information about.

ipAddress

string

Optional: IP Address of your visitor, e.g. 172.16.254.1

couponCode

string

Optional: coupon campaign code granting discount

Result Parameters

Name

Type

Description

parameter*

type

desc

API Request/Response

Request

{
  "method": "getOfferDetails",
  "params": {
    "offerId": "S388954091_UA",
    "ipAddress": "109.123.123.42",
    "couponCode": "couponCode"
  },
  "jsonrpc": "2.0",
  "id": 1
}

Response

{
  "result":{
     "offerId":"S388954091_UA",
     "offerPrice":9.99,
     "offerCurrency":"EUR",
     "offerCurrencySymbol": "€",
     "offerCountry": "FR",
     "customerPriceInclTax": 9.99,
     "customerPriceExclTax": 8.19,
     "customerCurrency": "EUR",
     "customerCurrencySymbol": "€",
     "customerCountry":"FR",
     "discountedCustomerPriceInclTax":null,
     "discountedCustomerPriceExclTax":null,
     "discountPeriods":null,
     "offerUrl":"http:\/\/yourdomain.cleeng.com",
     "offerTitle":"3-Month subscription (recurring) to yourdomain",
     "offerDescription":null,
     "active":true,
     "createdAt":1550501673,
     "updatedAt":1562593646,
     "applicableTaxRate":1.80,
     "geoRestrictionEnabled":false,
     "geoRestrictionType":null,
     "geoRestrictionCountries":[],
     "socialCommissionRate":0,
     "averageRating":4,
     "contentType":null,
     "period":"3months",
     "freePeriods":0,
     "freeDays":0,
     "expiresAt":null,
     "accessToTags":[
        "tagB"
     ],
     "videoId":null,
     "contentExternalId":null,
     "contentExternalData":null,
     "contentAgeRestriction":null
  },
  "id":"1",
  "jsonrpc":"2.0"
}

PHP Example

<?php
    $offerId = 'S388954091_UA';
    $ipAddress = '109.123.123.42';
    $couponCode = 'couponCode';

    $cleengApi = new Cleeng_Api();

    $offerDetails = $cleengApi->getOfferDetails($offerId, $ipAddress, $couponCode);
?>