1. Home
  2. Docs
  3. Data Subscriber API Documentation
  4. Tutorials
  5. MCCMatch

MCCMatch

MccMatch, offered by Pentadata Inc., is a way to categorize merchant text into concrete categories. This article will inform you on examples of usage, and steps to use.

 

Banks statements offer merchant text strings, and sometimes the category. For instance, you might see something like THE HOME DEPOT 632 in your bank statement, and categorize it as Food & Drink. However, these don’t always seem correct, and this is the problem we aim to correct with MccMatch.

 

Using /merchant/mcc we can send merchant text, and receive back accurate categorization. Let’s walk through the steps on how to send this request.

Headers

First we want to setup the Headers. They will contain two fields, Content-Type

, and Authorization.

{
     "Content-Type":"application/json",
     "Authorization":"Bearer {token}"
}

The token is supplied through the endpoint /subscribers/login.

 

Payload

Next we want to create the payload to send in this request. There are three fields, two of which are not required. There is merchantText, required. Then there is tnxAmount & postalCode.

{
     "merchantText":"THE HOME DEPOT",
     "tnxAmount":20.78,
     "postalCode":"94404"
}

 

Response

Sending this information via POST will yield these results.

{
     "mcc": {
          "1": {
               "category": "Home Supply Warehouse Stores",
               "code": 5200
          },
          "2": {
               "category": "Miscellaneous and Specialty Retail Stores",
               "code": 5999
          },
          "3": {
               "category": "Package Stores – Beer, Wine, and Liquor",
               "code": 5921
          }
     },
     "requestId": "9d3aadb8bd3147d09f8da0bedb50a61a"
}

These results are filtered from most likely to least likely.

 

All Together

import requests 
import json 

url = '{domain}/merchants/mcc' 
payload={ 
     'merchantText': 'THE HOME DEPOT 632', 
     'tnxAmount': 20.78, 
     'postalCode': '94404' 
} 
headers = { 
     'Content-Type': 'application/json', 
     'Authorization': 'Bearer {token}' 
}

response = requests.request("POST", url, headers=headers, data=json.dumps(payload))

print(response.json())

Each response cannot be guaranteed to be the same over time. This is because a machine learning algorithm was used to develop this features. Therefore, it will improve over time, and responses will be more accurate.

How can we help?