Api DocumentationinitiateDirectUser

Direct User Initiation API

This document explains how to perform a comprehensive user onboarding in a single API call, including user creation, KYC submission, and bank account linking.

Overview

The initiate-direct endpoint is a powerful utility designed for merchants who want to streamline the onboarding process. Instead of making multiple calls to create a user, submit KYC, and add a bank, this endpoint allows you to provide all the necessary information in one request.

Initiate Direct User Onboarding

Description: Creates a new user, processes their KYC documents, and links their bank account details simultaneously.

Request Body Payload

Property NameTypeMandatoryDescription
userobjectYesContains basic user identification.
user.user_idstringYesThe unique UUID for the user (must be unique across your client account).
user.user_typestringYesThe type of user (e.g., individual).
kycarrayYesAn array of KYC document objects.
kyc[].document_typestringYesType of document (pid or tid).
kyc[].document_namestringYesName of the document (e.g., aadhar, pan).
kyc[].document_numberstringYesThe document identification number.
kyc[].dateOfBirthstringYesUser’s date of birth (YYYY-MM-DD).
kyc[].nameOnCardstringYesThe name as it appears on the document.
bankobjectYesContains the user’s bank account details.
bank.account_numberstringYesThe bank account number.
bank.ifsc_codestringYesThe IFSC code of the bank branch.
bank.account_holder_namestringYesThe name of the account holder.
bank.bank_namestringYesThe name of the bank.

cURL Command

curl --request POST \
  --url https://api.swiftramp.in/v1/user/initiate-direct \
  --header 'Authorization: Bearer [JWT_TOKEN]' \
  --header 'Content-Type: application/json' \
  --data '{
  "user": {
    "user_id": "87b2b208-a8e6-4185-90ba-67629a95eb52",
    "user_type": "individual"
  },
  "kyc": [
    {
      "document_type": "pid",
      "document_name": "aadhar",
      "document_number": "987654321001",
      "dateOfBirth": "2004-05-24",
      "nameOnCard": "Ravinder Joshi"
    },
    {
      "document_type": "tid",
      "document_name": "pan",
      "document_number": "JFGKE8767L",
      "dateOfBirth": "2004-05-24",
      "nameOnCard": "Ravinder Joshi"
    }
  ],
  "bank": {
    "account_number": "987654321123",
    "ifsc_code": "SBIN0000031",
    "account_holder_name": "Ravinder Joshi",
    "bank_name": "State Bank Of India"
  }
}'

Success Response (201 Created)

{
    "status": true,
    "code": 201,
    "message": "User, KYC, and Bank creation req received. check data for detail",
    "data": {
        "createdUser": {
            "data": {
                "user_id": "87b2b208-a8e6-4185-90ba-67629a95eb53",
                "user_type": "individual",
                "email": "1775455148931-2405@leoppay-random.com"
            },
            "message": "user added successfully"
        },
        "createdKYC": {
            "data": [
                {
                    "status": true,
                    "message": "KYC created",
                    "data": {
                        "document_name": "aadhar",
                        "kyc_status": "success",
                        "verified_by": "system"
                    }
                }
            ],
            "message": "KYC processed"
        },
        "createdBank": {
            "data": {
                "status": true,
                "message": "Bank created",
                "data": {
                    "account_number": "987654321123",
                    "bank_status": "pending"
                }
            },
            "message": "Bank processed"
        }
    }
}

Error Response (409 Conflict)

User ID Already Exists

{
    "status": false,
    "code": 409,
    "message": "User uuid given by client is already asigned to another user",
    "data": {}
}

Important Notes

  • 💡 Atomic-like Operation: While the system attempts to create all entities, you should check the nested data objects in the response to confirm the status of each component (User, KYC, and Bank).
  • 💡 Duplicate User ID: If the user_id provided has already been used by your client account, the API will return a 409 error.
  • 💡 Bank Verification: The bank account is initially created with a pending status and will undergo verification.