Home_Icon Country Acceptance Levels > Documentation

Overview


The Country Acceptance Levels API displays acceptance information by country to improve the cardholder experience while traveling.

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 request is submitted in malformed, the server will return a HTTP Status Code 400 bad request.
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 an unexpected error or downstream system unavailable, the server will return a HTTP Status Code 500.
In case of request has been understood but has been refused, the server will return a HTTP Status Code 503 Service Unavailable.

country-acceptance/countries

/country-acceptance/v2/countries


Get general country information

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

country_name:

Country name

country_cca3:

Country CCA3 ID

page:

Results page

pagesize:

Results per page

sortby:

Sort by field

sortdir:

Sort direction

SAMPLE CURL REQUEST

GET https://apis.discover.com/country-acceptance/v2/countries?country_cca3=AFG&sortby=name&sortdir=asc
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"COUNTRYACCEPTANCE_PROD" ,
"Authorization":
"Bearer dd00c011-7765-4db0-ac94-ac88a87a3a82"

RESPONSE VALUES


result: Array | mandatory

Array of country 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": "626"
{
"result": [
{
"name": {
"common": "Afghanistan",
"official": "Islamic Republic of Afghanistan"
},
"tld": [
".af"
],
"cca3": "AFG",
"currency": [
"AFN"
],
"callingCode": [
"93"
],
"capital": "Kabul",
"region": "Asia",
"subregion": "Southern Asia",
"languages": {
"prs": "Dari",
"pus": "Pashto",
"tuk": "Turkmen"
},
"translations": {
"fra": {
"official": "République islamique d'Afghanistan",
"common": "Afghanistan"
},
"jpn": {
"official": "アフガニスタン·イスラム共和国",
"common": "アフガニスタン"
},
"por": {
"official": "República Islâmica do Afeganistão",
"common": "Afeganistão"
},
"rus": {
"official": "Исламская Республика Афганистан",
"common": "Афганистан"
},
"spa": {
"official": "República Islámica de Afganistán",
"common": "Afganistán"
},
"zho": {
"official": "阿富汗伊斯兰共和国",
"common": "阿富汗"
}
},
"latlng": [
33,
65
],
"demonym": "Afghan",
"landlocked": true,
"borders": [
"IRN",
"PAK",
"TKM",
"UZB",
"TJK",
"CHN"
],
"area": 652230
}
],
"ok": true
}

country-acceptance/coverage

/country-acceptance/v2/coverage


Get countries coverage information and levels based on the passed criteria.
Coverage Levels: NO COVERAGE, J (low), G (med), H (high)

REQUEST HTTP HEADERS


Authorization: Bearer:

Access token

X-DFS-API-PLAN:

API plan

card_network:

Card network

country_name:

Country name

country_cca3:

Country CCA3 ID

page:

Results page

pagesize:

Results per page

sortby:

Sort by field

sortdir:

Sort direction

SAMPLE CURL REQUEST

GET https://apis.discover.com/country-acceptance/v2/coverage?card_network=DCI&country_cca3=AFG&sortby=name&sortdir=asc
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"COUNTRYACCEPTANCE_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": "188"
{
"result": [
{
"common_name": "Afghanistan",
"cca3": "AFG",
"credit_level": "NO COVERAGE",
"credit_mark": [ "" ],
"atm_level": "H",
"atm_mark": [
"DCI",
"DN"
],
"atm_banks": [
"CSC"
],
"card_network": "DCI"
}
],
"ok": true
}

country-acceptance/healthcheck

/country-acceptance/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/country-acceptance/v2/healthcheck
"Content-Type":
"application/json" ,
"x-dfs-api-plan":"COUNTRYACCEPTANCE_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
}

Errors


Header Level Error Codes

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