Skip to content

Digital Signature in requests

1. Each API method specifies which fields are used to generate the signature, as well as a hashing method (MD5 or SHA256).

2. After you select the required fields, you must sort them alphabetically (in ascending order).

3. Secret merchant key is added at the end.

4. Concatenation of all fields is performed through the “:” symbol without their names.

5. The line you received is hashed (using MD5 or SHA256 method) and its bytecode is encoded in Base64: sign = Base64(MD5(Implode(Sort(Params) + SecretKey, ':'), true)) or sign = Base64(SHA256(Implode(Sort(Params) + SecretKey, ':'), true))

Example of the signature for Payout Send request:
$data = [
    "merchant" => "M1VJDHSI6DYXS",
    "method" => 1,
    "payout_id" => "000002",
    "account" => "5300111122223333",
    "amount" => 1.19,
    "currency" => 'UAH',
];
$dataSet = $data;
ksort($dataSet, SORT_STRING);
array_push($dataSet, "SecRetKey0123");
$signString = implode(":", $dataSet);
$calc_sign = base64_encode(md5($signString, true));
$data["sign"] = $calc_sign;