Authentication Version 2.0 (Recommended)
To ensure secure communication, every request sent by the Integrator must include two specific authentication headers. These headers verify your identity and ensure the integrity of the transaction data.
Prerequisites
Before beginning the integration, ensure you have the following credentials provided by Nayax:
- Sign Key: A secret 16-character string (e.g.,
RbtdDsiVNjkAeRty). - Sign Key ID: Your unique identifier (e.g.,
927).
Note: Your request body must contain the
SparkTransactionIdfield.
Required Headers
| Header Name | Value Description |
|---|---|
IntegratorId | Your pre-shared Sign Key ID. |
TransactionSignature | A SHA-256 hash of the SparkTransactionId and the Sign Key. |
Step-by-Step Construction
Step A: Prepare the Sign Key ID Header
Combine the static string "IntegratorId" with your ID.
- Format:
IntegratorId: {SignKeyID} - Example:
IntegratorId: 927
Step B: Generate the Transaction Signature
-
Concatenate Strings: Join the
SparkTransactionIdfrom your request body with yourSign Key, separated by a semicolon (;).- Format:
SparkTransactionId;SignKey - Example String:
123456789123456789abcdefghijklmnopqr;RbtdDsiVNjkAeRty
- Format:
-
Hash the String: Perform a SHA-256 hash on the resulting string using UTF-8 encoding.
- Resulting Hash:
1b7dd1c4010698824de66f13e1387efc28a4bba00b720d4be8cdb3b598b9603e
- Resulting Hash:
-
Final Header:
- Example:
TransactionSignature: 1b7dd1c4010698824de66f13e1387efc28a4bba00b720d4be8cdb3b598b9603e
- Example:
Request Example (cURL)
curl --location '[https://api.nayax.com/StartAuthentication](https://api.nayax.com/StartAuthentication)' \
--header 'IntegratorId: 927' \
--header 'TransactionSignature: 1b7dd1c4010698824de66f13e1387efc28a4bba00b720d4be8cdb3b598b9603e' \
--header 'Content-Type: application/json' \
--data '{
"TokenId": 116383,
"TerminalId": "0434334921100366",
"TerminalIdType": 1,
"Random": "123456789qwertyui",
"Cipher": "X305dITNTAw2vHsxE+taVcn6UvgBC3fdI6QbqeABgHbo8CKsoZhqISJfslehCiA+L7XYrqvKFci7C6BNj/tr zBuNJwBEjgBzKhhgpJ5ggnw=",
"SparkTransactionId": "123456789123456789abcdefghijklmnopqr"
}'Technical Guidelines
- Framework: Ensure you are using a modern, supported version of .NET (e.g., .NET 6, 7, or 8).
- Encoding: All string-to-byte conversions for hashing must use UTF-8.
- Hashing Algorithm: Use the standard
System.Security.Cryptography.SHA256class.
See Also
Updated 1 day ago