This guide outlines practical applications of the Parcha API, demonstrating how to leverage our endpoints for various compliance and due diligence scenarios. Let’s explore a common use case: document remediation.

Document Remediation

Document remediation is a crucial step in many KYB (Know Your Business) processes. It involves verifying the validity and authenticity of documents provided by businesses. Let’s look at how you can use Parcha’s API to streamline this process, focusing on proof of address verification.

Approach A: Multi-Step Process

This approach utilizes multiple API endpoints for a granular, step-by-step process.

Step 1: Upload the Document

First, use the document upload endpoint to securely store the document in our system.

Step 2: Run the Proof of Address Verification Check

Using the URL returned from the document upload, initiate the verification check.

Step 3: Poll for Job Status

Regularly check the status of the job using the job ID returned from the previous step.

Step 4: Process the Results

Once the job is completed, examine the results to determine if the document is validated or if there’s feedback to provide to the customer.

Python
if job_data['status'] == 'COMPLETED':
    check_result = job_data['check_results'][0]  # Assuming there's only one check
    if check_result['passed']:
        print("Document validated successfully!")
    else:
        follow_up = check_result.get('follow_up', 'Document validation failed.')
        print(f"Document validation failed. Feedback: {follow_up}")

Approach B: Streamlined Single-Call Process

This approach utilizes an undocumented feature that allows for a more streamlined process using a single API call.

After initiating the job with this single call, you can proceed to poll for the job status and process the results as described in Steps 3 and 4 of Approach A.

Conclusion

Both approaches offer effective ways to handle document remediation:

  • Approach A provides more granular control and is useful when you need to manage documents separately from the verification process.
  • Approach B streamlines the process into a single API call, which can be more efficient for straightforward verifications.

Choose the approach that best fits your workflow and integration needs. Remember to always handle sensitive document data securely and in compliance with relevant data protection regulations.

Incorporation Document Verification

Verifying incorporation documents is a crucial step in the KYB process. This example demonstrates how to use the Parcha API to verify incorporation documents using a webhook for efficient result handling.

Step 1: Prepare Document Data and Run Verification

Use the runCheck endpoint to initiate the incorporation document verification process.

Note on Verification Options:

  1. enable_visual_verification (default: True)
    • Uses a vision language model to analyze the document visually.
    • Detects official seals, signatures, and other visual elements.
    • Reference images of seals and signatures can be provided for specific document types.
    • Adds approximately 15-30 seconds of latency to the process.
  2. enable_fraud_check (default: False)
    • Runs sophisticated fraud and tampering analysis on the document metadata.
    • Adds about 1-2 minutes of latency to the process.
  3. verify_incorporation_date (default: True)
    • The check will fail if there are significant discrepancies in the incorporation date.
  4. verify_registration_number (default: False)
    • The check will fail if there are significant discrepancies in the registration number.
  5. verify_address (default: False)
    • The check will fail if there are significant discrepancies in the address.
  6. verify_no_high_risk_fraud (default: False)
    • The check will fail if HIGH_RISK indicators are detected in the document metadata.

Important Notes:

  • By default, without these options enabled, the system performs an OCR-based check using LLMs to extract text from the document and analyze it.
  • Consider the trade-off between thoroughness and speed when deciding which options to enable for your use case.
  • Each verification option adds an additional layer of scrutiny but may increase processing time.

Step 2: Set Up Webhook to Receive Results

Create an endpoint on your server to receive the webhook callback. Here’s an example using Express.js. For more detailed information about webhooks, refer to the Webhooks section:

const express = require('express');
const app = express();
app.use(express.json());

app.post('/callback', (req, res) => {
  const jobData = req.body;
  
  if (jobData.status === 'complete') {
    const incorporationCheck = jobData.check_results.find(
      check => check.command_id === 'kyb.incorporation_document_verification'
    );
    
    if (incorporationCheck) {
      console.log('Incorporation Document Verification Result:', check);
      
      // Process the result as needed
      if (check.passed) {
        console.log('Document is valid');
        // Perform actions for valid document
      } else {
        console.log('Document is invalid');
        // Handle invalid document case
      }
    }
  }
  
  res.sendStatus(200);
});

app.listen(3000, () => console.log('Webhook server running on port 3000'));

Step 3: Process the Results

In your webhook handler, process the results of the incorporation document verification:

if (incorporationCheck) {
  const result = incorporationCheck.command_result.output.payload;
  
  console.log('Document Validity:', result.is_valid);
  console.log('Visual Verification Result:', result.visual_verification_result);
  console.log('Fraud Check Result:', result.fraud_check_result);
  
  if (result.is_valid) {
    console.log('Incorporation Date:', result.incorporation_date);
    console.log('Company Name:', result.company_name);
    console.log('Registration Number:', result.registration_number);
  } else {
    console.log('Verification Failed. Reason:', result.failure_reason);
  }
  
  // Take appropriate action based on the results
}

MCC Code Verification

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.

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.

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'), None)
    if mcc_check_result:
        mcc_data = mcc_check_result['command_result']['output']['payload']
        mcc_code = mcc_data.get('mcc_code')
        mcc_description = mcc_data.get('mcc_code_description')
        print(f"MCC Code: {mcc_code}")
        print(f"Description: {mcc_description}")
    else:
        print("MCC code check result not found.")

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.