General information

Obtaining an API key

The API key for accessing the REST service roskassa.net can be generated on the store settings page https://my.roskassa.net/shop-settings/
All data in requests to the ROSKASSA service are transmitted using the POST method over the HTTP protocol to the address https://api.roskassa.net/*method*. The message parameters are packed into a JSON object.
A signature must be sent along with the request. It is necessary to sign the request body in its entirety, in the form in which it is sent to the Bank's server (after serializing the request body to JSON for sending via HTTP ).
Each request must pass a nonce parameter different from the previous one! For example, you can use the current time in seconds
Use your private key to sign. Generate SHA-256 signature.
1
<?php
2
3
$api_key = 'EEFA1913EA9D9351469B1E5D852A';
4
5
$data = array(
6
'shop_id' =>'1913EA9D9351469B1E5D852A',
7
'nonce' => time(),
8
);
9
10
$body = json_encode($data);
11
$sign = hash_hmac('sha256', $body, $api_key);
12
13
14
$curl = curl_init();
15
16
curl_setopt_array($curl, array(
17
CURLOPT_URL => "https://api.roskassa.net/orders/",
18
CURLOPT_RETURNTRANSFER => true,
19
CURLOPT_CUSTOMREQUEST => "POST",
20
CURLOPT_POSTFIELDS =>$body,
21
CURLOPT_HTTPHEADER => array(
22
"Authorization: Bearer $sign",
23
"Content-Type: application/json"
24
),
25
));
26
27
$response = curl_exec($curl);
28
29
curl_close($curl);
30
echo $response;
Copied!
Last modified 5mo ago
Copy link