Authentication
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 you begin, ensure you have the following resources:
- A valid Sign Key (shared by Nayax, typically 16 characters)
- The associated Sign Key ID
Your request body must contain the
SparkTransactionIdfield.
Authenticate Requests
Once you have the required resources, you can start authenticating your API requests to Spark by following the steps below:
- Combine the static string
IntegratorIdwith your ID in the following formatIntegratorId: {SignKeyID}. See the example below:IntegratorId: 927 - Join the
SparkTransactionIdfrom your request body with yourSign Key, separated by a semicolon (;), in the following format:SparkTransactionId;SignKey123456789123456789abcdefghijklmnopqr;RbtdDsiVNjkAeRty - Perform a SHA-256 hash on the resulting string using UTF-8 encoding. Resulting hash:
1b7dd1c4010698824de66f13e1387efc28a4bba00b720d4be8cdb3b598b9603e - The final header should look like the following:
TransactionSignature: 1b7dd1c4010698824de66f13e1387efc28a4bba00b720d4be8cdb3b598b9603e
Request Example (cURL)
See an example request for the /StartAuthentication endpoint:
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"
}'See Also
Updated about 3 hours ago