DEV Community

Cover image for Designing Decision Logic for Combo Check API Integrations
eKYC Pro
eKYC Pro

Posted on

Designing Decision Logic for Combo Check API Integrations

When building user onboarding flows, verifying account presence across multiple platforms—like WhatsApp, Telegram, and VK—is a common requirement. The Combo Check API allows developers to consolidate these checks into a single request, but managing the logic for partial results is crucial for a robust integration.

Choosing Your Integration Strategy

Before implementing, it is important to distinguish between the available verification patterns:

  • CSV Uploads: Best for bulk, non-real-time auditing of existing user databases.
  • Per-call API: Ideal for single-service checks where you only need to verify one specific platform at a time.
  • Combo Check API: Designed for scenarios where you need to evaluate an identifier against multiple services simultaneously to make a unified onboarding decision.

Implementation Strategy: Handling Partial Results

Because the Combo Check API executes service checks in parallel, it is possible for some services to return a result while others encounter a timeout. Your application logic must account for these null registration results.

1. Requesting the Combo

You can either use a pre-configured combo set in your dashboard or override it per request using the service_types array:

// Conceptual request payload
{
 "identifier": "+6281234567890",
 "service_types": ["ws", "telegram", "vk"]
}
Enter fullscreen mode Exit fullscreen mode

2. Normalizing the Response

When processing the response, do not assume every service will return a boolean registered value. Your logic should treat null as an indeterminate state rather than a negative signal.

// Conceptual logic for handling the response
const processComboResults = (data) => {
 const results = data.results;

 for (const [service, status] of Object.entries(results)) {
 if (status.registered === true) {
 // Proceed with service-specific onboarding
 } else if (status.error === "timeout") {
 // Handle as indeterminate: log for retry or flag for manual review
 } else {
 // Handle as not registered
 }
 }
};
Enter fullscreen mode Exit fullscreen mode

Best Practices for Robust Integrations

  • Set Appropriate Timeouts: Since the API returns within ~10 seconds, ensure your client-side implementation has a timeout threshold (e.g., 15 seconds) to prevent hanging connections.
  • Implement Individual Retries: If a specific service returns a timeout error, you can use the Per-call API to attempt a re-verification of that specific service without re-running the entire combo.
  • Check Balance Early: The API performs a pre-check against your balance. Ensure your application handles 402 status codes gracefully by prompting for account funding if the total cost of the requested combo exceeds your current balance.

Conclusion

By treating the Combo Check API response as a collection of independent signals rather than a single atomic result, you can build resilient onboarding flows that handle network variability gracefully. Always design your decision logic to distinguish between a confirmed "not registered" state and an "indeterminate" state caused by service timeouts.

This article was drafted with AI assistance and reviewed before publishing.

Top comments (0)