Skip to content
Docs简体中文Website ↗
Docs/Signing & verification
INTEGRATION GUIDE

Signing & verification

Use the source-defined MD5 rules and the correct field scope for each operation.

Algorithm#

  1. Remove pay_md5sign and sign.
  2. Sort selected field names in ascending order.
  3. Omit values considered empty by PHP empty(), including the string "0".
  4. Join raw name=value pairs with &, then append key=YOUR_APIKEY.
  5. Compute MD5, then uppercase the hexadecimal digest.

Signed field scopes#

OperationSigned fields
Collection createpay_memberid, pay_orderid, pay_amount, pay_applydate, pay_bankcode, pay_notifyurl, pay_callbackurl
Collection querypay_memberid, pay_orderid
Payout createSubmitted nonempty form fields, excluding pay_md5sign
Payout querymchid, out_trade_no
Balance queryNormally mchid; Brazil signs every nonempty POST field actually sent
Collection callbackmemberid, orderid, transaction_id, amount, datetime, returncode
Payout callbackActual notification fields except sign

PHP reference implementation#

PHP · Source-defined algorithm
function makeSign($params, $apiKey) {
    unset($params['pay_md5sign'], $params['sign']);
    ksort($params);
    $source = '';
    foreach ($params as $name => $value) {
        if (!empty($value)) {
            $source .= $name . '=' . $value . '&';
        }
    }
    return strtoupper(md5($source . 'key=' . $apiKey));
}

Avoid common mismatches#

  • Sign raw values before URL encoding; form-encode only for transport.
  • Keep the exact amount string: 100.00 and 100 are different signing inputs.
  • Do not add type, product fields or attach to the collection signature scope.
  • Validate response signatures by removing sign first.
© 2026 88Pay API field names and response values remain unchanged across languages.
Searches this documentation only · No data is sent to the server