1.
The client generates a timestamp of the current time (Unix timestamp, accurate to seconds).
2.
Compress and sort the request body according to JSON rules.
3.
Concatenate the timestamp and request body into a string, and sign it using the private key.
4.
Include the signature, user ID, and timestamp in the request headers.
1.
The server generates a timestamp of the current time (Unix timestamp, accurate to seconds)
2.
Converts the request body to a JSON string
3.
Concatenates the timestamp and request body into a string, and signs it using the private key
4.
Includes the signature and timestamp in the request headers
1.
Time Validation: It is recommended to verify that the timestamp is within a reasonable time range (e.g., 5 minutes) to prevent replay attacks
2.
Public Key Security: Although public keys can be made public, it is still recommended to transmit and store them through secure channels
3.
HTTPS: Webhook callbacks must use HTTPS protocol to ensure transmission security
invalidBody: Request body does not comply with specifications
Unauthorized: Signature verification failed
Not Found: Resource does not exist
insufficientBalance: Insufficient balance
Too Many Requests: Too frequent requests
verifySignFailed: All secret comparisons failed
accountNotExist: Account/Agent does not exist
notAgencyMerchant: When filtering merchant information, the accountId is not an agency merchant, or the currencyAccount merchant is not an agency merchant
tradeCurrencyAccountFoundErr: Currency merchant query failed
dbNotMatch: For exact matching of single data, when request data is compliant but no matching data is found