Deals discount API

Deals discount API provides you all the relevant information to build a custom pricing solution.

Getting Started:

Deals discount API provides you all the relevant information based on the discount rules to build a custom pricing solution.

Deals discount API

https://api.paritydeals.com/api/v1/deals/discount/

Sample response

{
  "bar": {
    "backgroundColor": "#04888e",
    "backgroundTransparency": "0",
    "fontColor": "#59ebf1",
    "highlightFontColor": "#DD5C64",
    "placement": "top",
    "borderRadius": "0",
    "addCloseIcon": false,
    "unStyled": true
  },
  "couponCode": "PD8CEXAAJL",
  "discountPercentage": "50.00",
  "countryCode": "IN"
  "currencyCode": "INR"
  "currencySymbol": "₹"
  "country": "India",
  "countryFlag": "🇮🇳",
  "holiday": null,
  "time": null,
  "isProxy": false,
  "isTor": false,
  "isVpn": false,
  "usdConversionRate": "82.2"
  "message": "Message with HTML tags",
  "messageText": "Message string"
}

Calling API from the client side

If you want to make the API call from the client-side, you must pass the browser URL via URL parameters to get the response.

You’ll get the response only if the API call is made from the website configured in the deal to improve security.

Example
https://api.paritydeals.com/api/v1/deals/discount/?url=${window.location.href}

Calling API from the server side

If you want to make the API call from the server side, you must pass the banner identifier and the user’s IP address to get the response..

https://api.paritydeals.com/api/v1/deals/discount/?pd_identifier=BANNER_IDENTIFIER&ip_address=34.98.207.242

How to get the banner identifier?

Every banner has an identifier secret identifier associated with it. It helps you bypass all security features and enables you to get the discount values via API

You can also access the banner identifier from
  1. The final step of deal creation. Select product

  2. By clicking on the get code from the deal list dropdown menu Get code

Testing API on a local server

To get a response, if you make the API call from a local server, you need to pass the pd_identifier via browser URL params.

If you are testing location-based deals, make sure you add a temporary discount for your country to get the response

Example
http://localhost:3000/pricing/?pd_identifier=07503741-273f-433f-a266-99g7154f3dr6