Overview


The Privileges accurately locate relevant offers that card members can redeem using their Diners Club International or Network Alliance Partner credit cards.

Authentication-Making the first API request is only few steps away


  1. All projects start in Sandbox mode. Once you’re invited to gain access to this API you can login here to get Client Application ID (API Key) Client Application Secret, Consumer Application Certificate and API Plan name.

  2. All API requests must be authenticated with an OAuth token. To get the OAuth token, follow these simple steps

    1. Make a HTTP POST request to the endpoint /auth/oauth/v2/token with HTTP Authorization Header as Basic base64encoded(client_application_id:client_application_secret), Content-Type as application/x-www-form-urlencoded and Cache-Control as no-cache

    2. The response would contain an OAuth token along with token type and token expiry in seconds

      SAMPLE OAUTH TOKEN REQUEST

      POST /auth/oauth/v2/token?grant_type=xyz&scope=RWDS_xyz HTTP/1.1
      Authorization: sdlfsdf0dskladfk123456
      Content-Type: application/x-www-form-urlencoded
      Cache-Control: no-cache

      SAMPLE RESPONSE

      Response-Status: HTTP/1.1 200 OK
      Cache-Control: no-store
      Content-Type: application/json;charset=UTF-8
      Pragma: no-cache
      {
      "access_token": "sdlfsdf0dskladfk123456"
      "token_type": "xyz"
      "expires_in": 3600
      "scope": "RWDS_xyz"
      }

  3. Once an OAuth token is obtained, you can use the token along with Consumer Application Secret and API Plan name provided during Sandbox access in the HTTP Header of an API to make your first call. The same OAuth can be used for multiple API calls as long as it is not expired.

Access Error


In case of missing or incorrect credentials, the server will return HTTP Status code 401 Unauthorized.

In case access to the resource identified by URI is forbidden for some reason, the server will return HTTP Status Code 403 Forbidden.

In case of invalid JSON structure, the server will return a HTTP Status Code 400 Bad Request.

In case of valid JSON structure but some validation error is found, the server will return HTTP Status Code 400 with validation errors in the responseheader.

In case of an unexpected error or downstream system unavailable, the server will return HTTP Status Code 500.

API Structure


A typical API request would contain the sections HTTP Header, Request Header, Request Body as part of the request and HTTP Header, Response Header and Response Body as part of the response with some exception due to the nature of the API. Refer the individual end points to know more.

HTTP Header


We follow a robust standard for HTTP Header which includes the following parameters to be supplied while you are making an API request

Accept
Content-Type
Authorization
X-DFS-API-PLAN
While Accept, Content-Type and Cache-Control values are standard, Authorization which is the OAuth token obtained while authenticating and X-DFS-API-PLAN which is API Plan name given to you at the time of registration to the Sandbox. Our HTTP Header in the response will include Access, Content-Type and Cache-Control.

HTTP Status Codes


The HTTP Status Code returned in the response follows an industry API standard and designed to help you better interpret the underlying error.
In case of a successfully processed request, the server will return HTTP Status Code 200.
In case of missing or incorrect credentials, the server will return HTTP Status code 401 Unauthorized.
In case access to the resource identified by URI is forbidden for some reason, the server will return HTTP Status Code 403 Forbidden.
In case of Internal Server Error, the server will return a HTTP Status Code 501.
In case of Service Unavailable, the server will return a HTTP Status Code 503.

dci-offers/campaigns

/dci-offers/v2/campaigns


Returns a list of all cities currently referenced in the lounge data

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/campaigns
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of campaign objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "197"
{
"result": [
{
"name": "Explore America",
"identifier": "explore-america",
"summary": ""
},
{
"name": "Explore Sri Lanka",
"identifier": "explore-sri-lanka",
"summary": ""
},
{
"name": "Guam",
"identifier": "guam",
"summary": ""
},
],
"ok": true
}

dci-offers/collections

/dci-offers/v2/collections


Returns a list of all countries currently referenced in the lounge data

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/collections?lang=en-us
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of collection objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "229"
{
"result": [
{ "slug": "dinersclubhotelcollection",
"name": "Diners Club Hotel Collection",
"brief": "Diners Club Hotel Collection",
"summary": "",
"content": ""
},
{
"slug": "nightlife-access",
"name": "Nightlife Access",
"brief": "Nightlife Access",
"summary": "",
"content": ""
},
{
"slug": "privileges-dining-collection",
"name": "Privileges Dining Collection",
"brief": "Privileges Dining Collection",
"summary": "",
"content": "Staging Test"
}
],
"ok": true
}

dci-offers/destinations

/dci-offers/v2/destinations


Returns an array of facilities codes and their full string

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

parent_id:

Parent ID of destination

child_id:

Return only this Child ID

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/destinations
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of destination objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "3106"
{ "result": [
{
"id": "651",
"name": "Anguilla",
"slug": "anguilla",
"parent": "0",
"point": [
-63.068615,
18.220554

]
},
{
"id": "636",
"name": "Antigua and Barbuda",
"slug": "antigua-and-barbuda",
"parent": "0",
"point": [
-61.8,
17.06

]
},
],
"ok": true
}

dci-offers/healthcheck

/dci-offers/v2/healthcheck


API monitoring ping

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/healthcheck
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "18"
{
"ok": true
}

dci-offers/marks

/dci-offers/v2/marks


Retrieve list of available acceptance marks

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/marks?lang=en
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of mark objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "3106"
{
"result": [
{
"title": "Diners Club Acceptance Mark",
"image": "http://dinersclubofferstool.com/wp-content/uploads/2014/11/diners_acceptance.png",
"slug": "diners-club-acceptance-mark",
"content": "Unless otherwise stated above, for this offer to be valid, the cardmember shall:
(1) pay with a Diners Club or any card within the partner network which is mutually agreed upon, in writing by the parties;
(2) show the offer in print or mobile phone; and
(3) if explicitly required by the merchant, enter the promotional code if purchasing online.
Only one offer per cardmember can be used and cannot be combined with any other offer, unless otherwise stated. This offer is non-refundable, transferable and carries no monetary alternative."

},
{
"title": "Discover Acceptance Mark",
"image": "http://dinersclubofferstool.com/wp-content/uploads/2014/11/discover_acceptance.png",
"slug": "discover-acceptance-mark",
"content": ""
},
],
"ok": true
}

dci-lounges/offers

/dci-lounges/v2/offers


Retrieve offers by various criteria

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lat:

Latitude

lng:

Longitude

radius:

Radius in miles

since:

Date YYYY-MM-DD

tag:

Tag slug

collection:

Collection slug

campaign:

Campaign slug

partner:

Partner slug

product:

Product slug

destination:

Destination slug

lang :

Language

page:

Results page

pagesize:

Results per page

sortby:

Sort by field

sortdir:

Sort direction

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/offers?destination=chicago&lang=en&sortdir=asc
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of offer objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "46725"
{
"result": [
{
"id": "18335" ,
"updated_at": "1528728875" ,
"privileges_only": false ,
"qrcode": "" ,
"barcode": "" ,
"countrywide": false ,
"title": "Tommy Guns Garage Inc" ,
"slug": "tommy-guns-garage-inc-2" ,
"name": "$10 off dinner show per person. Up to 6 people." ,
"highlight": "$10 off." ,
"details": "" ,
"trans": [] , "images": "https://dmp.imgix.net/privileges/offer-VYV1ZNMLGG8573RTP1CA.jpg?w=750&h=440&fit=fill&bg=F2F2F2" ,
"start_date": "1514786400" ,
"end_date": "1546236000" ,
"merchant_logo": "" ,
"merchant_name": "Tommy Guns Garage Inc" ,
"merchant_email": "" ,
"merchant_phone": "1312-225-0173" ,
"merchant_website": "http://www.tommygunsgarage.com/" ,
"location_notes": "" ,
"price_range": "" ,
"small_business": true ,
"cuisine_type": "American" ,
"locations": [
{
"title": "2114 S Wabash Ave, Chicago, IL 60616, USA" ,
"body": "2114 S Wabash Ave, Chicago, IL 60616, USA" ,
"address": "2114 S Wabash Ave, Chicago, IL 60616, USA" ,
"point": [ -87.6259264, 41.8535875 ],
"valid_at": "location" ,
"country_id": "127" ,
"city_id": "321"
}
],
"destinations": [
{
"id": "127" ,
"name": "United States" ,
"slug": "united-states" ,
"parent": "0"
},
{
"id": "321" ,
"name": "Chicago" ,
"slug": "chicago" ,
"parent": "127"
}
],
"marks": [
{
"slug": "discover-acceptance-mark"
}
],
"tags": [
{
"slug": "dine"
}
],
"collections": [],
"campaigns": [
{
"identifier": """
}
],
"product": [],
"partner": [],
"acceptance_level": [
{
"identifier": "discover"
},
{
"identifier": "n2n"
},
{
"identifier": "dci"
}
]
},
],
"ok": 1
}

dci-offers/offers/{id}

/dci-offers/v2/offers/{id}


Retrieve an offer by its ID

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

id:

Offer ID

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/offers/18335?lang=en
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of offer objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "785"
{
"result": {
"id": "18335",
"updated_at": "1528728875",
"privileges_only": false,
"qrcode": "",
"barcode": "",
"countrywide": false,
"title": "Tommy Guns Garage Inc",
"slug": "tommy-guns-garage-inc-2",
"name": "$10 off dinner show per person. Up to 6 people.",
"highlight": "$10 off.",
"details": "",
"trans": [],
"images": "https://dmp.imgix.net/privileges/offer-VYV1ZNMLGG8573RTP1CA.jpg?w=750&h=440&fit=fill&bg=F2F2F2",
"start_date": "1514786400",
"end_date": "1546236000",
"merchant_logo": "",
"merchant_name": "Tommy Guns Garage Inc",
"merchant_email": "",
"merchant_phone": "1312-225-0173",
"merchant_website": "http://www.tommygunsgarage.com/",
"location_notes": "",
"price_range": "",
"small_business": true,
"cuisine_type": "American",
"locations": [
{
"title": "2114 S Wabash Ave, Chicago, IL 60616, USA",
"body": "2114 S Wabash Ave, Chicago, IL 60616, USA",
"address": "2114 S Wabash Ave, Chicago, IL 60616, USA",
"point": [
-87.6259264,
41.8535875
,
],
"valid_at": "location",
"country_id": "127",
"city_id": "321"
}
],
"destinations": [
{
"id": "127",
"name": "United States",
"slug": "united-states",
"parent": "0"
},
{
"id": "321",
"name": "Chicago",
"slug": "chicago",
"parent": "127"
}
],
"marks": [
{
"slug": "discover-acceptance-mark"
}
],
"tags": [
{
"slug": "dine"
}
],
"collections": [],
"campaigns": [
{
"identifier": ""
}
],
"product": [],
"partner": [],
"acceptance_level": [
{
"identifier": "discover"
},
{
"identifier": "n2n"
},
{
"identifier": "dci"
}
]
},
"ok": true
}

dci-offers/partners

/dci-offers/v2/partners


Retrieve list of available partners

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/partners
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of partner objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "180"
{
"result": [
{
"name": "CUP",
"identifier": "cup",
"summary": ""
},
{
"name": "JCB",
"identifier": "jcb",
"summary": ""
},
{
"name": "BC",
"identifier": "bc",
"summary": ""
}
]
"ok": true
}

dci-offers/products

/dci-offers/v2/products


Retrieve list of available products

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/products
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCIOFFERS_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of product objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "180"
{
"result": [
{
"name": "DCI Aspiring Premium",
"identifier": "dci-aspiring-premium",
"summary": ""
},
{
"name": "DCI Super Premium",
"identifier": "dci-super-premium",
"summary": ""
},
],
"ok": true
}

dci-offers/tags

/dci-offers/v2/tags


Retrieve list of available tags

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

GET https://apis.discover.com/dci-offers/v2/tags?lang=en
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of tag objects

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "183"
{
"result": [
{
"name": "Fine Dining",
"slug": "fine-dining"
},
{
"name": "Travel",
"slug": "go"
},
],
"ok": true
}

dci-offers/offers/favorite

/dci-offers/v2/offers/favorite


Favorite an offer

REQUEST ARGUMENTS


id: string | mandatory

Offer ID

ref id: string | mandatory

Unique identifier of favorite creator

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

SAMPLE CURL REQUEST

POST https://apis.discover.com/dci-offers/v2/offers/favorite
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82" {
"id": "18335",
"ref_id": "abc123"
}

RESPONSE VALUES


result: Object | mandatory

Object with current count property

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "60"
{
"result": {
"count": "1",
},
"ok": true
}

dci-offers/offers/rating

/dci-offers/v2/offers/rating


Rate an offer

REQUEST ARGUMENTS


id: string | mandatory

Offer ID

ref id: string | mandatory

Unique identifier of favorite creator

rating: string | mandatory

Rating number 1-5

feedback: string | mandatory

Preformatted feedback

comments: string | mandatory

General comments

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

lang:

Language

SAMPLE CURL REQUEST

POST https://apis.discover.com/dci-offers/v2/offers/rating
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"DCILOUNGES_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82" {
"id": "18335",
"ref_id": "abc123",
"rating": "3"
}

RESPONSE VALUES


result: Object | mandatory

Object with current rating_count and rating_average properties

ok: Boolean | mandatory

Query success

RESPONSE HTTP HEADERS


Status-Code:

200 – The API is invoked successfully; otherwise, error occurs

Content-Type:

application/json

Sample response # 1

"Response-Status": "HTTP/1.1 200 OK"
"content-language": "en-US"
"content-type": "application/json; charset=utf-8"
"content-length": "390"
{
"result": {
"rating_count": "1",
"rating_average": "3"
},
"ok": true
}

Errors


Header Level Error Codes

Error Message HTTP Status Code
Internal Server Error 500
Service Unavailable 503
UnAuthorized 401
Forbidden 403
Bad Request 400