Payment signature and sign errors
This page helps verify payment link signature generation and quickly troubleshoot error sign.
Signature algorithm
- Take parameters:
shop_id,amount,currency,order_id. - If you send
test=1, includetestin signature input too. - Sort keys (same as PHP
ksort). - Build query string like PHP
http_build_query. - Calculate:
md5(query + SECRET).
PHP reference example
<?php
$secret = 'YOUR_SECRET';
$data = [
'shop_id' => 'SHOP_HASH',
'amount' => '3000',
'currency' => 'RUB',
'order_id' => 'ef4c6d4e-660b-4ec8-b32a-31ea523ee758',
// 'test' => '1', // only if you really send test=1
];
ksort($data);
$query = http_build_query($data);
$sign = md5($query . $secret);
?>
Python example (server-compatible)
import hashlib
from urllib.parse import urlencode
def make_sign(params: dict, secret: str) -> str:
sorted_params = dict(sorted(params.items(), key=lambda x: x[0]))
query = urlencode(sorted_params) # compatible for standard scalar values
return hashlib.md5((query + secret).encode("utf-8")).hexdigest()
Common reasons for error sign
amountwas signed as3000but sent as3000.0(or vice versa).testwas included in signature but not sent in request (or vice versa).- Wrong secret or wrong shop ID is used.
- Different key order is used during signing.
- Unexpected fields are included in signature input.
Production diagnostics
The admin orders page includes a signature diagnostics panel now. You can filter by
shop_id and inspect recent sign-related failures.
Main payment creation docs: /docs/en/payments/create-payment/.