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.

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:

Parameter
Type
Description

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

terminalNumber - Your merchant terminal identifier

Type: String (Numeric, 10 digits) Required: Yes Description: The unique terminal number assigned during merchant onboarding

Example: 0882819014

Usage Notes:

  • Must match your assigned terminal number

  • Used for session identification and authorization scope

  • Available in your merchant dashboard

  • Session will be associated with this specific terminal

Response structure

Successful response

A successful getSessionId response contains the generated session identifier:

Key Response Fields:

  • result: 000 indicates successful session creation

  • sessionId: 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

Error Code
Description
Resolution

000

Permitted transaction

Session ID generated successfully

303

Gateway general error

Check request format and contact support if needed

308

Gateway general error

System error - retry or contact support

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

Session Usage: Once you have a session ID, use it in place of username/password by sending sessionId as a form parameter instead of user and password parameters.

Last updated

Was this helpful?