Visa Developer Community

Helper

Merchant search exaples

Hello.
Where I can get request examples for Merchant Search API?

Example from Test Data doesnt work.

4 REPLIES 4
Visa Dev Moderator

Re: Merchant search exaples

Hi, 

 

Please use the below test data. 

 

REQUEST

___________________________________________________________________________________________________________

POST https://sandbox.api.visa.com/merchantsearch/v1/search HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: application/json

Authorization: Basic SU8zMzFGNUpZUFZXVlc0TFRYWEcyMVRQWTVzRD1MyMnlBUHRlOFM0NmUjhxQTpkTDlFanR3MjBnMThUa1MyMnlBUHRlOFh1MyMnlBUHRlOFqMVpBTw==

Accept: application/json

Content-Length: 354

Host: sandbox.api.visa.com

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

 

{

  "header": {

    "messageDateTime": "2017-05-31T12:51:25.000",

    "requestMessageId": "VCN_req_TODO"

  },

  "searchAttrList": {

    "merchantName": "starbucks",

    "merchantCountryCode": "840"

  },

  "responseAttrList": [

    "GNSTANDARD"

  ],

  "searchOptions": {

    "matchIndicators": "true",

    "matchScore": "true",

    "maxRecords": 40

  }

}

 

RESPONSE

__________________________________________________________________________________________________________________________

{"merchantSearchServiceResponse": {

   "response": [   {

      "matchIndicators":       {

         "merchantCountryCode": "Y",

         "merchantName": "Y"

      },

      "matchScore": "7.922529",

      "responseValues":       {

         "merchantCountryCode": "840",

         "paymentAcceptanceMethod": ["F2F"],

         "terminalType":          [

            "SWIPE",

            "CHIP",

            "PAYWAVE"

         ],

         "firstTranDateRange": "In more than 365 days",

         "lastTranDateRange": "In last 30 days",

         "merchantCategoryCode": ["5814"],

         "visaMerchantId": "29992901",

         "visaStoreId": "200697923",

         "merchantPhoneNumber": [],

         "visaStoreName": "STARBUCKS STORE",

         "visaMerchantName": "STARBUCKS",

         "visaEnterpriseName": "STARBUCKS",

         "merchantCategoryCodeDesc": ["FAST FOOD RESTAURANTS"],

         "primaryMerchantCategoryCode": "5814",

         "merchantUrl": [],

         "merchantStreetAddress": "3801 3RD ST",

         "merchantCity": "SAN FRANCISCO",

         "merchantState": "CA",

         "merchantPostalCode": "94124-1409"

      }

   }],

   "header":    {

      "startIndex": "1",

      "numRecordsMatched": 18,

      "numRecordsReturned": 1,

      "requestMessageId": "VCN_req_TODO",

      "messageDateTime": "2018-02-20T16:59:13.908",

      "responseMessageId": "64VDP8355520180220165913908",

      "endIndex": "1"

   },

   "status":    {

      "statusDescription": "Max Record Limit is:1, Please use start index to see the next set of records",

      "statusCode": "CDI000MAXRCW"

   }

}}

 

Thank you, 

Vaibhav

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
Highlighted
Visa Dev Moderator

Re: Merchant search exaples

Hi, 

 

Here is the link to the API reference for Merchant Search - https://developer.visa.com/capabilities/merchant_search/reference 

 

Thank you, 

Vaibhav 

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.
Helper

Re: Merchant search exaples

Hi,

Default request from https://developer.visa.com/capabilities/merchant_search/reference 

returns 500 error.

 

Request:

{

  • "searchAttrList": {
    • "merchantName": "STARBUCKS",
    • "merchantCity": "SAN FRANCISCO",
    • "merchantState": "CA",
    • "merchantPostalCode": "94127",
    • "merchantCountryCode": "840"
    },
  • "responseAttrList": [
    • "GNSTANDARD"
    ],
  • "searchOptions": {
    • "wildCard": [
      • "merchantName"
      ],
    • "maxRecords": "5",
    • "matchIndicators": "true",
    • "matchScore": "true",
    • "proximity": [
      • "merchantName"
      ]
    },
  • "header": {
    • "requestMessageId": "Request_001",
    • "startIndex": "0",
    • "messageDateTime": "2018-02-21T10:17:38.903"
    }

}

 

 

Response:

 

{

  • "responseStatus": {
    • "severity": "ERROR",
    • "info": "",
    • "status": 0,
    • "message": "Internal server error"
    }

}

Visa Dev Moderator

Re: Merchant search exaples

Hi, 

 

I tried the sample request and it works. Please see below.

It may have been a temporary hiccup or you may have inadvertently entered an invalid character in the request.

 

REQUEST:

POST https://sandbox.api.visa.com/merchantsearch/v1/search HTTP/1.1

Accept-Encoding: gzip,deflate

Content-Type: application/json

Authorization: Basic SU8zMzFGNUpZUFZXVlc0TFRR3MjBnMThUa1MyMnPWE41YjdR3MjBnMThUa1MyMnkTDlFanR3MjBnMThUa1MyMnlBUHRlOFhFVGk4WU4xS0VqMVpBTw==

Accept: application/json

Content-Length: 569

Host: sandbox.api.visa.com

Connection: Keep-Alive

User-Agent: Apache-HttpClient/4.1.1 (java 1.5)

 

{

  "searchAttrList": {

    "merchantName": "STARBUCKS",

    "merchantCity": "SAN FRANCISCO",

    "merchantState": "CA",

    "merchantPostalCode": "94127",

    "merchantCountryCode": "840"

  },

  "responseAttrList": [

    "GNSTANDARD"

  ],

  "searchOptions": {

    "wildCard": [

      "merchantName"

    ],

    "maxRecords": "5",

    "matchIndicators": "true",

    "matchScore": "true",

    "proximity": [

      "merchantName"

    ]

  },

  "header": {

    "requestMessageId": "Request_001",

    "startIndex": "0",

    "messageDateTime": "2018-02-21T20:59:35.903"

  }

}

 

RESPONSE:

{"merchantSearchServiceResponse": {

   "response": [   {

      "matchIndicators":       {

         "merchantCountryCode": "Y",

         "merchantName": "Y",

         "merchantCity": "Y",

         "merchantState": "Y",

         "merchantPostalCode": "Y"

      },

      "matchScore": "6.750288",

      "responseValues":       {

         "merchantCountryCode": "840",

         "paymentAcceptanceMethod": ["F2F"],

         "terminalType":          [

            "SWIPE",

            "CHIP",

            "PAYWAVE"

         ],

         "firstTranDateRange": "In more than 365 days",

         "lastTranDateRange": "In last 30 days",

         "merchantCategoryCode": ["5814"],

         "visaMerchantId": "29992901",

         "visaStoreId": "159339773",

         "merchantPhoneNumber": [         {

            "type": "O",

            "number": "4156648370"

         }],

         "visaStoreName": "STARBUCKS",

         "visaMerchantName": "STARBUCKS",

         "visaEnterpriseName": "STARBUCKS",

         "merchantCategoryCodeDesc": ["FAST FOOD RESTAURANTS"],

         "primaryMerchantCategoryCode": "5814",

         "merchantStreetAddress": "100 WEST PORTAL AVE",

        "merchantCity": "SAN FRANCISCO",

         "merchantState": "CA",

         "merchantPostalCode": "94127-1306",

         "merchantUrl": []

      }

   }],

   "header":    {

      "startIndex": "0",

      "numRecordsMatched": 1,

      "numRecordsReturned": 1,

      "messageDateTime": "2018-02-21T21:02:22.026",

      "responseMessageId": "64VDP5282820180221210222026",

      "requestMessageId": "Request_001",

      "endIndex": "0"

   },

   "status":    {

      "statusDescription": "Success",

      "statusCode": "CDI000"

   }

}}

 

Thank you, 

Vaibhav 

Was your question answered? Don't forget to click on "Accept as Solution" to help other devs find the answer to the same question.