---
# System prepended metadata

title: System Design Interview (KYC Service)

---

# System Design Interview (KYC Service)

### Context
Users can have up to 4 documents:

- ID front (.jpg)
- ID back (.jpg)
- Proof of address (.jpg)
- Selfie (.jpg)

If all 4 documents are verified, user is verified else user is unverified.

intial
approved
rejected

User can resubmit for documents that have been rejected.

We will use a 3rd party service to process user documents 

### API Endpoint Design
...
baseurl : https://kycservice.com/
POST /verification/
return: ID

POST /verification/<ID>/front/
return: sucess/fail
    
PUT /verification/<ID>/front  
    
POST /verification/<ID>/back/
    
POST /verification/<ID>/address/
POST /verification/<ID>/Selfie/   
    
GET /verification/<ID>
    status: approved
    front: verifying
    back: uploading
    address: completed
    selfie    
    

### Database Design
...
    
table: customer
id: int
callbakck_url:    
    
    
table: verification
id : unique, int, increment
customer_id: 
status: int 
result: int (approved, rejected)

    
table
 documents
    
id:
verification_id:
url: 
type: (enum)front
timestamp: timestamp
active: boolean
status: (enum)uploading, verifying,...    
    
    
#### 
POST 
http://asdzxc.com/callbackurl/ 
    {
         data: {
            verification : {
                ...
    }
    }
    }