Regulatory compliance is a critical but often cumbersome part of doing business. Know Your Customer (KYC) processes, in particular, are a maze of data verification, background checks, and risk assessments. Traditional approaches often lead to monolithic, inflexible systems that are slow to build and difficult to adapt. But what if you could transform this complex workflow into a set of simple, reusable, and manageable services?
This is the power of Services-as-Software. By treating business logic as discoverable API endpoints, you can build powerful, automated systems with unprecedented flexibility.
Today, we'll walk through how you can use services.do to build a fully automated, composable KYC service from the ground up.
A typical KYC process isn't a single action; it's a sequence of smaller, distinct tasks. Instead of building one giant application, let's break it down into logical, independent services:
With services.do, each of these tasks can become a standalone, "agentic service" in your central registry. They are independent but designed to work together.
The core of the .do platform is the ability to define these services using Business-as-Code. You write the logic for an Agentic Workflow, and services.do automatically registers it as a discoverable, versioned API endpoint.
For example, let's imagine the code for our sanctions-screening.do service. The workflow might look something like this (in a simplified, conceptual format):
// This is a conceptual Business-as-Code workflow definition.
// Once deployed, it becomes the 'sanctions-screening.do' service.
defineWorkflow('sanctions-screening', async (input) => {
const { name, dateOfBirth } = input;
// 1. Call an external OFAC screening API
const ofacResult = await externalApi.ofac.check({ name });
// 2. Call an external EU sanctions list API
const euResult = await externalApi.euSanctions.check({ name, dob: dateOfBirth });
// 3. Aggregate the results
const hasMatch = ofacResult.match || euResult.match;
// 4. Return a standardized output
return {
match: hasMatch,
sources: ['OFAC', 'EU Sanctions'],
checkedAt: new Date().toISOString()
};
});
Once this workflow is deployed, it's instantly available in your service registry. The complex logic of calling multiple external APIs is now abstracted into a single, simple service call: sanctions-screening.do. You can now do the same for identity verification, address validation, and more.
Now for the magic. With our building blocks (identity-verification.do, address-validation.do, etc.) registered in services.do, we can create a master workflow that orchestrates them.
This new workflow, kyc.do, doesn't need to know the internal details of the other services. It just needs to call them.
// This conceptual workflow composes other services from the registry.
defineWorkflow('kyc-orchestrator', async (input) => {
const { userProfile } = input;
// Run services from the registry in parallel
const [idResult, addressResult, screeningResult] = await Promise.all([
// Call the service by its '.do' name
do.run('identity-verification.do', { document: userProfile.document }),
do.run('address-validation.do', { address: userProfile.address }),
do.run('sanctions-screening.do', { name: userProfile.name, dateOfBirth: userProfile.dob })
]);
// Implement the final business logic
if (idResult.status !== 'valid' || addressResult.status !== 'valid' || screeningResult.match) {
return { status: 'review_required', issues: [...] };
}
return { status: 'approved', verifiedAt: new Date().toISOString() };
});
When this is deployed, we have a new, high-level service: kyc.do. We’ve turned a complex, multi-step compliance process into a single, unified API call.
Your development team can now discover and integrate this powerful capability with just a few lines of code using the .do SDK. There's no need to read pages of different API docs for each sub-task; they just consume the final product.
Here's how a developer would use your new kyc.do service in their application:
import { Do } from '@do-inc/sdk';
// Initialize the .do client
const बिंदु = new Do(process.env.DO_API_KEY);
async function onboardNewUser(user) {
try {
// Run the entire KYC workflow with one API call
const kycResult = await बिंदु.services.run('kyc.do', {
userProfile: {
name: user.fullName,
dob: user.dateOfBirth,
address: user.address,
document: user.passportImage
}
});
console.log(`KYC Status: ${kycResult.status}`);
// KYC Status: approved
//... proceed with user onboarding
} catch (error) {
console.error("KYC process failed:", error);
}
}
Building your KYC process on services.do offers tremendous benefits:
By moving from monolithic applications to a composable, service-oriented architecture with services.do, you're not just automating compliance—you're building a more agile, resilient, and efficient business.
Ready to turn your complex business logic into manageable Services-as-Software? Explore services.do today and discover a new way to build.