m2pfintech
API LibraryBranch Management

Get Branch Details

Retrieves branch details using various filter criteria. Supports filtering by branchId, branchCode, branchName, creation date range, modification date range, pagination, and sorting. All filter fields are optional. When isAudit is set to true, the response includes audit trail information showing who created or modified the branch and when. The sortFields parameter accepts field names as keys with ASC or DESC direction values.

POST
/branch/fetch

Authorization

tenantAuth
tenant<token>

The DCMS tenant name for multi-tenant isolation. Every API call must include this header to identify the client organization.

In: header

Header Parameters

tenant*string

The DCMS client or tenant name for multi-tenant isolation.

Request Body

application/json

branchId?string

Filter results by branch identifier. Exact match.

branchCode?string

Filter results by branch code. Exact match.

branchName?string

Filter results by branch name. May support partial match depending on configuration.

fromCreatedDate?string

Start of the creation date range filter in YYYY-MM-DD HH:mm:ss format.

toCreatedDate?string

End of the creation date range filter in YYYY-MM-DD HH:mm:ss format.

fromChangedDate?string

Start of the modification date range filter in YYYY-MM-DD HH:mm:ss format.

toChangedDate?string

End of the modification date range filter in YYYY-MM-DD HH:mm:ss format.

pageNo?integer

Page number for paginated results. Starts from 1.

pageSize?integer

Number of records to return per page.

isAudit?boolean

Set to true to include audit trail information in the response showing creation and modification history.

sortFields?

Key-value pairs for sorting results. Keys are field names and values are sort direction (ASC or DESC).

Response Body

application/json

application/json

curl -X POST "https://api.dcms.example.com/v1/branch/fetch" \  -H "tenant: ACME_BANK" \  -H "Content-Type: application/json" \  -d '{    "branchId": "BR001",    "branchCode": "BRC001",    "branchName": "Main Branch",    "fromCreatedDate": "2024-01-01 00:00:00",    "toCreatedDate": "2024-03-31 23:59:59",    "fromChangedDate": "2024-01-01 00:00:00",    "toChangedDate": "2024-03-31 23:59:59",    "pageNo": 1,    "pageSize": 10,    "isAudit": false,    "sortFields": {      "branchName": "ASC",      "createdDate": "DESC"    }  }'
{
  "result": true,
  "exception": null,
  "pagination": null
}
{
  "result": null,
  "exception": {
    "errorCode": "BR003",
    "shortMessage": "Invalid filter criteria",
    "detailMessage": "The provided filter criteria are invalid or contain malformed dates",
    "httpStatus": "BAD_REQUEST",
    "fieldError": [
      "Invalid date format for fromCreatedDate"
    ],
    "languageCode": "en"
  },
  "pagination": null
}