# MD5 API Specification

# Request Method

API

Request Method: POST or GET

Content type: application/json

Character encoding: UTF-8

Signature algorithm: MD5

# Parameter Specifications

  • Transaction amount: The default is USD transaction, in cents, the parameter value cannot contain decimals.

  • Time parameters: All time parameters use 13-digit values ​​accurate to milliseconds, such as: 1622016572190. The timestamp specifically refers to the number of milliseconds from 00:00:00 GMT on January 1, 1970 to the present.

# Signature Algorithm

The general steps for signature generation are as follows

  1. Step 1: Assume all sent or received data is a set M, sort the parameters with non-empty parameter values ​​in the set M from small to large according to the ASCII code of the parameter name (lexicographic order), and use the URL key-value pair format (i.e. key1=value1&key2=value2...) to splice it into a string stringA. Pay special attention to the following important rules:

    • Parameter name ASCII codes are sorted from small to large (lexicographic order);
    • If the value of the parameter is empty, it will not participate in the signature;
    • Parameter names are case-sensitive;
    • When the verification call returns or the payment center actively notifies the signature, the transmitted sign parameter does not participate in the signature, and the generated signature is verified against the sign value;
    • The Payment Center API may add fields, and the added extended fields must be supported when verifying signatures.
  2. Step 2: Splice key [i.e. StringA +"&key=" + private key] at the end of stringA to obtain the stringSignTemp string, perform MD5 operation on stringSignTemp, and then convert all characters of the obtained string to uppercase to obtain the sign value signValue.

For example, the requested payment system parameters are as follows:

Map signMap = new HashMap<>();
signMap.put("platId", "1000");
signMap.put("mchOrderNo", "P0123456789101");
signMap.put("amount", "10000");
signMap.put("clientIp", "192.168.0.111");
signMap.put("returnUrl", "https://merchant.com/testReturn/p01");
signMap.put("notifyUrl", "https://merchant.com/testNotify/p01");
signMap.put("reqTime", "20190723141000");
signMap.put("version", "1.0");
  • String to be Signed
amount=10000&clientIp=192.168.0.111&mchOrderNo=P0123456789101&notifyUrl=https://merchant.com/testNotify/p01&platId=1000&reqTime=20190723141000&returnUrl=https://merchant.com/testReturn/p01&version=1.0&key=EWEFD123RGSRETYDFNGFGFGSHDFGH
  • Signature result
1E9EB944E4A18BA781BFAF46219C8E64
  • Final request for payment system parameters
amount=10000&clientIp=192.168.0.111&mchOrderNo=P0123456789101&notifyUrl=https://merchant.com/testNotify/p01&platId=1000&reqTime=20190723141000&returnUrl=https://merchant.com/testReturn/p01&version=1.0&sign=1E9EB944E4A18BA781BFAF46219C8E64
Last Updated: 1/10/2026, 3:22:23 PM