getPrice

❗️

Deprecated

JSON-RPC getPrice method is deprecated.

Use getPrice() method to receive detailed information about the offer price based on customer location.

Parameters

NameTypeDescription
offerId* stringOffer ID, e.g. A123123123_US
ipAddress* stringIP Address of your visitor, e.g. 172.16.254.1
couponCodestringOptional: coupon campaign code granting discount
zipCodestringOptional: zip code for tax breakdown

Result Parameters

NameTypeDescription
offerPricefloatBase price of requested offer
offerCurrencystringCurrency set for offer
offerCurrencySymbolstringUnicode currency code
offerCountrystringCountry set for offer
customerPriceInclTaxfloatGross price of the offer for customer
customerPriceExclTaxfloatNet price of the offer for customer
customerCurrencystringCurrency used by customer
customerCurrencySymbolstringUnicode currency code
customerCountrystringCustomer's location country
discountedCustomerPriceInclTaxfloatGross price of the offer for customer after discount
discountedCustomerPriceExclTaxfloatNet price of the offer for customer after discount
discountPeriodsintegerNumber of discounted periods
taxBreakdownobjectBreakdown of tax to GST, PST and QST

API Request/Response

Request

{
  "method": "getPrice",
  "params": {
     "offerId": "S325990213_BE",
     "ipAddress": "109.123.123.42",
     "couponCode": "couponCode",
     "zipCode": "R2C0A1"
  },
  "jsonrpc": "2.0",
  "id": 1
}

Response

{
    "result": {
        "offerPrice": 100,
        "offerCurrency": "CAD",
        "offerCurrencySymbol": "CA$",
        "offerCountry": "CA",
        "customerPriceInclTax": 113,
        "customerPriceExclTax": 100,
        "customerCurrency": "CAD",
        "customerCurrencySymbol": "CA$",
        "customerCountry": "CA",
        "discountedCustomerPriceInclTax": "n/a",
        "discountedCustomerPriceExclTax": "n/a",
        "discountPeriods": "n/a",
        "taxBreakdown": [
            {
                "taxName": "GST",
                "taxRate": 0.05,
                "value": 5
            },
            {
                "taxName": "PST",
                "taxRate": 0.08,
                "value": 8
            },
            {
                "taxName": "QST",
                "taxRate": 0,
                "value": 0
            }
        ]
    },
    "id": "1",
    "jsonrpc": "2.0"
}

ErrorCodes

CodeDescription
4Offer offerId does not exist.
17Invalid coupon code