---
agentTools:
  projectIndex: https://developer.stockal.com/llms.txt
---

# Add User Bank Details

This API should be used to add the customers bank details and also get them verified using penny drop. User will be given a penny

### Response Parameters

| FIELD     | TYPE              | DESCRIPTION       |
| :-------- | :---------------- | :---------------- |
| bankId    | String            | bankId            |
| createdAt | String (DateTime) | Created timestamp |
| msg       | String            | Response message  |

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "fund APIs",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://uat-fundapi.stockal.com"
    }
  ],
  "security": [
    {}
  ],
  "paths": {
    "/fund/customer/add-bank-detail": {
      "post": {
        "summary": "Add User Bank Details",
        "description": "This API should be used to add the customers bank details and also get them verified using penny drop. User will be given a penny",
        "operationId": "add-user-bank-details",
        "parameters": [
          {
            "name": "api-key",
            "in": "header",
            "description": "API Key",
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "auth-key",
            "in": "header",
            "description": "Auth key generated using API key & secret",
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "customerId",
                  "beneficiaryAccountNumber",
                  "bankIFSC",
                  "beneficiaryName"
                ],
                "properties": {
                  "customerId": {
                    "type": "string",
                    "description": "This customer ID provide by API user. This is unique id."
                  },
                  "beneficiaryAccountNumber": {
                    "type": "string",
                    "description": "Bank Account Number"
                  },
                  "beneficiaryAccountType": {
                    "type": "string",
                    "description": "Bank Account Type [“SAVINGS”, “CURRENT”]"
                  },
                  "bankName": {
                    "type": "string",
                    "description": "Bank Name"
                  },
                  "bankRoutingNumber": {
                    "type": "string",
                    "description": "Bank Routing Number"
                  },
                  "bankAddress": {
                    "type": "string",
                    "description": "Address of the bank"
                  },
                  "bankState": {
                    "type": "string",
                    "description": "State"
                  },
                  "bankPostalCode": {
                    "type": "string",
                    "description": "Pin Code"
                  },
                  "bankCountry": {
                    "type": "string",
                    "description": "Country of the bank"
                  },
                  "bankIFSC": {
                    "type": "string",
                    "description": "Bank IFSC Code",
                    "default": "HDFC0012345"
                  },
                  "beneficiaryName": {
                    "type": "string",
                    "description": "Name of the Beneficiary"
                  },
                  "bankSwiftCode": {
                    "type": "string",
                    "description": "Swift Code of the bank"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n\t   \"status\": 200,\n                      \"doc\": {\n                       \"bankId\": \"27290778\",\n                        \"createdAt\": \"2022-11-15T02:17:15.766Z\"\n                   }\n}\n"
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "status": {
                      "type": "integer",
                      "example": 200,
                      "default": 0
                    },
                    "doc": {
                      "type": "object",
                      "properties": {
                        "bankId": {
                          "type": "string",
                          "example": "27290778"
                        },
                        "createdAt": {
                          "type": "string",
                          "example": "2022-11-15T02:17:15.766Z"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "400",
            "content": {
              "application/json": {
                "examples": {
                  "Invalid Customer ID": {
                    "value": "{\n\t\"status\": 400,\n\t\"error\": \"Invalid customer Id.\"\n}\n"
                  },
                  "Invalid IFSC or Account Number": {
                    "value": "{\n \"status\": 400,\n   \"error\": “Invalid account number of IFSC provided\"\n }\n"
                  },
                  "Unable to fetch bank details": {
                    "value": " {\n \"status\": 400,\n \"error\": \"Unable to fetch other details(bank name, state, address, country etc.) by IFSC code , please provide these details\"\n}\n"
                  },
                  "Invalid Input": {
                    "value": "{\n \"status\": 400,\n   \"error\": \"Invalid value passed for an input\"\n}\n"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Invalid Customer ID",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Invalid customer Id."
                        }
                      }
                    },
                    {
                      "title": "Unable to fetch bank details",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Unable to fetch other details(bank name, state, address, country etc.) by IFSC code , please provide these details"
                        }
                      }
                    },
                    {
                      "title": "Invalid Input",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 400,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Invalid value passed for an input"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "422": {
            "description": "422",
            "content": {
              "application/json": {
                "examples": {
                  "Account Blocked": {
                    "value": "{\n\"status\": 422,\n   \"error\": “Account is Blocked\"\n}\n"
                  },
                  "NRE Account": {
                    "value": "{\n\"status\": 422,\n   \"error\": “NRE Account\"\n}"
                  },
                  "IFSC Invalid": {
                    "value": "{\n \"status\": 422,\n   \"error\": IFSC is Invalid\"\n }"
                  },
                  "IFSC Format": {
                    "value": "{\n \"status\": 422,\n   \"error\": \"ifsc length must be 11 characters long\"\n }\n"
                  },
                  "Account Number format": {
                    "value": "{\n \"status\": 422,\n   \"error\": \"accountNumber length must be less than or equal to 25 characters long\"\n}\n"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "IFSC Format",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 422,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "ifsc length must be 11 characters long"
                        }
                      }
                    },
                    {
                      "title": "Account Number format",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 422,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "accountNumber length must be less than or equal to 25 characters long"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "500": {
            "description": "500",
            "content": {
              "application/json": {
                "examples": {
                  "Bank Error": {
                    "value": "{\n \"status\": 500,\n   \"error\": \"Bank error: Internal Server Error\"\n}"
                  },
                  "Bank Source Unavailable": {
                    "value": "{\n \"status\": 500,\n   \"error\": \"Bank error: Source Unavailable\"\n}\n"
                  },
                  "Source Bank Declined": {
                    "value": "{\n \"status\": 500,\n   \"error\": \"Bank error: Source Bank Declined\"\n}\n"
                  },
                  "Beneficiary Bank Offline": {
                    "value": "{\n \"status\": 500,\n   \"error\": \"Bank error: Beneficiary Bank Offline“\n}\n"
                  },
                  "NPCI Unavailable": {
                    "value": "{\n\"status\": 500,\n \"error\": \"Bank error: NPCI Unavailable“\n}\n"
                  },
                  "IMPS Mode fail": {
                    "value": "{\n \"status\": 500,\n   \"error\": \"Bank error: IMPS Mode Fail\"\n}\n"
                  }
                },
                "schema": {
                  "oneOf": [
                    {
                      "title": "Bank Error",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 500,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Bank error: Internal Server Error"
                        }
                      }
                    },
                    {
                      "title": "Bank Source Unavailable",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 500,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Bank error: Source Unavailable"
                        }
                      }
                    },
                    {
                      "title": "Source Bank Declined",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 500,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Bank error: Source Bank Declined"
                        }
                      }
                    },
                    {
                      "title": "IMPS Mode fail",
                      "type": "object",
                      "properties": {
                        "status": {
                          "type": "integer",
                          "example": 500,
                          "default": 0
                        },
                        "error": {
                          "type": "string",
                          "example": "Bank error: IMPS Mode Fail"
                        }
                      }
                    }
                  ]
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "curl --location --request POST 'https://uat-fundapi.stockal.com/fund/customer/add-bank-detail' \\\n--header 'api-key: {{api-key}}' \\\n--header 'auth-key: {{auth-key}}' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"beneficiaryAccountNumber\": \"202597415804\",\n    \"bankIFSC\": \"SBIN0007736\",\n    \"beneficiaryName\": \"Roshan Shetty\",\n    \"customerId\": \"018d53c5-4813-4965-87e6-694cf968d946\",\n    \"beneficiaryAccountType\": \"Savings\",\n    \"bankName\": \"STATE BANK OF INDIA\",\n    \"bankRoutingNumber\": \"1234\",\n    \"bankAddress\": \"Chinchwad\",\n    \"bankState\": \"Maharashtra\",\n    \"bankPostal\": \"411019\",\n    \"bankCountry\": \"India\",\n    \"bankSwiftCode\": \"SBINBB2238\"\n}'",
              "name": "Request"
            }
          ],
          "samples-languages": [
            "curl"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [],
    "explorer-enabled": true,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true,
  "_id": "638f24128b159a002e48bfb4:638e29207af9b2005d949ffa"
}
```