Confidential Encryption / Decryption Integration Guide The NSE Clearing Limited (National Clearing) Exchange Plaza, Plot No. C/1, G Block, Bandra-Kurla Complex, Bandra (E), Mumbai - 400 051 NSE Clearing Confidential Notice © Copyright NSE Clearing Ltd (NCL). All rights reserved. Unpublished rights reserved under applic…
Official record
Open source pageThe NSE Clearing Limited (National Clearing) Exchange Plaza, Plot No. C/1, G Block, Bandra-Kurla Complex, Bandra (E), Mumbai - 400 051
NSE Clearing Confidential
Notice
© Copyright NSE Clearing Ltd (NCL). All rights reserved. Unpublished rights reserved under applicable copyright and trades secret laws.
The contents, ideas and concepts presented herein are proprietary and confidential. Duplication and disclosure to others in whole, or in part is prohibited
AES Algorithm Integration Guide......................................................................................................................3
Algorithm: AES-256-CBC with PKCS5 Padding Encoding: UTF-8 Cipher Text Format: Base64
For secure message exchange between systems, we use AES (Advanced Encryption Standard) with the following configuration:
| Parameter | Value |
|---|---|
| Algorithm | AES |
| Mode | CBC (Cipher Block Chaining) |
| Padding | PKCS5Padding |
| Secret Key Size | 256 bits (32 bytes) |
| IV Size | 128 bits (16 bytes) |
| Text Encoding | UTF-8 |
| Cipher Output | Base64 encoded string |
This document provides reference implementation and rules to ensure interoperability.
Secret Key
Initialization Vector (IV)
Incorrect key or IV length will cause decryption failure
Constants AES = "AES"; AES_TRANSFORMATION = "AES/CBC/PKCS5Padding"; CHARSET_NAME = "UTF-8";
Sample code for encryption
public String encrypt(String plainText, byte[] secretKeyBytes, byte[] ivBytes)
{ try {
if (plainText == null || secretKeyBytes == null || ivBytes == null) {
return null;
}
SecretKeySpec keySpec = new SecretKeySpec(secretKeyBytes, AES);
IvParameterSpec ivSpec = new IvParameterSpec(ivBytes);
Cipher cipher = Cipher.getInstance(AES_TRANSFORMATION); cipher.init(Cipher.ENCRYPT_MODE,
keySpec, ivSpec);
byte[] encryptedBytes = cipher.doFinal(plainText.getBytes(CHARSET_NAME));
return Base64.getEncoder().encodeToString(encryptedBytes);
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
Sample code of decryption
public String decrypt(String base64CipherText, byte[] secretKeyBytes, byte[] ivBytes) { try {
if (base64CipherText == null || secretKeyBytes == null || ivBytes == null) {
return null;
}
SecretKeySpec keySpec = new SecretKeySpec(secretKeyBytes, AES); IvParameterSpec
ivSpec = new IvParameterSpec(ivBytes);
Cipher cipher = Cipher.getInstance(AES_TRANSFORMATION); cipher.init(Cipher.DECRYPT_MODE,
keySpec, ivSpec);
byte[] decryptedBytes =
cipher.doFinal(Base64.getDecoder().decode(base64CipherText));
return new String(decryptedBytes, CHARSET_NAME);
} catch (Exception e) {
e.printStackTrace(); return
null;
}
}
Algorithm: RSA Transformation: RSA/ECB/PKCS1Padding Encoding: UTF-8 Cipher Text Format: Base64
RSA (Rivest–Shamir–Adleman) is an asymmetric encryption algorithm commonly used to:
In our integration, RSA is used for decryption on the server side using a private key, while encryption is performed on the client side using the corresponding public key.
RSA encryption is used to securely transfer sensitive information (such as encrypted messages or symmetric keys) from the client to the server.
This document explains how the NCL data is decrypted on our side using RSA.
Transformation Explanation
RSA Key Pair
| Key Type | Usage |
|---|---|
| Public Key | Used by NCL to encrypt data |
| Private Key | Used by Memberss to decrypt data |
Key Size
i. Receive Base64-encoded encrypted data from client ii. Decode Base64 string into byte array iii. Initialize RSA cipher using private key iv. Decrypt encrypted bytes v. Convert decrypted bytes to UTF-8 string
private static final String RSA_TRANSFORMATION = "RSA/ECB/PKCS1Padding";
@Override
public String decrypt(String base64Encrypted, PrivateKey privateKey) { try {
// Initialize RSA cipher
Cipher cipher = Cipher.getInstance(RSA_TRANSFORMATION);
cipher.init(Cipher.DECRYPT_MODE, privateKey);
// Decode Base64 and decrypt
byte[] encryptedBytes = Base64.getDecoder().decode(base64Encrypted);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
// Return decrypted string
return new String(decryptedBytes, "UTF-8");
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
The client must ensure:
Any mismatch will result in decryption failure.
NOTE: Members must strictly follow the same algorithm, padding, encoding, and data format for successful integration for both the algorithms.
1. What is the minimum key length?
Minimum key length should be 2048 bits
2. What should be the subject/addtext Syntax?
Use the following subject syntax while generating the certificate C= ST= L= O= OU= CN=
3. What should be the certificate format and extension?
Certificate should be X.509 format. PEM encoded with ’.pem’ file extension
4. Whether self-signed certificate is acceptable?
Recommend using CA signed certificate.
5. What should be the maximum expiry period?
Expected expiry period will be one year.
*** End of Document ***
Margin Equities (CM/SLB)
Version 1.1
The NSE Clearing Limited (National Clearing) Exchange Plaza, Plot No. C/1, G Block, Bandra-Kurla Complex, Bandra (E), Mumbai - 400 051
NSE Clearing Confidential
Notice
© Copyright NSE Clearing Ltd (NCL). All rights reserved. Unpublished rights reserved under applicable copyright and trades secret laws.
The contents, ideas and concepts presented herein are proprietary and confidential. Duplication and disclosure to others in whole, or in part is prohibited
| Date | Change Description | Edited By | Version |
|---|---|---|---|
| 22-Jan-2026 | Initial version | 1.0 | |
| 06-Jun-2026 | New endpoints added | 1.1 |
Revision History ......................................................................................................................................2 Introduction ............................................................................................................................................4 General Instructions............................................................................................................................4 HTTP Status Codes..............................................................................................................................4 Common Error Response JSON.......................................................................................................5 Segment Environment Details ............................................................................................................5 CM Segment....................................................................................................................................5 SLB Segment....................................................................................................................................5 API Consumer Registration .................................................................................................................6 API Security .........................................................................................................................................6 Clearing Corporation APIs.......................................................................................................................7 POST //request/token.....................................................................................................7 POST //request/cm-margins...........................................................................................9 POST //request/tm-margins..........................................................................................12 POST //request/cli-margins...........................................................................................16 POST //request/security-margin...................................................................................19 POST //request/settlement-margin..............................................................................24 POST //request/cli-margins/generate-all......................................................................27 POST //request/cli-margins/inquiry..............................................................................29 POST //request/security-margin/generate-all..............................................................31 POST //request/security-margin/inquiry ......................................................................33 POST //request/settlement-margin/generate-all.........................................................35 POST //request/settlement-margin/inquiry .................................................................37 APIs Rate Limit ......................................................................................................................................39 Appendix A - Response Codes...............................................................................................................39 HTTP response code..........................................................................................................................39 Message based response code .........................................................................................................40 Sample example for success or failure code.....................................................................................41
This document provides information on the Web APIs used for programmatic access margin and positions related data between NCL’s MARGINS Platform and its Members. It details the messaging protocols and structures required to develop this interface.
All URLs for API will be always in lower case.
All JSON field names will follow camel-hump style of naming. A field with multiple words would be concatenated without spaces. All characters will be in lower case. First characters of words other than the first word in the field name will be in upper case. For e.g. field for “Order Number” could be represented by field name “orderNumber”. Other examples are “firstName”, “lastName”.
In case of JSONs representing an object or a key-value pair, keys with null values could be omitted from the JSON.
All APIs will respond with an HTTP status code. A status code of 200 would indicate successful execution of the API and the response body would be as defined in the API specification.
In case of an error a HTTP status code other than 200 will be returned. The API may or may not return an error response JSON depending upon the type of error encountered. Following are the HTTP status codes that could be returned by the APIs
| # | Status Code | Reason | Description |
|---|---|---|---|
| 1 | 200 | SUCCESS | Request was handled successfully |
| 2 | 400 | BAD REQUEST | Indicates a validation / business logic error / json parsing errors |
| 3 | 401 | UNAUTHORIZED: Failed to authenticate the request | Indicates that the credentials / access token shared for authentication is invalid or expired. |
| 4 | 404 | NOT FOUND | Incorrect URL or Resource does not exist |
| 5 | 405 |
Common Error Response JSON
| Field | Type | Mandatory | Description |
|---|---|---|---|
| code | Number | Yes | Http Status Code. See above |
| messages | List | Yes | One or more error messages |
CM Segment Base URL of RISK and Margin Management API endpoints mentioned in this document will be as follows:
Testing Environment: https://uat.connect2nsccl.com/Margins-CM-API/ Live Environment: https://www.connect2nsccl.com/ Margins-CM-API/
SLB Segment Base URL of RISK and Margin Management API endpoints mentioned in this document will be as follows:
Testing Environment: https://uat.connect2nsccl.com/Margins-SLB-API/ Live Environment: https://www.connect2nsccl.com/ Margins-SLB-API/
To initiate data consumption through the API endpoints, members are required to submit necessary information, including their IP address and registered email address, to NCL. Additionally, members must provide their public key certificates to NCL to enable payload encryption. The public key should be generated using the RSA algorithm and comply with the X.509 standard to ensure compatibility. Once this information is received, the member will be registered for API access and provided with a Consumer Key and Secret.
OAuth 2.0, an industry-standard authorisation protocol, is employed to facilitate access to API endpoints. Members can generate bearer tokens through the designated API call (refer to details below). The token response payload's data field will be asymmetrically encrypted using the Member’s Public Key Certificate with the RSA algorithm. This encrypted payload will be delivered as a Base64- encoded string.
Furthermore, an AES secret key and IV unique to the member will be included within the access token payload and retained by both NCL and the member. This will serve to enable secure encryption and decryption of API payloads.
This chapter gives details of the API’s exposed by clearing corporation and to be consumed by members.
To obtain a token, the member's consumer app must request for the access token using API POST //request/margin-token endpoint. The access token can be reused to access NCL API data until it expires (after 'n' minutes). During API registration, the member receives a consumer key and secret, which are validated for token authorization. The access token payload also contains aes_secret_key and aes_iv required to decrypt response payloads.
Request
Get Token Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | The format should be as follows: Basic <member_credentials> Here, member_credentials refers to a base64-encoded string consisting of the following data: cons_key:cons_secret | Basic MRZmwzCl6.............SGqlCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | grant_type | String | Value MUST be set to "client_credentials". | client_credentials |
Sample Request
UAT URL sample: https://uat.connect2nsccl.com/Margins-CM-API/v2/request/token https://uat.connect2nsccl.com/Margins-SLB-API/v2/request/token
POST /v2/request/token HTTP/1.1
Host: uat.connect2nsccl.com
Content-Type: application/x-www-form-urlencoded
Authorization: Basic MRZmwzCl6.............SGqXlCaxH9rAM3hVlMJzFg==
nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3
x-www-form-urlencoded
grant_type=client_credentials
Response The response's data field includes the encrypted token response payload as a Base64-encoded string. To access the raw token payload, first decode the Base64 data string, then decrypt the
resulting bytes using the Member private key associated with the public certificate provided during the API Consumer Registration process.
Success Response Sample
HTTP/1.1 200 OK
Content-Type: application/json
{
"data":
"GHzovnrYUaw6X8J9GE1vfLLIgb6b/KIVp6B0uKttHP91FlFNEpEZIMI43eWMcyOUEsvqr5fj
4snHA125K8++8U/RtCYC7r3bW+2U/P6J/nG2qNtFGRoM1Koc0KVMcFgNptJC6BK2Bs6Fo44KA
OtJ97NBlf9R0/WPxJy3dqi2A6zXo9tqn22JfgaFq/2JWZT0kX1grGkBEJZZImUiA0+ftpV3Jf
qrnYwZAtCr+cM7nbhab8Mri8cWBeHNG1pAlU/A1jcDvar5/NTdMDSClmkuw7ngXQpnOFX1mP1
AlTAYLHOTnuau3KoE653lze2+ruleMuk9ceIEuL+vahYqtZfz7w=="
}
Failure Response Sample
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"messages":{"code":"0100401”,
"status":"error"
}
Token Response Raw Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | access_token | String | The access token that is issued by the authorization server. | ee1073de-45d0-4040-b9c2-eddfa80280c0 |
| 2 | token_type | String | The type of the token issued. | Bearer |
| 3 | expires_in | int | The lifetime in seconds of the access token. For example, the value "3600" denotes that the access token will expire in one hour from the time the response was generated. | 3600 |
| 4 |
Sample output of the decrypted raw token payload in JSON format:
HTTP/1.1 200 OK
Content-Type: application/json
{
"access_token": "ee1073de-45d0-4040-b9c2-eddfa80280c0",
"token_type": "bearer",
"expires_in": "3600",
"scope":"api_scope"
"key":"aes_secret_key",
"iv": "aes_iv"
}
This API will allow members to inquire for margins using API POST //request/ cm-margins
Note: This API is not applicable for the SLB segment
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first request of the day, it should be (0000001). | XXXXX201310140000001 |
| 3 | data.memCode | String | Member code | XXXXX |
Sample Request
Request Header:
POST /v2/request/cm-margins HTTP/1.1
Host: uat.connect2nsccl.com
Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg==
consumerKey: consKey
nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3
Content-Type: application/json
Request Body:
{
"data":
"i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq
AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ
=="
}
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header, as well as the data parameter in the request body, are required to be AES-encrypted. When making an API call, the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Request Body:
{
"version": "2.0",
"data": {
"msgId": "XXXXX202509030000001",
"memCode": "XXXXX"
}
}
Response
Response Payload Structure (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | status | String | Response Status | success/error |
| 2 | messages | String | Refer to section “Message based response code” | |
| 3 | timeStamp | String | Date time stamp | 31 Dec 2025 14:11:58 |
Detail Record Structure (CSV) (Separator – “,”)
| # | Field Name | Description | Data Type | Size (In Byte) | Sample |
|---|---|---|---|---|---|
| 1 | memCode | Primary Member Code | String | 5 | XXXXX |
| 2 | cashCollateral | CM Cash Collateral (A) | Double | 8 | 409961019.00 |
| 3 | nonCashCollateral | CM Non-Cash Collateral (B) | Double | 8 |
Sample Failure Response
Wrong access token or expired access token
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"messages":{"code":"0101401"}
"status":"error"
}
Error in encryption
HTTP/1.1 400 BAD_REQUEST
Content-Type: application/json
{
"messages":{"code":"0101400"}
"status":"error"
}
The payload in the response to the API call will be AES-encrypted string. The Base64-encoded string of this encrypted value will be transmitted. Members should perform decryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Actual Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "SUCCESS"
"message": ""
"timeStamp": "17 Nov 2025 14:11:58"
"data":
"i1iw0PPNS0DJNSX8bswCpY65aWYSobTpBCR/UZAqacBiO8smQeHRa338+Ro7qGi8VOXSVzPC
EP04oXWHd/AjOozKTge2vO9WiOJdJY3VJVhdcwZL3Gj4tEbXi4vxft+SfJ9bRxyfh5kMHZXvc
lnC55mpkHca9fdgm8pKmT0SdnQsKMJ11GMUYxKQtDvdzQXyxWI4GY3f"
}
Response with Raw Data
{
"status": "SUCCESS"
"message": ""
"timeStamp": "31 Dec 2025 14:11:58"
"data": [
{
XXXXX,409961019.00,2717728.00,412678747.00,7098306.56,174917432.99,182015
739.55,44.10,0.00,7098306.56,0.00,,,,,, }
]
}
This API will allow members to inquire for margin using API POST //request/tm-margins
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first request of the day, it should be (0000001). | XXXXX201310140000001 |
| 3 | data.memCode | String | Primary Member Code/TM Code or Custodian | XXXXX |
Sample Request
Request Header:
POST /v2/request/tm-margins HTTP/1.1
Host: uat.connect2nsccl.com
Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg==
consumerKey: consKey
nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3
Content-Type: application/json
Request Body:
{
"data":
"i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq
AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ
=="
}
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header, as well as the data parameter in the request body, are required to be AES-encrypted. When making an API call, the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{
"version": "2.0",
"data": {
"msgId": "XXXXX202509030000001",
"memCode": "XXXXX"
}
}
Response
Response Payload Structure (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | status | String | Response Status | success/error |
| 2 | messages | String | Refer to section “Message based response code” | |
| 3 | timeStamp | String | Date time stamp | 31 Dec 2025 14:11:58 |
Detail Record Structure (CSV) (Separator – “,”)
| # | Field Name | Description | Data Type | Size(In Byte) | Sample |
|---|---|---|---|---|---|
| 1 | tm/CpCode | TM /CP Code | String | 12 | XXXXX |
| 2 | tm/CpName | TM /CP Name | String | 100 | Mr.ABC Ltd |
| 3 | cashCollateral | TM/CP Cash Collateral(A) | Double | 8 |
Sample Failure Response
Wrong access token or expired access token
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"messages":{"code":"0101401"},
"status":"error"
}
Error in encryption
HTTP/1.1 400 BAD_REQUEST
Content-Type: application/json
{
"messages":{"code":"0101400"},
"status":"error"
}
Sample Success Response
The payload in the response to the API call, will be AES-encrypted string. The Base64-encoded string of this encrypted value will be transmitted. Members should perform decryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Actual Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "SUCCESS",
"message": "",
"timeStamp": "17 Nov 2025 14:11:58",
"data":
"i1iw0PPNS0DJNSX8bswCpY65aWYSobTpBCR/UZAqacBiO8smQeHRa338+Ro7qGi8VOXSVzPC
EP04oXWHd/AjOozKTge2vO9WiOJdJY3VJVhdcwZL3Gj4tEbXi4vxft+SfJ9bRxyfh5kMHZXvc
lnC55mpkHca9fdgm8pKmT0SdnQsKMJ11GMUYxKQtDvdzQXyxWI4GY3f"
}
Response with Raw Data for CM Segment
{
"status": "SUCCESS",
"message": "",
"timeStamp": "17 Nov 2025 14:11:58",
"data": [
{ XXXXX,Mr.ABC Ltd,5000000.00,500000.00,5500000.00,1150000.00,
2000000.00,0.00,0.00,3150000.00,57.28,137979.44,50000.00,100000.00,100000
0.00,,,,,,,, }
]
}
Response with Raw Data for SLB Segment
{
"status": "SUCCESS",
"message": "",
"timeStamp": "17 Nov 2025 14:11:58",
"data": [
{ XXXXX,Mr.ABC Ltd,5000000.00,500000.00,5500000.00,1150000.00,
2000000.00,0.00,,3150000.00,57.28,,,,,550000.00,600000.00,,,,,, }
]
}
This API will allow members to inquire for margin using API POST //request/client-margins
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first request of the day it should be (0000001). | XXXXX201310140000001 |
| 3 | data.memCode | String | Member code | XXXXX |
| 4 | data.cliList |
Sample Request
Request Header:
POST /v2/request/cli-margins HTTP/1.1
Host: uat.connect2nsccl.com
Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg==
consumerKey: consKey
nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3
Content-Type: application/json
Request Body:
{
"data":
"i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq
AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ
=="
}
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{
"version": "2.0"
"data": {
"msgId": "XXXXX202509030000001",
"tmCode": "XXXXX"
“cliList”: [“CLI0000000”]
}
}
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Response Payload Structure (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Status | String | Response Status | success/error |
| 2 | Messages | String | Refer to section “Message based response code” | |
| 3 | timestamp | String | Date time stamp | 31 Dec 2025 14:11:58 |
Detail Record Structure (CSV) (Separator – “”)
| # | Field Name | Description | Data Type | Size (In Byte) | Sample |
|---|---|---|---|---|---|
| 1 | memCode | CM-Primary Member Code SLB-NA | String | 5 | XXXXX |
| 2 | memName | CM-Primary Member Code SLB-NA | String | 100 | Mr.XYZ Ltd |
| 3 | tmCode | TM Code | String | 5 |
Sample Failure Response
Wrong access token or expired access token
HTTP/1.1 401 UNAUTHORIZED
Content-Type: application/json
{
"messages":{"code":"0101401"}
"status":"error"
}
Error in encryption
HTTP/1.1 400 BAD_REQUEST
Content-Type: application/json
{
"messages":{"code":"0101400"}
"status":"error"
}
Sample Success Response
The payload in the response to the API call will be AES-encrypted string. The Base64-encoded string of this encrypted value will be transmitted. Members should perform decryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Actual Response
HTTP/1.1 200 OK
Content-Type: application/json
{
"status": "SUCCESS"
"message": ""
"timeStamp": "17 Nov 2025 14:11:58"
"data":
"i1iw0PPNS0DJNSX8bswCpY65aWYSobTpBCR/UZAqacBiO8smQeHRa338+Ro7qGi8VOXSVzPC
EP04oXWHd/AjOozKTge2vO9WiOJdJY3VJVhdcwZL3Gj4tEbXi4vxft+SfJ9bRxyfh5kMHZXvc
lnC55mpkHca9fdgm8pKmT0SdnQsKMJ11GMUYxKQtDvdzQXyxWI4GY3f"
}
Response with Raw Data for CM Segment
{
"status": "SUCCESS"
"message": ""
"timeStamp": "31 Dec 2025 14:11:58"
"data": [
{
XXXXX,Mr.XYZLtd,XXXXX,Mr.ABCLtd,CLI0000000,409961019.00,2717728.00,90766.
86,67952.71,4645.80,,,163365.37,179492210.21,1214188.00,153762.96,,,,,,
}
]
}
Response with Raw Data for SLB Segment
{
"status": "SUCCESS"
"message": ""
"timeStamp": "31 Dec 2025 14:11:58"
"data": [
{
,,XXXXX,Mr.ABCLtd,CLI0000000,409961019.00,2717728.00,,,,0.00,163365.37,16
3365.37,179492210.21,1214188.00,153762.96,,,,,, }
]
}
This API will allow members to inquire security margin using API POST //request/security margin.
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first request of the day, it should be (0000001). | XXXXX201310140000001 |
| 3 | data.memCode | String | Member code | XXXXX |
| 4 | data.cliList |
Sample Request
Request Header:
POST /v2/request/security-margin HTTP/1.1
Host: uat.connect2nsccl.com
Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg==
consumerKey: consKey
nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3
Content-Type: application/json
Request Body:
{
"data":
"i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq
AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ
=="
}
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{
"version": "2.0"
"data": {
"msgId": "XXXXX202509030000001"
"memCode": "XXXXX"
“cliList”: [“CLI0000000”]
}
}
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Response Payload Structure (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | status | String | Response Status | success/error |
| 2 | messages | String | Refer to section “Message based response code” | |
| 3 | timeStamp | String | Date time stamp | 31 Dec 2025 14:11:58 |
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 31 Confidential
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Multipart File
Complete data stream of the file contents.
Sample Failure Response
Wrong access token or expired access token HTTP/1.1 401 UNAUTHORIZED Content-Type: application/json { "messages":{"code":"0100401"}, "status":"error" }
Error in encryption HTTP/1.1 400 BAD_REQUEST Content-Type: application/json { "messages":{"code":"0100400"}, "status":"error" }
POST //request/security-margin/generate-all This API will allow members to generate all the client’s security margins for the respective member.
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 32 Confidential
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first request of the day it should be (0000001). Note: The ‘msgId’ provided will be used as a response during identifying the record in Inquiry API. POST //request/security-margin/inquiry | XXXXX201310140000001 |
Sample Request
Request Header: POST /v2/request/security-margin/generate-all HTTP/1.1 Host: uat.connect2nsccl.com Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== consumerKey: consKey nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3 Content-Type: application/json
Request Body: { "data": "i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ ==" }
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{ "version": "2.0" "data": { "msgId": "XXXXX202509030000001" } }
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 33 Confidential
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Response Data Payload (JSON)
| Sr. No. | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | status | String | Response status | success/error |
| 2 | messages.success | String | Message | Request submitted successfully |
| 3 | data.code | String | Refer Section “Message based response code”. | 01010000 |
{ "status": "Success", "messages": { "success": " Request submitted successfully." }, "data": { "code": "01010000" } }
POST //request/security-margin/inquiry This API will allow members to download the generated file of all the client’s security margins for the respective member.
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 34 Confidential
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | This message id should be match with message id provided in POST//request/security-margin/generate-all | XXXXX201310140000001 |
Sample Request
Request Header: POST /v2/request/security-margin/inquiry HTTP/1.1 Host: uat.connect2nsccl.com Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== consumerKey: consKey nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3 Content-Type: application/json
Request Body: { "data": "i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ ==" }
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{ "version": "2.0" "data": { "msgId": "XXXXX202509030000001" } }
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Multipart File
Complete data stream of the file contents.
Sample Failure Response
Wrong access token or expired access token
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 35 Confidential
HTTP/1.1 401 UNAUTHORIZED Content-Type: application/json { "messages":{"code":"0100401"}, "status":"error" }
Error in encryption HTTP/1.1 400 BAD_REQUEST Content-Type: application/json { "messages":{"code":"0100400"}, "status":"error" }
POST //request/settlement-margin/generate-all This API will allow members to generate all the client’s settlement margins for the respective member.
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | Unique request number for each request Member Code (Length: 4 or 5) • YYYYMMDD – Date format • nnnnnnn – Running sequence no. starting from one i.e. For first | XXXXX201310140000001 |
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 36 Confidential
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| request of the day it should be (0000001). Note: The msgId provided is used as a response during identifying the record in Inquiry API. POST//request/settlement-margin/inquiry |
Sample Request
Request Header: POST /v2/request/settlement-margin/generate-all HTTP/1.1 Host: uat.connect2nsccl.com Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== consumerKey: consKey nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3 Content-Type: application/json
Request Body: { "data": "i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ ==" }
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{ "version": "2.0" "data": { "msgId": "XXXXX202509030000001" } }
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Response Data Payload (JSON)
| Sr. No. | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | status | String | Response status | success/error |
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 37 Confidential
| Sr. No. | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 2 | messages.success | String | Message | Request submitted successfully |
| 3 | data.code | String | Refer Section “Message based response code”. | 01010000 |
{ "status": "Success", "messages": { "success": " Request submitted successfully." }, "data": { "code": "01010000" } }
POST //request/settlement-margin/inquiry This API will allow members to download the generated file of all the client’s settlement margins for the respective member.
Request
Request Header Parameters
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Authorization | String | Bearer token encrypted using the AES received as part of token response. <access_token> | Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== |
| 2 | nonce | String | A nonce uniquely identifies each server request. It should be a base64-encoded string in the format: ddMMyyyyHHmmssSSS:<6-digit random number>. | MjAwMTIwMTcxNjEyMjE1OTE6 |
| 3 | consumerKey | String | The Member Consumer Key received as part of API Registration process. | consKey |
Request Body Payload (JSON)
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| 1 | Version | String | API version | 2.0 |
| 2 | data.msgId | String | This message id should be match with message id provided in | XXXXX201310140000001 |
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 38 Confidential
| # | Parameter Name | Data Type | Description | Sample Value |
|---|---|---|---|---|
| POST//request/settlement-margin/generate-all |
Sample Request
Request Header: POST /v2/request/settlement-margin/inquiry HTTP/1.1 Host: uat.connect2nsccl.com Authorization: Bearer MRZmwzdkje382jdw8ue93jdCaxH9rAM3hVlMJzFg== consumerKey: consKey nonce: MjAwMTIwMTcxNjEyMjE1OTE6ODk0MjY3 Content-Type: application/json
Request Body: { "data": "i3fJhLKZHhGdanX8csAP4sfqaXse/PO2ek84FMMocd8hLMVgHuOQREft6QsruHisVrqTBjDq AL4guyyVLLV3RNrYRRa3uuhRj+BdJI7UJE……………………A6dy/yJaem0qa40X+5iUvteGpQ7BIpQ ==" }
Sample output of the decrypted request body payload data in JSON format:
The access token in the Authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be used. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
{ "version": "2.0" "data": { "msgId": "XXXXX202509030000001" } }
The access token in the authorization header as well as the data parameter in the request body are required to be AES-encrypted. When making an API call the Base64-encoded string of these encrypted values must be transmitted. Members should perform encryption using the AES secret key and IV provided at the time of token generation alongside the access token.
Response
Multipart File
Complete data stream of the file contents.
Sample Failure Response
Wrong access token or expired access token HTTP/1.1 401 UNAUTHORIZED Content-Type: application/json { "messages":{"code":"0100401"},
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 39 Confidential
"status":"error" }
Error in encryption HTTP/1.1 400 BAD_REQUEST Content-Type: application/json { "messages":{"code":"0100400"}, "status":"error" }
APIs Rate Limit Following rate limit will be applicable for respective API end point.
| # | API End Point | Rate Limit in seconds/request |
|---|---|---|
| 1 | POST //request/token | 60 |
| 2 | POST //request/cm-margins | 10 |
| 3 | POST //request/tm-margins | 10 |
| 4 | POST //request/cli-margins | 10 |
| 5 | POST //request/security-margin | 10 |
| 6 | POST //request/settlement-margin | 10 |
| 7 | POST //request/cli-margins/generate-all |
Appendix A - Response Codes There can be two types of response codes
HTTP response code
HTTP response codes are as follows:
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 40 Confidential
HTTP Response Codes
| Sr. No. | Reason | Meaning | HTTP Response Code |
|---|---|---|---|
| 1 | SUCCESS | Request was handled successfully | 200 |
| 2 | UNKNOWN_ERROR | Internal Server Error: Internal server error has occurred in our platform | 500 |
| 3 | SVC_UNAVAILABLE | The server is currently unable to handle the request due to a temporary overloading or maintenance of the server | 503 |
| 4 | METHOD_NOT_ALLOWED | Unsupported HTTP method: A request was made for a resource using a request method not supported by that resource (e.g. using POST instead of GET) | 405 |
| 5 |
Message based response code
Field Identifier is as follows:
| Sr. No. | Module | Field Name | Field Identifier |
|---|---|---|---|
| 1 | Entire Message | NA | 0101 |
| 2 | Input Data Parameter | msgId | 0102 |
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 41 Confidential
| Sr. No. | Module | Field Name | Field Identifier |
|---|---|---|---|
| 3 | Input Data Parameter | memCode | 0114 |
| 4 | Input Data Parameter | cliList | 0115 |
Validation codes are as follows:
| Sr. No. | Validation | Validation Type | Validation Code | Validation performed on Field |
|---|---|---|---|---|
| 1 | Submitted to server successfully | Message Level | 0000 | Entire Message |
| 2 | Duplicate request received | Message Level | 0001 | Entire Message |
| 3 | All HTTP status codes | HTTP error codes | HTTP Response codes. Refer section “HTTP Response Code”. | Entire Message |
| 4 | Mismatch in control and data record |
Sample example for success or failure code
Example for Generic Error Code Let’s assume that msgId field holds value ABCD201340402132165, which turns out to be an error “Invalid Data Format”. Error Code that will be generated is as shown below: Field Identifier: 0102 Validation Code: 0206
code = combination of “Field Identifier” and “Validation Code” = 01020206
Example for Success code (Submitted to server successfully) Let’s assume that message for approval/rejection is successful, success code that will be generated is as shown below:
Margin Equities – Protocol for Web API for Members Version: 1.1
NSE Clearing Page 42 Confidential
Field Identifier: 0101 (which is the identifier of the entire message) Validation Code: 0000
code = combination of “Field Identifier” and “Validation Code” =01010000
Example for HTTP error code Let’s assume that the invalid request scenario due to UNAUTHORIZED Access Request, error code that will be generated is as shown below:
Field Identifier: 0101 (which is the identifier of the entire message) Validation Code: 401
code = combination of “Field Identifier” and “Validation Code” =0101401
Note: For HTTP error code the above code will not be valid for every response. It will be valid only if there is an error in request header other than this it will populate HTTP code only.
*** End of Document ***
Research the source law
This record is not yet linked to a specific provision. Browse the law library, choose the affected provision and ask against the exact statutory text.
Browse source laws| METHOD_NOT_ALLOWED |
| Unsupported HTTP Method: A request was made for a resource using a request method not supported by that resource (e.g. using GET instead of POST). |
| 6 | 500 | UNKNOWN_ERROR | Internal Server Error. Such errors are to be reported to the support desk. |
| 7 | 503 | SVC_UNAVAILABLE | Service unavailable. |
| Scope |
| String |
| If identical to the scope requested by the client otherwise, REQUIRED. |
| api_scope |
| 5 | key | String | aes_secret_key and aes_iv collectively used to encrypt and decrypt further API request-response |
| 6 | iv | String | aes_secret_key and aes_iv collectively used to encrypt and decrypt further API request-response |
| 2717728.00 |
| 4 | effeDeposit | Effective Deposit (C =(A+MIN (A, B)) | Double | 8 | 412678747.00 |
| 5 | propMargin | Prop Margin (D = H+I+J) | Double | 8 | 7098306.56 |
| 6 | tmMargin | TM Margin (E) >90% | Double | 8 | 174917432.99 |
| 7 | totalMargin | Total Margin (F= D+E) | Double | 8 | 182015739.55 |
| 8 | Utilization | Utilization % (G=F/C) | Double | 8 | 44.10 |
| 9 | mtmLoss | MTM Loss (PROP) (H) | Double | 8 | 0.00 |
| 10 | tradeMargin | Trade Margin (PROP) (I) | Double | 8 | 7098306.56 |
| 11 | Icmtm | ICMTM (PROP) (J) | Double | 8 | 0.00 |
| 12 | Filler1 | Filler | Double | 8 |
| 13 | Filler2 | Filler | Double | 8 |
| 14 | Filler3 | Filler | Double | 8 |
| 15 | Filler4 | Filler | String | 100 |
| 16 | Filler5 | Filler | String | 100 |
| 17 | Filler6 | Filler | String | 100 |
| 5000000.00 |
| 4 | nonCashCollateral | Non-Cash Collateral(B) | Double | 8 | 500000.00 |
| 5 | effectiveDeposit | Effective Deposit (C=A+MIN (A, B)) | Double | 8 | 5500000.00 |
| 6 | propMargin | CM - Prop Margin(D=K+L+M) SLB – Prop Margin(D=N+O) | Double | 8 | 1150000.00 |
| 7 | cliMargin | CLI Margin>90%(E) | Double | 8 | 2000000.00 |
| 8 | nonCashBenTM | Non-cash Benefit TM(F) | Double | 8 | 0.00 |
| 9 | nonCashBenCM | CM - Non-cash Benefit CM(G) SLB -NA | Double | 8 | 0.00 |
| 10 | totalMargin | CM - Total margin(H=D+E-F-G) SLB – Total Margin(H=D+E-F) | Double | 8 | 3150000.00 |
| 11 | utilization | Utilization%(I=H/C) | Double | 8 | 57.28 |
| 12 | tm/CpMargin | CM - TM/CP Margin>90%(J) SLB - NA | Double | 8 | 137979.44 |
| 13 | mtmLoss | CM - MTM Loss (PROP) (K) SLB – NA | Double | 8 | 50000.00 |
| 14 | Icmtm | CM - ICMTM (PROP) (L) SLB - NA | Double | 8 | 100000.00 |
| 15 | tradeMargin | CM - Trade Margin (PROP) (M) SLB - NA | Double | 8 | 1000000.00 |
| 16 | firstLegMargin | CM – NA SLB - Margin on First Leg (N) | Double | 8 | 550000.00 |
| 17 | reverseLegMargin | CM – NA SLB - Margin on Reverse Leg (O) | Double | 8 | 600000.00 |
| 18 | Filler1 | Filler | Double | 8 |
| 19 | Filler2 | Filler | Double | 8 |
| 20 | Filler3 | Filler | Double | 8 |
| 21 | Filler4 | Filler | String | 100 |
| 22 | Filler5 | Filler | String | 100 |
| 23 | Filler6 | Filler | String | 100 |
| JSON |
| Array of client code. Max 50000 records allowed per messageID. |
| [“CLI0000000”] |
| XXXXX |
| 4 | tmName | TM Name | String | 100 | Mr.ABC Ltd |
| 5 | cliCode | Client Code | String | 10 | CLI0000000 |
| 6 | cashCollateral | Cash Collateral(A) | Double | 8 | 409961019.00 |
| 7 | nonCashCollateral | Non-cash Collateral (B) | Double | 8 | 2717728.00 |
| 8 | mtmLoss | CM - MTM Loss (C) SLB – NA | Double | 8 | 90766.86 |
| 9 | tradeMargin | CM - Trade Margin (D) SLB – NA | Double | 8 | 67952.71 |
| 10 | Icmtm | CM - ICMTM (E) SLB – NA | Double | 8 | 4645.80 |
| 11 | marginOnFirstLeg | CM - NA SLB - Margin on First Leg (F) | Double | 8 | 0.00 |
| 12 | marginOnReverseLeg | CM - NA SLB - Margin on Reverse Leg (G) | Double | 8 | 163365.37 |
| 13 | totalMargin | CM - Total Margin (H=C+D+E) SLB – Total Margin (H= F+G) | Double | 8 | 163365.37 |
| 14 | cilMargin | Client Margin>90% | Double | 8 | 179492210.21 |
| 15 | cliExcessNoncash | 90% of CLI Excess Non-Cash | Double | 8 | 1214188.00 |
| 16 | eligibleNonCash | Eligible Non-Cash (Subject to extent of TM/CM excess cash) | Double | 8 | 153762.96 |
| 17 | Filler1 | Filler | Double | 8 |
| 18 | Filler2 | Filler | Double | 8 |
| 19 | Filler3 | Filler | Double | 8 |
| 20 | Filler4 | Filler | String | 100 |
| 21 | Filler5 | Filler | String | 100 |
| 22 | Filler6 | Filler | String | 100 |
| JSON |
| Array of client code. ‘N’ no of records allowed per messageID. ‘N’ is scalable. Note –Non mandatory field. This field is required to enquire the client level data. |
| [“CLI0000000”] |
| 300 |
| 8 | POST //request/cli-margins/inquiry | 10 |
| 9 | POST //request/security-margin/generate-all | 300 |
| 10 | POST //request/security-margin/inquiry | 10 |
| 11 | POST //request/settlement-margin/generate-all | 300 |
| 12 | POST //request/settlement-margin/inquiry | 10 |
| BAD REQUEST |
| PARAMETER_ABSENT – There’s a required parameter which is not present in the request |
| 400 |
| 6 | BAD REQUEST | DATA_INVALID – The data is not in correct format and not recognized by our system | 400 |
| 7 | BAD REQUEST | DATA_FORMAT_REJECTED – Unsupported Data format parameter value | 400 |
| 8 | UNAUTHORIZED: Failed to authenticate the request | CONSUMER_KEY_UNKNOWN – The provided Consumer Key (API key) is not registered in our system OR service is not registered | 401 |
| 9 | UNAUTHORIZED: Failed to authenticate the request | TOKEN_INVALID – The provided token is not registered in our system | 401 |
| 10 | UNAUTHORIZED: Failed to authenticate the request | UNAUTHORIZED: • Unauthorized requestor IP address • API access disabled | 401 |
| 11 | PERMISSION_DENIED | Subscriber has temporarily disallowed access to his private data | 403 |
| 12 | The requested URL was not found | The requested URL was not found | 404 |
| 13 | REQUEST_NOT_FOUND | Registered request not found | 570 |
| Message Level |
| 0200 |
| Entire Message |
| 5 | Minimum Required Length | Generic | 0201 | msgId |
| 6 | Maximum Required Length | Generic | 0202 | msgId |
| 7 | Mandatory field | Generic | 0204 | msgId, memCode, cliList |
| 8 | Data Format mismatch | Generic | 0206 | msgId, memCode, cliList |
| 9 | System Error | Generic | 0241 | NA |
| 10 | Service Unavailable | Generic | 0242 | NA |
| 11 | Request Parsing Error: Invalid Request Structure | Generic | 0243 | NA |
| 12 | No Data found | Generic | 0244 | msgId, memCode, cliList |
| 13 | File Generation In Progress | Generic | 0245 | NA |
| 14 | Max limit | Generic | 0246 | cliList |
| 15 | Rate Limit violation | Generic | 0247 | Entire Message |