Skip to main content

LOGIN API

This API is used to authenticate users by validating their login credentials.

Upon successful full authentication, the API returns:

  • access_token — Must be included in the Authorization header of all subsequent API requests to authorize the user's session.
  • broadcast_access_token — Required to establish a connection with the market feed endpoint via the broadCastSocket URL provided in the response. Refer to the Price Feed API for detailed usage. The response also includes essential trading information such as allowed exchanges, supported product types, MPIN/fingerprint/TOTP registration status, and GTD configuration.

This API is a prerequisite for accessing all authenticated endpoints in the system.

🗝️Login Types and Second-Factor Authentication

The Login API supports a two-step authentication flow. On the first call, pass second_auth_type: "REGISTER" to validate the password and receive a register_token. Then use that token in a second call with login_type: "TOKEN" and the appropriate second-factor credential.

login_typepassword Field Valuesecond_auth_typesecond_auth Value
PASSWORDUser's passwordREGISTERNot required (leave empty)
TOKENregister_token from Step 1OTP / TOTP / FINGERPRINTOTP value / TOTP value / Registered UDID
PASSWORDUser's passwordOTP / TOTP / FINGERPRINTOTP value / TOTP value / Registered UDID
MPINRegistered MPINOTP / TOTP / FINGERPRINTOTP value / TOTP value / Registered UDID
TP_TOKENSSO token (external auth)Not requiredNot required

📝 Two-Step Authentication Flow

Step 1 — First login call (get available 2FA methods):

  • Set login_type: "PASSWORD", pass the user's password, and set second_auth_type: "REGISTER".
  • The API validates the password and returns a register_token along with the available second-factor methods (ptnType) and registration flags (mpin_enabled, fingerprint_enabled, totp_enabled).

Step 2 — Second login call (complete authentication):

  • Set login_type: "TOKEN", pass the register_token from Step 1 as the password field, and provide the chosen second-factor in second_auth_type and second_auth.
  • On success, the API returns the full access_token and trading data.

🔑Header Parameters

HeaderTypeDescriptionExample
Content-TypestringSpecifies the media type of the request payloadapplication/json
x-api-keystringAPI key used to authorize the requestx-api-key

📑Request Body Parameters

FieldTypeRequiredDescripitonExample/Enum
user_idstringYesUser ID (UCC) Provided to the user"UCC123456"
login_typestringOptionalSpecifies the login method. Determines which value is passed in the password field. Use TP_TOKEN when authentication is handled externally 9eg., via a Super APP)Default: "PASSWORD" Enum : PASSWORD, MPIN, FINGERPRINT, TP_TOKEN
passwordstringYesPassword, MPIN, UDID or SSO Token depending on the login_type selected."mypassword123"
second_auth_typestringOptionalType of secondary authentication selected by the user.User REGISTER on first login to register a second-factor method.Enum : OTP, TOTP, FINGERPRINT, REGISTER
second_authstringOptionalThe credential value for the selected secondary authentication type (e.g., OTP, TOTP,UDID)"123456"/"MyDeviceID"
api_keystringYesAPI Key provided by Synapsewave for authenticating the client application"xyz-api-key"
sourcestringYesIndicates the platform from which the user is logging inEnum : WEBAPI, MOBILEAPI
UDIDStringOptionalUnique Device ID of the user's device."device-12345-udid"
versionstringOptionalversion number for the Android application"2.1.0"
iosversionstringOptionalVersion number of the iOS application"3.0.5"
build_versionstringOptionalInternal build version of the application"build-45"
deviceinfoobjectOptionalAdditional information about the user's device (e.g., OS, model, etc){"os" : "Android", "model" : "Pixel 6"}

📘DeviceInfo Object Fields

FieldTypeDescriptionExample/ENUM
UDIDstringThe unique identifier for the device."123e4567-e89b-a456-426614174000"
DeviceModelstringThe model of the device from which the user has logged in."iPhone 12"
DeviceSerialNostringThe serial number of the device used for log in.SN1234567890
DeviceManufacturerstringThe manufacturer of the device used for login.Apple
DevicePlatformstringThe platform of the device used for loginWeb
DevicePlatformVerstringThe version of the platform (OS) on the device used for login.14.4
LongitudestringThe longitude coordinate of the device's location when logging in.77.5946
LatitudestringThe latitude coordinate of the device's location when logging in."12.9716"
AppNamestringThe name of the application being used for login.Wave 3.0
AppVersionstringThe version of the application used for login."1.2.3"
AppVersionCodestringThe version code of the application used for login."200000"
AppPackageNamestringThe package name of the application used for login (Android only).com.example.myapp
FCMRegKeystringThe Firebase Cloud Messaging (FCM) registration key for push notifications"172.25.90.82:8100
IPstringIP Address of the device used for login"192.168.1.1"
SDKVersionstringThe version of the software development kit (SDK) used for the application."30"

🟢 Step 1 Response — second_auth_type: "REGISTER" — 200 OK

When second_auth_type is REGISTER, the API validates the password but does not return an access_token yet. Instead it returns a register_token and the user's available 2FA options for use in Step 2.

Content-Type: application/json

FieldTypeDescriptionExample
statusstringStatus of the API call"success"
codestringResponse code"s-101"
messagestringSuccess message"User logged in Successfully."
dataobjectStep 1 response payloadRefer below

📦 Step 1 Data Object Fields

FieldTypeDescriptionExample
register_tokenstringTemporary JWT token to be passed as the password field in the Step 2 login call"eyJhbGciOiJIUzI1NiJ9..."
ptnTypestringIndicates the second-factor authentication methods available for this user"TOTP_OPT", "OTP", "FINGERPRINT"
mpin_enabledbooleanWhether the user has registered an MPINtrue / false
fingerprint_enabledbooleanWhether the user has registered a fingerprinttrue / false
totp_enabledbooleanWhether the user has registered a TOTP authenticatorfalse / true

Note on ptnType: This field indicates which second-factor methods are configured for the user. Use it to determine which second_auth_type to present to the user in Step 2. For example, "TOTP_OPT" means TOTP is available as an option.


🟢 Step 2 Response — Full Authentication — 200 OK

When second_auth_type is OTP, TOTP, or FINGERPRINT, and authentication succeeds, the API returns the full session payload including the access_token.

Content-Type: application/json

FieldTypeDescriptionExample
statusstringStatus of the API call"success"
codestringResponse code"s-101"
messagestringSuccess message"User logged in Successfully."
dataobjectFull session payload including token and user trading informationRefer to Data Object Fields

📦 Step 2 Data Object Fields

FieldTypeDescriptionExample
access_tokenstringJWT session token; must be passed in the Authorization header of all subsequent API calls"eyJhbGciOiJIUzI1NiJ9..."
user_idstringUser ID (UCC) of the authenticated user"APITEST"
alias_idstringAlias ID for the user; empty if not configured""
user_namestringDisplay name of the authenticated user"API TEST"
login_timestringTimestamp of the login (format: YYYY-Mon-DD HH:MM:SS)"2023-Sep-20 14:15:02"
exchangesstring[]List of exchange segments the user is permitted to trade on["NSE_EQ", "NSE_FO", "BSE_EQ", "MCX_FO", "NSE_OTS", "MUTUAL_FUND", ...]
bcastExchangesstring[]List of exchange segments the user can receive market feed data for["NSE_EQ", "NSE_FO", "BSE_EQ", "MCX_FO", ...]
product_typesstring[]All product types permitted for the user across all exchanges["INTRADAY", "DELIVERY", "COVER", "BRACKET", "MTF", "BTST"]
product_types_exchangeobjectProduct types permitted per exchange segment{"NSE_EQ": ["INTRADAY", "DELIVERY", "MTF", ...], "NSE_FO": ["INTRADAY", "DELIVERY", ...]}
mpin_enabledbooleanWhether the user has a registered MPINtrue / false
fingerprint_enabledbooleanWhether the user has a registered fingerprintfalse / true
totp_enabledbooleanWhether the user has a registered TOTP authenticatortrue / false
ptnTypestringSecond-factor methods available for this user (same as Step 1 response)"TOTP_OPT"
othersobjectAdditional configuration and socket connection detailsRefer to Others Object Fields

📦 Others Object Fields

FieldTypeDescriptionExample
userCodestringInternal user code assigned by the system"NWSYF"
groupIdstringGroup ID to which the user belongs"HO"
groupCodestringGroup code of the user's group"AAAAA"
newsCategoriesstringComma-separated news category IDs applicable to the user"25051,25039,25038,..."
messageSocketstringWebSocket endpoint for receiving interactive/system messages"wss://socketio-uat.example.com:8443"
broadCastSocketstringPrimary WebSocket endpoint for receiving real-time market feed data; use with bcastExchanges"wss://feed.example.com:4510"
secondBroadCastSocketstring[]Fallback WebSocket endpoints for market feed data["ws://feed2.example.com:4509"]
POAstringPower of Attorney status of the user. "0" = POA user, "2" = Non-POA user"0", "2"
nGTDDefaultintegerDefault number of days for GTD (Good Till Day) orders2
nGTDMaxDaysintegerMaximum number of days allowed for GTD orders365
sGTDConfigDetailsstringGTD configuration string in the format "defaultDays|maxDays""2|9"
ocTokenstringOC (Order Confirmation) token used for internal OMS communication"0x01C1DBD524FBF3C904..."
managerIPstringInternal OMS manager host address"Odindemo.63moons.com"
participantCodestringParticipant code for equity segment; empty if not applicable""
dervParticipantCodestringParticipant code for derivatives segment; empty if not applicable""
tslAllowedstring[]List of exchange segments on which TSL (Trailing Stop Loss) orders are permitted["NSE_EQ", "NSE_FO", "BSE_EQ", ...]
edisForMTFbooleanWhether EDIS (Electronic Delivery Instruction Slip) is applicable for MTF positionsfalse / true
showJumpPriceBothLtpAndTriggerPricebooleanWhether to show jump price for both LTP and trigger price in the UIfalse / true
CFTstringPipe-separated feature toggle configuration string indicating which platform features are enabled (1) or disabled (0) for this user"HEATMAP|1$ALERT|1$IPO|1$..."
passExpDaysstringHuman-readable message indicating when the user's password will expire"Your password will expire in 845 Day(s)."
bAMOAllowedForUserbooleanWhether the user is permitted to place AMO (After Market Orders)true / false