Skip to content

Instantly share code, notes, and snippets.

@sayeed205
Last active November 15, 2024 17:11
Show Gist options
  • Select an option

  • Save sayeed205/b1df0870aeebcabac2587e41e0b96322 to your computer and use it in GitHub Desktop.

Select an option

Save sayeed205/b1df0870aeebcabac2587e41e0b96322 to your computer and use it in GitHub Desktop.
  1. Tenant authentication
  2. Create Individual Investor Profile
    {
        "type": "individual",
        "tax_status": "resident_individual",
        "name": "Sayed Ahmed",
        "date_of_birth": "2000-10-22",
        "gender": "male",
        "occupation": "professional",
        "pan": "DGTPA0201D",
        "country_of_birth": "IN",
        "place_of_birth": "IN",
        "use_default_tax_residences": "false",
        "source_of_wealth": "salary",
        "income_slab": "upto_1lakh",
        "pep_details": "not_applicable"
    }
    {
        "object": "investor_profile",
        "id": "invp_a0c725cdf86d44eda41cc4259e5e3b38",
        "type": "individual",
        "tax_status": "resident_individual",
        "ip_address": "152.58.245.243",
        "created_at": "2024-11-15T17:49:52+05:30",
        "name": "Sayed Ahmed",
        "date_of_birth": "2000-10-22",
        "gender": "male",
        "occupation": "professional",
        "pan": "DGTPA0201D",
        "guardian_name": null,
        "guardian_date_of_birth": null,
        "guardian_pan": null,
        "signature": null,
        "country_of_birth": "IN",
        "nationality_country": null,
        "citizenship_countries": null,
        "place_of_birth": "IN",
        "first_tax_residency": null,
        "second_tax_residency": null,
        "third_tax_residency": null,
        "fourth_tax_residency": null,
        "source_of_wealth": "salary",
        "income_slab": "upto_1lakh",
        "pep_details": "not_applicable",
        "employer": null,
        "father_name": null,
        "mother_name": null,
        "aadhaar_number": null,
        "marital_status": null
    }
  3. Create Phone
    {
        "profile": "{{investor_profile_id}}",
        "isd": "91",
        "number": "9851305775"
    }
    {
        "object": "phone_number",
        "id": "phone_c78d3c47464b4ec5a1657c2fa4c92b18",
        "profile": "invp_a0c725cdf86d44eda41cc4259e5e3b38",
        "isd": "91",
        "number": "9851305775",
        "belongs_to": null,
        "created_at": "2024-11-15T17:53:18+05:30"
    }
  4. Create Email
    {
        "profile": "{{investor_profile_id}}",
        "email": "sayeed205@gmail.com"
    }
    {
        "object": "email_address",
        "id": "email_a495d5e7003f4233b0a6ceb77f4b2607",
        "profile": "invp_a0c725cdf86d44eda41cc4259e5e3b38",
        "email": "sayeed205@gmail.com",
        "belongs_to": null,
        "created_at": "2024-11-15T17:54:43+05:30"
    }
  5. Create Bank Account
    {
        "profile": "{{investor_profile_id}}",
        "primary_account_holder_name": "Sayed Ahmed",
        "account_number": "50056471193",
        "type": "savings",
        "ifsc_code": "IDIB000B512"
    }
    {
        "object": "bank_account",
        "id": "bac_c359ec466f604a24b42c413d35c627b5",
        "old_id": 9,
        "profile": "invp_a0c725cdf86d44eda41cc4259e5e3b38",
        "primary_account_holder_name": "Sayed Ahmed",
        "account_number": "50056471193",
        "type": "savings",
        "ifsc_code": "IDIB000B512",
        "cancelled_cheque": null,
        "branch_name": "BABLA",
        "bank_name": "INDIAN BANK",
        "branch_address": "VILLAGE BABLA P O MAHERAPUR",
        "branch_contact_number": "0",
        "branch_city": "BABLA",
        "branch_district": "MALDAH",
        "branch_state": "WEST BENGAL",
        "sole_proprietorship": null,
        "created_at": "2024-11-15T17:56:32+05:30"
    }
  6. Verify Bank Account
    {
        "object": "bank_account_verification",
        "id": "bav_b140ed5fa8444827ad8ff4079417fc3e",
        "bank_account": "bac_c359ec466f604a24b42c413d35c627b5",
        "status": "pending", //"completed"
        "confidence": null, //"very_high"
        "reason": "digital_verification",
        "created_at": "2024-11-15T17:57:52+05:30",
        "failed_at": null,
        "completed_at": null,
        "updated_at": "2024-11-15T17:57:52+05:30"
        }
  7. KYC init - from gathered data above
    {
      "pan": "DGTPA0201D",
      "email": "sayeed205@gmail.com",
      "mobile": {
        "isd": "+91",
        "number": "8160597103"
      },
      "name": "Sayed Ahmd",
      "gender": "male",
      "date_of_birth": "2000-10-22",
      "country_of_birth": "in",
      "residential_status": "resident_individual",
      "occupation_type": "professional",
      "geolocation": {
        "latitude": 12.354,
        "longitude": 77.453
      },
      "bank_account": {
        "account_holder_name": "Sayed Ahmed",
        "account_number": "50056471193",
        "ifsc_code": "IDIB000B512"
      }
    }
    {
        "object": "kyc_request",
        "id": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "status": "pending",
        "pan": "DGTPA0201D",
        "name": "Sayed Ahmd",
        "aadhaar_number": null,
        "father_name": null,
        "spouse_name": null,
        "mother_name": null,
        "email": "sayeed205@gmail.com",
        "mobile": {
            "isd": "+91",
            "number": "8160597103"
        },
        "ipv_video": null,
        "signature": null,
        "photo": null,
        "gender": "male",
        "date_of_birth": "2000-10-22",
        "marital_status": null,
        "country_of_birth": "in",
        "address": null,
        "identity_proof": null,
        "residential_status": "resident_individual",
        "occupation_type": "professional",
        "esign_required_at": null,
        "submitted_at": null,
        "successful_at": null,
        "rejected_at": null,
        "expires_at": "2024-11-20T18:06:12.559+0530",
        "created_at": "2024-11-15T18:06:12.566+0530",
        "updated_at": "2024-11-15T18:06:12.566+0530",
        "otp": "873309",
        "requirements": {
            "fields_needed": [
                "identity_proof",
                "address",
                "marital_status",
                "father_name_or_spouse_name",
                "aadhaar_number",
                "photo",
                "signature",
                "ipv_video"
            ]
        },
        "geolocation": {
            "latitude": 12.354,
            "longitude": 77.453
        },
        "bank_account": {
            "ifsc_code": "IDIB000B512",
            "account_number": "50056471193",
            "account_holder_name": "Sayed Ahmed"
        },
        "redirect_url": null,
        "verification": {
            "status": "pending",
            "details": null,
            "details_verbose": null
        }
    }
  8. Address create
    {
        "profile": "{{investor_profile_id}}",
        "line1": "Babla, Meherapur, Mothabari",
        "line2": "Malda",
        "city":"Malda",
        "state": "West Bengal",
        "postal_code": "732207",
        "country": "
    }
    {
        "object": "address",
        "id": "addr_8d84d57a485b44e890634a5c8d9117a6",
        "profile": "invp_a0c725cdf86d44eda41cc4259e5e3b38",
        "line1": "Babla, Meherapur, Mothabari",
        "line2": "Malda",
        "line3": null,
        "city": "Malda",
        "state": "WEST BENGAL",
        "postal_code": "732207",
        "country": "IN",
        "nature": null,
        "created_at": "2024-11-15T18:14:16+05:30"
    }
  9. Update the KYC request with additional data
    {
        "father_name": "Majirudding Ahmed",
        "mother_name": "Farida Momin",
        "marital_status": "unmarried"
    }
  10. Add Identity Document
    {
        "kyc_request": "{{kyc_request_id}}",
        "type": "aadhaar",
        "postback_url": "https://fintechprimitives.com/"
    }
    {
        "object": "identity_document",
        "id": "iddoc_c17e309936e04c56a7d5a1f028dc2a42",
        "type": "aadhaar",
        "kyc_request": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "profile": null,
        "source_ref_id": null,
        "fetch": {
            "redirect_url": "https://s.finprim.com/v2/identity_documents/iddoc_c17e309936e04c56a7d5a1f028dc2a42/forward_to?token=c17e3099-36e0-4c56-a7d5-a1f028dc2a42135891",
            "postback_url": "https://fintechprimitives.com/",
            "status": "pending",
            "reason": null,
            "expires_at": "2024-11-15T19:27:32+05:30"
        },
        "data": null,
        "created_at": "2024-11-15T18:27:32+05:30",
        "updated_at": "2024-11-15T18:27:32+05:30"
    }
    Visiting above redirect_url will fetch some identity data about the customer
    {
        "object": "identity_document",
        "id": "iddoc_c17e309936e04c56a7d5a1f028dc2a42",
        "type": "aadhaar",
        "kyc_request": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "profile": null,
        "source_ref_id": null,
        "fetch": {
            "redirect_url": null,
            "postback_url": "https://fintechprimitives.com/",
            "status": "successful",
            "reason": null,
            "expires_at": null
        },
        "data": {
            "ref_no": "01002274hepLic/0ne/TC5xEUJ57cZqmlv/QqOMFKCXpzHJIRfqNfo5hBvWZxlG2e2Ltb/l3",
            "fetched_at": "2024-11-15T18:29:09+0530",
            "name": "fintechprimitives",
            "date_of_birth": "1990-01-01",
            "gender": "male",
            "care_of": "Tony",
            "number": "000000000512",
            "line_1": "36th cross south jayanagar bengaluru",
            "city": "bangalore",
            "pincode": "560041",
            "country": "in",
            "photo": "huge ass base64 url"
        },
        "created_at": "2024-11-15T18:27:32+05:30",
        "updated_at": "2024-11-15T18:29:09+05:30"
    }
  11. Update the KYC request
    {
        "aadhaar_number": "7700",
        "father_name": "Majirudding Ahmed",
        "mother_name": "Farida Momin",
        "marital_status": "unmarried",
        "address": {
        "line_1": "Babla, Meherapur, Mothabari",
        "line_2": "Malda",
        "line_3": null,
        "city": "Malda",
        "pincode": "732207",
        "country": "in",
        "proof": "iddoc_c17e309936e04c56a7d5a1f028dc2a42",
        "proof_type": "aadhaar"
    }
    {
        "object": "kyc_request",
        "id": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "status": "pending",
        "pan": "DGTPA0201D",
        "name": "Sayed Ahmd",
        "aadhaar_number": "7700",
        "father_name": "Majirudding Ahmed",
        "spouse_name": null,
        "mother_name": "Farida Momin",
        "email": "sayeed205@gmail.com",
        "mobile": {
            "isd": "+91",
            "number": "8160597103"
        },
        "ipv_video": null,
        "signature": null,
        "photo": null,
        "gender": "male",
        "date_of_birth": "2000-10-22",
        "marital_status": "unmarried",
        "country_of_birth": "in",
        "address": {
            "city": "Malda",
            "proof": "iddoc_c17e309936e04c56a7d5a1f028dc2a42",
            "line_1": "Babla, Meherapur, Mothabari",
            "line_2": "Malda",
            "line_3": null,
            "country": "in",
            "pincode": "732207",
            "proof_type": "aadhaar"
        },
        "identity_proof": null,
        "residential_status": "resident_individual",
        "occupation_type": "professional",
        "esign_required_at": null,
        "submitted_at": null,
        "successful_at": null,
        "rejected_at": null,
        "expires_at": "2024-11-20T18:06:12.559+0530",
        "created_at": "2024-11-15T18:06:12.566+0530",
        "updated_at": "2024-11-15T18:39:50.616+0530",
        "otp": "873309",
        "requirements": {
            "fields_needed": [
                "identity_proof",
                "photo",
                "signature"
            ]
        },
        "geolocation": {
            "latitude": 12.354,
            "longitude": 77.453
        },
        "bank_account": {
            "ifsc_code": "IDIB000B512",
            "account_number": "50056471193",
            "account_holder_name": "Sayed Ahmed"
        },
        "redirect_url": null,
        "verification": {
            "status": "pending",
            "details": null,
            "details_verbose": null
        }
    }
  12. UPLOAD PAN, Photo, Signature and update the KYC
    {
      "identity_proof": "file_601f332237d04054a943bf2d5b2d8e00",
      "signature": "file_f7ae83fc206d443b8962fc7353205d68",
      "photo": "file_b734293896334497930d7949da74ce78"
    }
    {
        "object": "kyc_request",
        "id": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "status": "pending",
        "pan": "DGTPA0201D",
        "name": "Sayed Ahmd",
        "aadhaar_number": "7700",
        "father_name": "Majirudding Ahmed",
        "spouse_name": null,
        "mother_name": "Farida Momin",
        "email": "sayeed205@gmail.com",
        "mobile": {
            "isd": "+91",
            "number": "8160597103"
        },
        "ipv_video": null,
        "signature": "file_f7ae83fc206d443b8962fc7353205d68",
        "photo": "file_b734293896334497930d7949da74ce78",
        "gender": "male",
        "date_of_birth": "2000-10-22",
        "marital_status": "unmarried",
        "country_of_birth": "in",
        "address": {
            "city": "Malda",
            "proof": "iddoc_c17e309936e04c56a7d5a1f028dc2a42",
            "line_1": "Babla, Meherapur, Mothabari",
            "line_2": "Malda",
            "line_3": null,
            "country": "in",
            "pincode": "732207",
            "proof_type": "aadhaar"
        },
        "identity_proof": "file_601f332237d04054a943bf2d5b2d8e00",
        "residential_status": "resident_individual",
        "occupation_type": "professional",
        "esign_required_at": null,
        "submitted_at": null,
        "successful_at": null,
        "rejected_at": null,
        "expires_at": "2024-11-20T18:06:12.559+0530",
        "created_at": "2024-11-15T18:06:12.566+0530",
        "updated_at": "2024-11-15T18:50:57.151+0530",
        "otp": "873309",
        "requirements": {
            "fields_needed": []
        },
        "geolocation": {
            "latitude": 12.354,
            "longitude": 77.453
        },
        "bank_account": {
            "ifsc_code": "IDIB000B512",
            "account_number": "50056471193",
            "account_holder_name": "Sayed Ahmed"
        },
        "redirect_url": null,
        "verification": {
            "status": "pending",
            "details": null,
            "details_verbose": null
        }
    }
  13. Perform a eKYC
    {
    	"kyc_request": "{{kyc_request_id}}",
    	"postback_url": "http://localhost:3333"
    }
    {
        "object": "esign",
        "id": "esign_0a398375c23a401b9e81f73e9c794ab1",
        "type": "aadhaar",
        "kyc_request": "kycr_0d89cd5b3f11490fb4004d66b1411fa3",
        "kyc_application": null,
        "source_ref_id": null,
        "redirect_url": "https://s.finprim.com/v2/esigns/esign_0a398375c23a401b9e81f73e9c794ab1/simulate_esign?token=6f5ea67c-4e15-4043-bf0e-67787679a67b",
        "status": "pending",
        "postback_url": "http://localhost:3333",
        "created_at": "2024-11-15T18:54:33.051+0530"
    }
    Once you visit the redirect_url the status will be successfull
  14. Now simulate the kyc request to change the status of the KYC request.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment