Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.parcha.ai/llms.txt

Use this file to discover all available pages before exploring further.

Merchant Category Code (MCC) verification is another important aspect of KYB processes. This example demonstrates how to use the Parcha API to verify a business’s MCC code based on its basic information.

Step 1: Prepare Business Data and Run MCC Code Verification

Use the runCheck endpoint to initiate the MCC code verification process.
curl -X POST 'https://demo.parcha.ai/api/v1/runCheck' \
-H 'Authorization: Bearer YOUR_API_KEY' \
-H 'Content-Type: application/json' \
-d '{
  "agent_key": "your-agent-key",
  "kyb_schema": {
    "id": "unique-case-id",
    "self_attested_data": {
      "business_name": "TechInnovate Solutions",
      "description": "Providing cutting-edge software solutions for businesses",
      "website": "https://techinnovatesolutions.com",
      "country_code": "US"
    }
  },
  "check_id": "kyb.mcc_code_check_v3",
  "webhook_url": "https://your-webhook-url.com/callback"
}'

Step 2: Poll for Job Status (Optional if using webhook)

If you’re not using a webhook, you can poll for the job status using the getJobById endpoint.
curl 'https://demo.parcha.ai/api/v1/getJobById?job_id=YOUR_JOB_ID&include_check_results=true' \
-H 'Authorization: Bearer YOUR_API_KEY'

Step 3: Process the Results

Once the job is completed, examine the results to retrieve the MCC code and its description.
Python
if job_data['status'] == 'complete':
    mcc_check_result = next(
        (result for result in job_data['check_results']
         if result['command_id'] == 'kyb.mcc_code_check_v3'),
        None
    )
    if mcc_check_result:
        payload = mcc_check_result['payload']
        mcc_code = payload.get('mcc_code')
        mcc_title = payload.get('mcc_title')
        mcc_description = payload.get('mcc_code_description')
        print(f"MCC Code: {mcc_code}")
        print(f"Title: {mcc_title}")
        print(f"Description: {mcc_description}")
    else:
        print("MCC code check result not found.")
Or use JSONPath for cleaner extraction:
Python
from urllib.parse import quote

jsonpath_query = '$.check_results[?(@.command_id=="kyb.mcc_code_check_v3")].payload'
url = f'https://demo.parcha.ai/api/v1/getJobById?job_id={job_id}&include_check_results=true&jsonpath_query={quote(jsonpath_query)}'

response = requests.get(url, headers=headers)
mcc_payload = response.json()[0]

print(f"MCC Code: {mcc_payload['mcc_code']}")
print(f"Title: {mcc_payload['mcc_title']}")
print(f"Description: {mcc_payload['mcc_code_description']}")

Conclusion

This MCC code verification process demonstrates a straightforward use of the Parcha API:
  1. It requires minimal input (basic business information).
  2. It can be executed with a single API call to runCheck.
  3. Results can be retrieved either through a webhook or by polling the job status.
This approach is efficient for quick verifications that don’t require document uploads or complex multi-step processes. Always ensure that the business information provided is accurate to get the most reliable MCC code verification results.