Login
curl --request PUT \
--url https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login \
--header 'Content-Type: application/json' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--data '
{
"email": "<string>",
"currentPassword": "<string>"
}
'import requests
url = "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login"
payload = {
"email": "<string>",
"currentPassword": "<string>"
}
headers = {
"platform": "<platform>",
"uuid": "<uuid>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {platform: '<platform>', uuid: '<uuid>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', currentPassword: '<string>'})
};
fetch('https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'currentPassword' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"platform: <platform>",
"uuid: <uuid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("platform", "<platform>")
req.Header.Add("uuid", "<uuid>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login")
.header("platform", "<platform>")
.header("uuid", "<uuid>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["platform"] = '<platform>'
request["uuid"] = '<uuid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthentication
Login
Authenticate users and obtain access tokens for API requests
PUT
/
securitymanagement
/
login
Login
curl --request PUT \
--url https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login \
--header 'Content-Type: application/json' \
--header 'platform: <platform>' \
--header 'uuid: <uuid>' \
--data '
{
"email": "<string>",
"currentPassword": "<string>"
}
'import requests
url = "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login"
payload = {
"email": "<string>",
"currentPassword": "<string>"
}
headers = {
"platform": "<platform>",
"uuid": "<uuid>",
"Content-Type": "application/json"
}
response = requests.put(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {platform: '<platform>', uuid: '<uuid>', 'Content-Type': 'application/json'},
body: JSON.stringify({email: '<string>', currentPassword: '<string>'})
};
fetch('https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'email' => '<string>',
'currentPassword' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"platform: <platform>",
"uuid: <uuid>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login"
payload := strings.NewReader("{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("platform", "<platform>")
req.Header.Add("uuid", "<uuid>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login")
.header("platform", "<platform>")
.header("uuid", "<uuid>")
.header("Content-Type", "application/json")
.body("{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["platform"] = '<platform>'
request["uuid"] = '<uuid>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"email\": \"<string>\",\n \"currentPassword\": \"<string>\"\n}"
response = http.request(request)
puts response.read_bodyAuthenticate users with email and password to obtain JWT access and refresh tokens. This endpoint supports all user roles: MANAGER, AGENT, CASHIER, and CUSTOMER, etc.
Request Headers
string
default:"application/json"
required
Must be
application/jsonstring
default:"fincode"
required
Platform identifier. Use
fincodestring
default:"200"
required
Unique request identifier. Use
200Request Body
string
required
User’s email address registered in the system
string
required
User’s password (minimum 8 characters)
Code Examples
curl -X PUT "https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login" \
-H "Content-Type: application/json" \
-H "platform: fincode" \
-H "uuid: 200" \
-d '{
"email": "manager@yourcompany.com",
"currentPassword": "Password@1"
}'
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;
import com.google.gson.Gson;
import com.google.gson.JsonObject;
public class FinCodeLogin {
public static class LoginRequest {
public String email;
public String currentPassword;
public LoginRequest(String email, String password) {
this.email = email;
this.currentPassword = password;
}
}
public static class LoginResponse {
public String access_token;
public int expires_in;
public String refresh_token;
public User user;
public static class User {
public String id;
public String email;
public String role;
public String tenant_id;
public String[] permissions;
}
}
public static LoginResponse login(String email, String password) throws Exception {
HttpClient client = HttpClient.newHttpClient();
Gson gson = new Gson();
LoginRequest loginRequest = new LoginRequest(email, password);
String requestBody = gson.toJson(loginRequest);
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://{your-domain}.fincode.software/api/v6/services/securitymanagement/login"))
.header("Content-Type", "application/json")
.header("platform", "fincode")
.header("uuid", "200")
.PUT(HttpRequest.BodyPublishers.ofString(requestBody))
.build();
HttpResponse<String> response = client.send(
request,
HttpResponse.BodyHandlers.ofString()
);
if (response.statusCode() == 200) {
LoginResponse loginResponse = gson.fromJson(response.body(), LoginResponse.class);
System.out.println("Login successful!");
System.out.println("User Role: " + loginResponse.user.role);
System.out.println("Access Token: " + loginResponse.access_token);
return loginResponse;
} else {
throw new Exception("Login failed: " + response.body());
}
}
public static void main(String[] args) {
try {
LoginResponse response = login("manager@yourcompany.com", "Password@1");
String accessToken = response.access_token;
} catch (Exception e) {
e.printStackTrace();
}
}
}
Error Handling
Invalid Credentials (401)
Invalid Credentials (401)
Cause: Email or password is incorrectSolution:
- Verify email address is correct
- Check password is entered correctly
- Use password reset if forgotten
- Contact support if issue persists
Account Locked (403)
Account Locked (403)
Cause: Multiple failed login attemptsSolution:
- Wait for the lockout period to expire
- Contact your administrator to unlock the account
- Use the “Forgot Password” flow to reset password
User Not Found (404)
User Not Found (404)
Cause: Email address not registered in the systemSolution:
- Verify the email address
- Check if the user exists in your tenant
- Contact administrator to create the user account
Best Practices
Token Storage
- Store tokens securely (encrypted storage)
- Use environment variables for tokens
- Clear tokens on logout
Token Refresh
- Implement automatic token refresh
- Refresh before expiration (5 min buffer)
Error Handling
- Implement retry logic
- User-friendly messages
Security
- CSRF protection
- Set secure cookie flags
Testing in Sandbox
Use these test credentials in your sandbox environment:const testCredentials = {
manager: {
email: "manager@sandbox.fincode.software",
password: "Password@1",
},
agent: {
email: "agent@sandbox.fincode.software",
password: "Password@1",
},
cashier: {
email: "cashier@sandbox.fincode.software",
password: "Password@1",
},
customer: {
email: "customer@sandbox.fincode.software",
password: "Password@1",
},
};
These credentials only work in sandbox. Never use test credentials in
production.
