Skip to content
For the complete documentation index, see llms.txt. This page is also available as Markdown.

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:

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

Command parameters

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

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:

scopeCmd - The command permitted for this session

Type: String Required: No (unless validation or transactionType is specified) Description: Specifies the API command that this session identifier is authorized to execute (e.g., doDeal).

Valid Values: doDeal, addCgInvoice, cancelDeal, inquireInvoice, refundCgInvoice, refundDeal, transmitInquire, transmitTerminal

Example: doDeal

Usage Notes:

  • Limits the session to only perform the specified command

  • Mandatory if either validation or transactionType is provided in the scope

  • If omitted, the session may be used for any permitted command on the terminal

validation - The validation method permitted for this session

Type: String Required: No Description: Specifies the validation method that must be used when performing a transaction with this session (e.g., Normal).

Valid Values: AutoComm, Verify, Normal, Token, TxnSetup, AutoCommHold, AutoCommRelease

Example: AutoComm

Usage Notes:

  • Restricts the session to the specified validation type

  • If this parameter is specified, you must also specify scopeCmd

transactionType - The transaction type permitted for this session

Type: String Required: No Description: Specifies the transaction type that this session identifier is authorized to perform (e.g., Credit).

Valid Values: Debit, Credit, Forced, CashBack, Cash, RecurringDebit, BalanceEnquiry,Load, Discharge

Example: Credit

Usage Notes:

  • Restricts the session to the specified transaction type

  • If this parameter is specified, you must also specify scopeCmd

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?