Skip to content

Basic Information

All requests must include the mid, salt, and sign parameters in the request body, as well as any additional parameters specified in the documentation for the specific method.

Base URL

https://severpay.io/api/merchant

Request Headers

NameValue
Content-Typeapplication/json

Request Body

NameTypeRequiredDescription
midintegerYesMerchant ID
saltstringYesRandomly generated string
signstringYesRequest signature

Signature generation algorithm:

  1. The signature is generated using the data array sent in the request body
  2. The array is sorted by keys
  3. The sign signature is calculated using HMAC-SHA256 based on the JSON representation of the array and the secret token key
  4. The signature is added to the array
php
$mid = 1;
$token = '041131a0906b08a5bebc1d4fdcc6d9';

$body = [
    'mid'  => $mid,
    'salt' => bin2hex(random_bytes(8)),
];

ksort($body);

$body['sign'] = hash_hmac(
    'sha256',
    json_encode($body, JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES),
    $token
);

Attention

The example shows only the required request body parameters. The signature must be generated based on the fully populated body, including all transmitted parameters.

SeverPay.io API Documentation