getSessionId
Overview
The getSessionId command generates a session identifier that can be used for authentication in subsequent API calls. This command provides an alternative authentication method to username/password credentials, allowing for session-based authentication in integration scenarios where maintaining a session is preferable to sending credentials with every request.
Session IDs are particularly useful for applications that make multiple API calls directly from remote clients like POS (קופה) software. Using a session ID allows a POS device to authenticate with a temporary session while the username and password are safely secured in the POS back-office. Additionally, you can determine the scope of the session by setting specific values for fields like command, validation, and transactionType — limiting what operations the session is permitted to perform.
Use cases
Session-based authentication: Establish a session for API calls without repeatedly sending username/password. The generated identifier is single-use and valid for 10 minutes. To perform additional actions, a new sessionId request must be made each time.
Security enhancement: Reduce credential exposure by using temporary session tokens. You can also limit the session's scope by restricting it to specific commands, validation types, and transaction types (see Scope parameters).
Application integration: Integrate with systems that prefer session-based authentication patterns
Temporary access: Provide time-limited access tokens for specific operations
Third-party integration: Enable secure API access for partner systems without sharing permanent credentials
Request structure
For a comprehensive overview of the API request format and authentication, see API Request & Response General Structure.
Send a standard Hyp Enterprise API request to your assigned server endpoint with the getSessionId command in the int_in parameter.
HTTP request format
The request must be sent as a POST request with application/x-www-form-urlencoded content type, containing three required body parameters:
user
string
Your merchant username for API authentication
password
string
Your merchant password for API authentication
int_in
string
XML payload containing the command and parameters (see structure below)
Example HTTP Request Body:
XML payload structure
Command parameters
Required parameters
Scope parameters
The scope parameter allows you to limit the operations that can be performed using the generated session ID. By defining a scope, you can use child parameters to restrict the session to a specific command, validation method, and/or transaction type. This makes sure that the session token is only used for its intended purpose.
Here's an example of a scope block that combines all three descendant parameters to limit the session to a specific transaction profile:
Response structure
Successful response
A successful getSessionId response contains the generated session identifier:
Key Response Fields:
result:000indicates successful session creationsessionId: The generated session identifier to use in subsequent API calls (UUID format)sessionExpiration: Session timeout in seconds (600 = 10 minutes)sessionReUse: Whether the session can be reused (1 = yes, 0 = no)
Error response
Error responses include specific error codes and messages:
Note: Even in error responses, the getSessionId element is included but with empty fields.
Code examples
Error codes
000
Permitted transaction
Session ID generated successfully
354
Gateway general error
Configuration issue - verify gateway settings
405
SSL HTTPS customers are not permitted to access the system
Authentication failure - verify username and password are correct
444
Gateway general error
Processing error - check request parameters
455
Merchant does not support session id
Terminal not configured for session support - contact support to enable
456
Merchant session timeout
Session has expired - generate a new session ID
457
Session id generation failed
Unable to create session - retry or check system status
Related commands
doDeal- Process transactions using session-based authenticationinquireTransactions- Query transactions using session ID instead of credentialstransmitTerminal- Initiate transmissions with session authenticationRequest Structure - General API request format
Last updated
Was this helpful?