Skip to content

Sign Self-Check

POST /coin/v1/test/sign

Not a production business API — for signature comparison only. Available only in the test environment for the test merchant. Other merchants / production return unauthorized.

Test steps

  1. Set Header X-Merchant-Id to M1781678976331286876, and compute Digest / Authorization per Request Signing.
  2. Compare the returned digest with your local Digest.
  3. Compare the returned sign_string with your local Canonical Signing String (4 lines joined by LF).
  4. Verify the request Authorization.signature with the test public key; if valid and Digest is correct, is_verify=true.

Note: ECDSA signatures differ each time — do not string-compare the request signature with the returned sign.

Request fields (all optional; for realistic body testing)

FieldTypeRequiredDescription
quote_idstringNoQuote ID
trade_snstringNoMerchant order ID
pay_amountdoubleNoPay amount
receive_amountdoubleNoReceive amount
pay_currencystringNoPay currency
receive_currencystringNoReceive currency

Request body example

json
{
  "quote_id": "Q202606160001",
  "trade_sn": "ORD-001",
  "pay_amount": 543.2100,
  "receive_amount": 100.00,
  "pay_currency": "BRL",
  "receive_currency": "USDT"
}

Response fields (data)

FieldTypeDescription
is_verifyboolDigest correct and request signature verified with the test public key
sign_stringstringServer Canonical Signing String (critical concatenation)
digeststringDigest computed by the server from the raw body
signstringES256 signature of sign_string by the test private key (Base64); usable in Header
authorizationstringFull Authorization example value

Success response example

json
{
  "status": 200,
  "msg": "SUCCESS",
  "data": {
    "is_verify": true,
    "sign_string": "(request-target): post /coin/v1/test/sign\nx-timestamp: 1710000000\nx-nonce: a9f3c1d47e8b9a2c\ndigest: SHA-256=...",
    "digest": "SHA-256=...",
    "sign": "<base64-signature>",
    "authorization": "Signature keyId=\"M1781678976331286876\",alg=\"ES256\",headers=\"(request-target) x-timestamp x-nonce digest\",signature=\"...\""
  }
}