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 in sequence, as they can reduce the security overhead of repeatedly transmitting credentials while maintaining secure access to the Hyp platform.
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
Application integration: Integrate with systems that prefer session-based authentication patterns
Performance optimization: Potentially reduce authentication overhead for high-frequency API usage
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 API request to your assigned server endpoint with the getSessionId command in the int_in parameter.
Server Endpoints: Use the server endpoint provided during merchant onboarding (e.g., https://your-hyp-environment-url/xpo/Relay).
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
Required parameters
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 authenticationtransmitTerminal- Initiate transmissions with session authenticationRequest Structure - General API request format
Session Security: Session IDs should be treated as sensitive credentials. Store them securely and ensure they are not logged or exposed in error messages. Sessions may expire and require renewal.
Last updated
Was this helpful?