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/merchantRequest Headers
| Name | Value |
|---|---|
Content-Type | application/json |
Request Body
| Name | Type | Required | Description |
|---|---|---|---|
mid | integer | Yes | Merchant ID |
salt | string | Yes | Randomly generated string |
sign | string | Yes | Request signature |
Signature generation algorithm:
- The signature is generated using the data array sent in the request body
- The array is sorted by keys
- The sign signature is calculated using HMAC-SHA256 based on the JSON representation of the array and the secret token key
- 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.