### Signature Algorithm Example (Conceptual) Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk Illustrates the process of generating a signature for API requests. Parameters are sorted alphabetically, concatenated into a string with their values, and then an MD5 hash is computed using the concatenated string and a secret key. Null values are excluded from the signature string. Signature verification is handled at the gateway level. ```json // Input parameters: { 'symbol': 'ltcbtc', 'appKey': '0816016bb06417f50327e2b557d39aaa', 'sign': 'a169740d0588141ef70b71cf11ff8bf3', 'time': '1522055680' } // Signature algorithm: string = appKey0816016bb06417f50327e2b557d39aaasymbolltcbtctime1522055680 secretKey = xxxxxxxxxxxxxxxxx sign = MD5(string+secretKey) = MD5(appKey0816016bb06417f50327e2b557d39aaasymbolltcbtctime1522055680xxxxxxxxxxxxxxxxx) sign = 82d38bae5fc727feea4f7a96c7db0492 ``` -------------------------------- ### GET /platformapi/chainup/open/opay/orderDetail Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk Retrieves the details of a specific payment order. ```APIDOC ## GET /platformapi/chainup/open/opay/orderDetail ### Description Queries the status and details of a previously created payment order. ### Method GET ### Endpoint http://service.xfnh.com/platformapi/chainup/open/opay/orderDetail ### Query Parameters - **token** (string) - Required - Access token. - **orderNum** (string) - Required - The order number to query. - **sign** (string) - Required - Request signature. ### Response #### Success Response (200) - **orderNum** (string) - The order number. - **status** (string) - Current status of the order (e.g., PAID, PENDING). ``` -------------------------------- ### POST /platformapi/chainup/open/opay/createThirdOrder Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk Creates a new payment order within the platform. Requires a valid access token. ```APIDOC ## POST /platformapi/chainup/open/opay/createThirdOrder ### Description Creates a third-party payment order. Note: Either openId or userId must be provided; if both are present, openId takes precedence. ### Method POST ### Endpoint http://service.xfnh.com/platformapi/chainup/open/opay/createThirdOrder ### Request Body - **token** (string) - Required - The access token obtained from the auth endpoint. - **openId** (string) - Optional - The user's openId. - **userId** (string) - Optional - The user's internal ID. - **orderNum** (string) - Required - Unique order reference number. - **sign** (string) - Required - Request signature. ### Response #### Success Response (200) - **status** (string) - Order creation status. - **orderId** (string) - The platform-generated order ID. ``` -------------------------------- ### RSA API Authentication Overview Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk_v2 Explains the standard request and response structure for endpoints using RSA encryption and signature verification. ```APIDOC ## POST /open/user/registerOrLoginToGetOpenApi ### Description Example endpoint demonstrating the RSA request and response flow. All parameters (excluding app_id, time, and sign) must be encrypted into the 'data' field, and the request must be signed using the developer's private key. ### Method POST ### Endpoint /open/user/registerOrLoginToGetOpenApi ### Parameters #### Request Body - **app_id** (string) - Required - The unique identifier for the application (formerly appKey). - **time** (long) - Required - Current timestamp in milliseconds. - **data** (string) - Required - Encrypted request parameters. - **sign** (string) - Required - Digital signature of the data field. ### Request Example { "app_id": "xxxx", "time": 1715310032, "data": "encrypted_payload_string", "sign": "signature_string" } ### Response #### Success Response (200) - **code** (string) - Status code (0 indicates success). - **msg** (string) - Status message. - **data** (string) - Encrypted response content. - **sign** (string) - Signature for response verification. #### Response Example { "code": "0", "msg": "succ", "data": "encrypted_response_payload", "sign": "signature_string" } ``` -------------------------------- ### GET /platform/login.html Source: https://platformdocs.chainup.com/zh/api-reference/oauth/oauth_login Initiates the platform login process by redirecting the user to an authorization page. Requires appKey and redirectUrl as query parameters. ```APIDOC ## GET /platform/login.html ### Description Initiates the platform login process. This endpoint is used to redirect users to an authorization page where they can log in and grant necessary permissions. It requires the merchant's unique appKey and a redirectUrl for post-authorization navigation. ### Method GET ### Endpoint /platform/login.html ### Parameters #### Query Parameters - **appKey** (string) - Required - The unique appKey for the merchant. `Example: xxx_xxx` - **redirectUrl** (string) - Required - The URL to redirect to after successful authorization. This must match the URL configured in the merchant's backend. `Example: http://merchant.com/callback` ### Request Example ```bash curl --request GET \ --url "http://service.xxx.com/platform/login.html?appKey=xxx_xxx&redirectUrl=http://merchant.com/callback" ``` ### Response #### Success Response (200) - **appKey** (string) - The merchant's unique appKey. - **redirectUrl** (string) - The configured redirect URL. #### Response Example ```json { "appKey": "xxx_xxx", "redirectUrl": "http://merchant.com/callback" } ``` ``` -------------------------------- ### GET /api/user-info Source: https://platformdocs.chainup.com/zh/api-reference/spot/trade_otcTradeRecord Retrieves user account details including profile information and trade history based on provided authentication credentials. ```APIDOC ## GET /api/user-info ### Description Retrieves detailed information about a user, including their account status, trade history, and contact information. ### Method GET ### Endpoint /api/user-info ### Parameters #### Query Parameters - **appKey** (string) - Required - 商家唯一appKey - **openId** (string) - Optional - 收款用户的唯一id - **userId** (string) - Optional - 收款用户的唯一id - **mobileNumber** (string) - Optional - 手机号码 - **email** (string) - Optional - 用户邮箱 - **pageSize** (string) - Optional - 每页数量 (默认20,最大1000) - **pageNumber** (string) - Optional - 页数 (默认1) - **sign** (string) - Required - 签名 ### Request Example GET /api/user-info?appKey=xxx_xxx&sign=2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd ### Response #### Success Response (200) - **adsOwner** (number) - Owner ID - **status** (number) - Account status code - **status_text** (string) - Human readable status #### Response Example { "adsOwner": 370299.06812007725, "status": -84096110.66384327, "status_text": "laboris consequat eu culpa" } ``` -------------------------------- ### RSA Request and Response Structure Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk_v2 Demonstrates the transformation of standard request parameters into encrypted RSA payloads. It shows the required JSON structure for requests, including the 'data' and 'sign' fields, and the corresponding decrypted response structure. ```json { "app_id": "xxxx", "time": 1715310032, "data": "xxxxxxxxxxx", "sign": "xxxxxxxxxxx" } ``` ```json { "code": "0", "msg": "succ", "data": "xxxxxxxxxxx", "sign": "xxxxxxxxxxx" } ``` -------------------------------- ### GET /platformapi/chainup/open/auth/token Source: https://platformdocs.chainup.com/zh/api-reference/pay/pay_paymentPage Retrieves an authentication token for the Chainup platform by providing merchant and user credentials. ```APIDOC ## GET /platformapi/chainup/open/auth/token ### Description Retrieves an authentication token required for platform operations. ### Method GET ### Endpoint http://service.xxx.com/platformapi/chainup/open/auth/token ### Parameters #### Query Parameters - **appKey** (string) - Required - 商家唯一appKey - **orderNum** (string) - Required - 平台编号支付人 openId,必须是订单创建人 - **openId** (string) - Optional - 付款用户的唯一id - **userId** (string) - Optional - 付款用户 uid - **token** (string) - Optional - 授权的token ### Request Example ```bash curl --request GET \ --url http://service.xxx.com/platformapi/chainup/open/auth/token?appKey=xxx_xxx&orderNum=1000000009 ``` ### Response #### Success Response (200) - **data** (any[]) - Returns an array of authentication data. #### Response Example ```json [ { "token": "2ae04ed9165624419bad68e9e0f3f29fbd" } ] ``` ``` -------------------------------- ### Postman Pre-request Script for Signature Generation Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk A JavaScript script for Postman to automatically generate the signature for API requests. It parses the request data, sorts the parameters (excluding 'sign' and empty values), concatenates them with a secret key, computes the MD5 hash, and sets it as an environment variable named 'sign'. ```javascript // Define domain and secret key var domain = "service.xxx.com" var secret = "xxx"; pm.environment.set("domain", domain) // Get request data and parse as JSON var requestStr = request.data; var obj = JSON.parse(requestStr); var keys = Object.keys(obj) console.log(obj); // Build the string to be signed, excluding 'sign' and empty values var str = [] for (var p = 0; p < keys.length; p++) { if(keys[p] == "sign" || request.data[keys[p]] === ""){ continue; } str.push(keys[p] + obj[keys[p]]); } pm.environment.set("str", str) str.sort() str.push(secret) var s = str.join("") console.log("准备签名"); console.log(s); // Compute MD5 hash and set as 'sign' environment variable var sign = CryptoJS.MD5(CryptoJS.enc.Latin1.parse(s)).toString(); pm.environment.set("sign", sign); ``` -------------------------------- ### Staking API Response Structure Source: https://platformdocs.chainup.com/zh/api-reference/increment/staking_getApplyRecord Example of the JSON response returned by the staking API, including status codes, messages, and the data object containing user staking details. ```JSON { "code": "0", "msg": "suc", "data": { "uid": 2000000, "inviteCode": "AAAAAA" } } ``` ```JSON { "uid": 10002186, "amount": "10", "isAuth": 1, "pawnCoin": "BTC", "etime": "1608719975000", "ctime": "1616342400000", "earlyQuitRate": "0", "id": 284, "projectName": "余币宝-测试B2", "projectId": 144, "applyStatus": 2, "lockDay": 7 } ``` -------------------------------- ### POST /platformapi/chainup/open/ Source: https://platformdocs.chainup.com/zh/api-reference/guides/guides The base endpoint for all Chainup Open Platform API requests. All requests must be sent to this URL using the application/json content type. ```APIDOC ## POST /platformapi/chainup/open/ ### Description Base endpoint for the Chainup Open Platform. Replace `service.xxx.com` with your assigned service domain. ### Method POST ### Endpoint https://service.xxx.com/platformapi/chainup/open/ ### Request Body - **Content-Type** (string) - Required - Must be 'application/json' ### Response #### Success Response (200) - **code** (int) - 0 indicates success #### Error Handling - **10020** - Parameter error - **50005** - Signature error - **50009** - Request timeout - **50012** - Access denied ``` -------------------------------- ### POST /platformapi/chainup/open/user/depositRecord Source: https://platformdocs.chainup.com/zh/api-reference/asset/asset_depositRecord Retrieves a list of deposit records for users on the platform. ```APIDOC ## POST /platformapi/chainup/open/user/depositRecord ### Description Retrieves the deposit history for users, including details like transaction ID, currency, amount, and status. ### Method POST ### Endpoint http://service.xxx.com/platformapi/chainup/open/user/depositRecord ### Response #### Success Response (200) - **code** (string) - Return code - **msg** (string) - Success or failure message - **data** (array) - List of deposit records - **symbol** (string) - Deposit currency (e.g., usdt, bnb, btc) - **id** (string) - Deposit ID - **uid** (string) - User ID - **createdAt** (string) - Creation timestamp - **addressTo** (string) - Deposit address - **amount** (string) - Deposit amount - **txid** (string) - Transaction ID - **status** (string) - Status: 0 (Pending), 1 (Completed), 2 (Exception) - **depositType** (string) - Type: 0 (External), 1 (Internal) - **riskLevel** (string) - 0: None, 1: Low, 2: Medium, 3: High #### Response Example { "code": "0", "msg": "Success", "data": [ { "symbol": "usdt", "id": "112331", "status": "1", "amount": "1" } ] } ``` -------------------------------- ### POST /platformapi/chainup/open/user/depositRecord Source: https://platformdocs.chainup.com/zh/api-reference/asset/asset_depositRecord Retrieves a list of user deposit records. Supports filtering by user identifiers, and pagination. ```APIDOC ## POST /platformapi/chainup/open/user/depositRecord ### Description Retrieves a list of user deposit records. Supports filtering by user identifiers, and pagination. ### Method POST ### Endpoint /platformapi/chainup/open/user/depositRecord ### Parameters #### Query Parameters - **appKey** (string) - Required - Merchant's unique appKey. - **openId** (string) - Optional - The unique ID of the recipient user, an open platform authorized user identifier for the application. - **userId** (string) - Optional - The UID of the recipient user (either openId or userId must exist). If both exist, openId takes precedence. - **mobileNumber** (string) - Optional - User's mobile number. - **email** (string) - Optional - User's email address. - **pageSize** (string) - Optional - Number of items per page (default: 20, max: 1000). - **pageNumber** (string) - Optional - Page number (default: 1). - **sign** (string) - Required - Signature for the request. ### Request Example ```json { "example": "No request body provided for this endpoint." } ``` ### Response #### Success Response (200) - **code** (string) - Response code. - **msg** (string) - Response message. - **message** (null) - Additional message details. - **data** (array) - An array of deposit record objects. - **symbol** (string) - The currency symbol (e.g., "usdt", "bnb"). - **id** (integer) - The unique identifier for the deposit record. - **uid** (integer) - The user's unique ID. - **createdAt** (integer) - Timestamp of when the deposit was created. - **addressTo** (string) - The destination address for the deposit. - **amount** (string) - The deposited amount. - **txid** (string) - The transaction ID (if available). - **status** (integer) - The status of the deposit. - **depositType** (integer) - The type of deposit. - **statusDesc** (string) - A description of the deposit status. - **mobileNumber** (string) - The user's mobile number associated with the deposit. - **email** (string) - The user's email address associated with the deposit. - **riskLevel** (integer) - The risk level associated with the deposit. #### Response Example ```json { "code": "", "msg": "", "message": null, "data": [ { "symbol": "usdt", "id": 112331, "uid": -230000, "createdAt": 1233200092, "addressTo": "xxxxxxxxx", "amount": "1", "txid": "xxxxx", "status": 1, "depositType": 0, "statusDesc": "xxxxx", "mobileNumber": "08666666", "email": "xxxxx", "riskLevel": 0 } ] } ``` ``` -------------------------------- ### POST /platformapi/chainup/open/staking/getApplyRecord Source: https://platformdocs.chainup.com/zh/api-reference/increment/staking_getApplyRecord Retrieves a list of staking application records for a user. Supports pagination and filtering. ```APIDOC ## POST /platformapi/chainup/open/staking/getApplyRecord ### Description Retrieves a list of staking application records, including details such as amount, currency, and status. This endpoint supports pagination and allows filtering by user ID. ### Method POST ### Endpoint `/platformapi/chainup/open/staking/getApplyRecord` ### Parameters #### Query Parameters - **appKey** (string) - Required - The unique identifier for the merchant. - **sign** (string) - Required - The signature for request authentication. - **page** (number) - Optional - The current page number for pagination. - **pageSize** (number) - Optional - The number of records per page. - **userId** (string) - Optional - The ID of the user whose records are to be retrieved. #### Request Body This endpoint does not require a request body. ### Request Example ```json { "example": "No request body needed for this endpoint." } ``` ### Response #### Success Response (200) - **code** (string) - The response code, '0' indicates success. - **msg** (string) - A message indicating the result of the operation. - **data** (object) - Contains the user's unique ID and invite code. - **uid** (string) - The user's unique identifier. - **inviteCode** (string) - The user's invitation code. #### Response Example ```json { "code": "0", "msg": "suc", "data": { "uid": 2000000, "inviteCode": "AAAAAA" } } ``` **Status Explanations:** - 1: Earning - 2: Normal Unlock - 3: Early Unlock - 5: Applying to Exit **Return Value Explanations:** - **records** (List) - Required - List of staking application records. (Refer to the detailed fields below) - **current** (int) - Required - Current page number. - **size** (int) - Required - Number of records per page. - **total** (int) - Required - Total number of records. - **pages** (int) - Required - Total number of pages. - **uid** (int) - Required - User ID. - **amount** (String) - Required - Staked amount. - **isAuth** (int) - Required - Real-name authentication status (0/1). - **pawnCoin** (String) - Required - The currency being staked. - **etime** (int) - Required - Unlock time (timestamp in milliseconds). - **ctime** (int) - Required - Participation time (timestamp in milliseconds). - **earlyQuitRate** (int) - Required - Early withdrawal penalty rate. - **id** (int) - Required - Record ID. - **projectName** (String) - Required - Project name. - **projectId** (int) - Required - Project ID. - **applyStatus** (int) - Required - Application status (refer to status explanations). - **lockDay** (int) - Required - Staking lock period in days. ``` -------------------------------- ### POST /platformapi/chainup/open/user/getExchangeToken Source: https://platformdocs.chainup.com/zh/api-reference/thridlogin/login_getExchangeToken Retrieves an exchange token for a specific user, requiring authentication parameters such as appKey, apiKey, and a signature. ```APIDOC ## POST /platformapi/chainup/open/user/getExchangeToken ### Description Retrieves an exchange token for a specific user. This is typically used for authentication and session management within the platform. ### Method POST ### Endpoint /platformapi/chainup/open/user/getExchangeToken ### Parameters #### Query Parameters - **appKey** (string) - Required - The unique appKey of the merchant. - **apiKey** (string) - Required - The openApiKey. - **secret** (string) - Required - The secret key for the openApi. - **uid** (string) - Required - The user ID. - **sign** (string) - Required - The request signature. ### Request Example ```json { "appKey": "xxx_xxx", "apiKey": "2ae04ed9165624419bad68e9e0f3", "secret": "SSe04ed9165624419bad68eDWQ0f3", "uid": "202300123", "sign": "2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd" } ``` ### Response #### Success Response (200) - **code** (string) - The response status code. - **msg** (string) - Success or failure message. - **data** (object) - The response payload. - **data.uid** (string) - The user ID. - **data.inviteCode** (string) - The user's invitation code. - **data.token** (string) - The generated exchange token. #### Response Example ```json { "code": "0", "msg": "suc", "data": { "uid": 23998752, "inviteCode": "QWGGHLTQ", "token": "891324eb68128c031b98a1d8417ae12ed79be7a172704c02a52186f95b78e7ef" } } ``` ``` -------------------------------- ### Register or Login User (cURL) Source: https://platformdocs.chainup.com/zh/api-reference/thridlogin/login_registerOrLoginToGetOpenApi This cURL command demonstrates how to call the ChainUp Open API to register or log in a user. It requires the base URL and will return user details including UID, API key, and secret upon successful execution. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/user/registerOrLoginToGetOpenApi ``` -------------------------------- ### POST /platformapi/chainup/open/symbol/openSymbolList Source: https://platformdocs.chainup.com/zh/api-reference/symbol/symbol_openSymbolList Retrieves the list of all available symbols and their configuration details from the platform. ```APIDOC ## POST /platformapi/chainup/open/symbol/openSymbolList ### Description Retrieves a list of all supported symbols on the platform, including details like contract addresses, precision, and deposit/withdraw status. ### Method POST ### Endpoint http://service.xxx.com/platformapi/chainup/open/symbol/openSymbolList ### Parameters #### Request Body - **appKey** (string) - Required - Merchant AppKey - **sign** (string) - Required - Request signature ### Request Example { "appKey": "{your_app_key}", "sign": "{sign}" } ### Response #### Success Response (200) - **code** (string) - Response code - **msg** (string) - Success or failure message - **data** (object) - Response data object - **data.symbolList** (object[]) - List of symbols - **data.symbolList.coinSymbol** (string) - Symbol name - **data.symbolList.contractAddress** (string) - Contract address - **data.symbolList.showPrecision** (integer) - Display precision - **data.symbolList.isQuote** (integer) - Is quote currency (0: No, 1: Yes) - **data.symbolList.isOpen** (integer) - Is enabled (0: No, 1: Yes) - **data.symbolList.depositOpen** (integer) - Is deposit enabled (0: No, 1: Yes) - **data.symbolList.withdrawOpen** (integer) - Is withdrawal enabled (0: No, 1: Yes) - **data.symbolList.otcOpen** (integer) - Is OTC enabled (0: No, 1: Yes) - **data.symbolList.tokenBase** (string) - Base token - **data.symbolList.depositConfirm** (integer) - Deposit confirmation count - **data.symbolList.name** (string) - Display name - **data.symbolList.withdrawFee** (string) - Withdrawal fee - **data.symbolList.innerWithdrawFee** (string) - Internal withdrawal fee #### Response Example { "code": "0", "msg": "suc", "data": { "symbolList": [ { "coinSymbol": "USDT1711", "contractAddress": "0x4b824af0d34ab70b3cfec53e170062dd51f2272b", "showPrecision": 4, "isQuote": 1, "isOpen": 1, "depositOpen": 1, "withdrawOpen": 1, "otcOpen": 1, "tokenBase": "BTC1711", "depositConfirm": 5, "name": "USDT", "withdrawFee": "2", "innerWithdrawFee": "0" } ] } } ``` -------------------------------- ### Perform Platform Login Request Source: https://platformdocs.chainup.com/zh/api-reference/oauth/oauth_login This endpoint initiates the platform login process. It requires an appKey and a redirectUrl to authenticate the merchant and handle the post-login redirection. ```bash curl --request GET \ --url http://service.xxx.com/platform/login.html ``` -------------------------------- ### POST /platformapi/chainup/open/auth/token Source: https://platformdocs.chainup.com/zh/api-reference/guides/sdk Exchanges an authorization code for an access token and openId. This endpoint is part of the OAuth2.0 flow. ```APIDOC ## POST /platformapi/chainup/open/auth/token ### Description Exchanges the authorization code obtained from the OAuth2.0 login flow for a valid access token and openId. ### Method POST ### Endpoint http://service.xfnh.com/platformapi/chainup/open/auth/token ### Request Body - **appKey** (string) - Required - The unique identifier for the application. - **code** (string) - Required - The authorization code received from the callback URL. - **sign** (string) - Required - The MD5 signature generated using the request parameters and secretKey. ### Response #### Success Response (200) - **token** (string) - The access token for API authentication. - **openId** (string) - The unique identifier for the user. ### Response Example { "token": "eyJhbGciOiJIUzI1Ni...", "openId": "user_12345" } ``` -------------------------------- ### API Response Structure Source: https://platformdocs.chainup.com/zh/api-reference/thridlogin/login_getExchangeToken The standard JSON response returned by the getExchangeToken endpoint, containing the status code, message, and user data including uid, inviteCode, and the generated token. ```json { "code": "0", "msg": "suc", "data": { "uid": 23998752, "inviteCode": "QWGGHLTQ", "token": "891324eb68128c031b98a1d8417ae12ed79be7a172704c02a52186f95b78e7ef" } } ``` -------------------------------- ### Create Third Order Request (cURL) Source: https://platformdocs.chainup.com/zh/api-reference/pay/pay_createThirdOrder This snippet demonstrates how to make a POST request to the createThirdOrder endpoint using cURL. It includes the necessary URL and headers for the request. The request requires various query parameters such as appKey, appOrderId, openId or userId, orderAmount, payCoinSymbol, returnPage, notifyPage, and a signature. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/opay/createThirdOrder ``` -------------------------------- ### Fetch User Deposit Records via cURL Source: https://platformdocs.chainup.com/zh/api-reference/asset/asset_depositRecord A cURL request to the /platformapi/chainup/open/user/depositRecord endpoint. This request retrieves deposit history for a specified user based on provided query parameters. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/user/depositRecord ``` -------------------------------- ### Retrieve Staking Application Records via cURL Source: https://platformdocs.chainup.com/zh/api-reference/increment/staking_getApplyRecord Fetches the staking application records for a user. Requires authentication via appKey and sign parameters in the request. ```cURL curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/staking/getApplyRecord ``` -------------------------------- ### Get Other Transfer List (cURL) Source: https://platformdocs.chainup.com/zh/api-reference/asset/asset_otherTransferList This snippet demonstrates how to call the otherTransferList endpoint using cURL. It requires a POST request to the specified URL and includes query parameters for filtering and authentication. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/record/otherTransferList ``` -------------------------------- ### POST /platformapi/chainup/open/user/otcTradeRecord Source: https://platformdocs.chainup.com/zh/api-reference/spot/trade_otcTradeRecord Retrieves a list of OTC trade records. This endpoint is useful for auditing and tracking past over-the-counter cryptocurrency transactions. ```APIDOC ## POST /platformapi/chainup/open/user/otcTradeRecord ### Description Retrieves a list of OTC trade records. This endpoint is useful for auditing and tracking past over-the-counter cryptocurrency transactions. ### Method POST ### Endpoint /platformapi/chainup/open/user/otcTradeRecord ### Parameters #### Query Parameters (No query parameters specified in the provided documentation) #### Request Body (No request body parameters specified in the provided documentation. It's assumed this endpoint might not require a request body or it's not detailed.) ### Request Example ```json { "example": "No request body example provided." } ``` ### Response #### Success Response (200) - **code** (string) - Returns code. Example: 0 - **msg** (string) - Success or failure prompt message. Example: Success - **message** (string) - Success or failure prompt message. Example: null - **data** (object[]) - An array of OTC trade records. Each object contains details about a specific trade: - **totalPrice** (string) - Total price of the advertisement. Example: 200 - **payTime** (string) - Payment time. Example: 66071485.41974519 - **type** (string) - Advertisement type. Example: sint L - **buyerId** (string) - Buyer's ID. Example: 1234 - **buyerComment** (string) - Comment for the buyer. Example: Good - **payCoin** (string) - Payment currency. Example: btc - **sellerCommnetGrade** (string) - Seller's comment grade (0 for good, 1 for bad). Example: 0 - **coinSymbol** (string) - Trading currency symbol. - **sellerId** (string) - Seller's User ID. Example: 2409315 - **price** (string) - Unit price of the advertisement. Example: 10 - **id** (string) - Advertisement ID. Example: 21993123 - **isBlockTrade** (string) - Whether it's a block trade (0 for normal, 1 for block trade). Example: 1 - **side** (string) - Buy/sell direction (BUY or SELL). Example: BUY - **sidCid** (string) - Seller's merchant ID. Example: 24093315 - **nickName** (string) - Nickname. Example: John - **advert** (object) - Advertisement details: - **id** (string) - Advertisement ID. Example: xxx - **userId** (string) - User ID. Example: xxx - **status** (string) - Advertisement status (1: publishing, 2: trading, 3: expired, 4: closed). Example: 2 - **side** (string) - Transaction type. - **coin** (string) - Trading currency (virtual currency). - **country** (string) - Country. Example: Singapore - **paycoin** (string) - Payment currency (fiat currency). - **payment** (string) - Payment method. - **bankname** (string) - Bank name. - **priceRate** (string) - Ratio of transaction price to market price. - **priceRateType** (string) - Type of price rate ratio (1: same as market price, 2: higher, 3: lower). - **price** (string) - Price. Example: 20 - **volume** (string) - Quantity. Example: 1 - **feeRate** (string) - Fee rate. - **minTrade** (string) - Minimum transaction amount per order. - **maxTrade** (string) - Maximum transaction amount per order. - **beginDate** (string) - Start date. - **endDate** (string) - End date. - **limitTime** (string) - Transaction deadline. - **terms** (string) - Transaction terms. Example: in - **description** (string) - Payment information. - **authType** (string) - Authentication type. - **minvolume** (string) - Cumulative minimum transaction volume. - **sell** (string) - Actual quantity sold by the current advertisement. - **beginTime** (string) - Start time for daily advertisement display. - **endTime** (string) - End time for daily advertisement display. - **ctime** (string) - Creation date. - **personalFeeDiscount** (string) - Personal fee discount (1 means no discount). - **dealVolume** (string) - Deal volume. - **muid** (string) - Last updated person. - **mtime** (string) - Modification time. - **autoReply** (string) - Auto-reply message. - **openType** (string) - Advertisement visibility type (DEFAULT: visible anytime within 30 days, CUSTOM: visible within user-specified time period). - **numberCode** (string) - Country numeric code. - **companyId** (string) - Merchant ID (0 for SAAS main platform). - **isBlockTrade** (string) - Whether it's a block trade. - **adsOwner** (string) - Owner ID of the advertisement. - **adsId** (string) - Advertisement ID. - **sellerComment** (string) - Comment for the seller. - **buyerCommentGrade** (string) - Buyer's comment grade (0 for good, 1 for bad, default is good). - **volume** (string) - Advertisement quantity. Example: 1 - **bidCid** (string) - Buyer's merchant ID. - **sequence** (string) - OTC order number. - **realName** (string) - Real name. Example: John - **feeAmount** (string) - Fee amount. - **paySymbol** (string) - Payment currency symbol (same as payCoin). - **createTime** (string) - Creation time. - **status_text** (string) - Description of advertisement transaction status (e.g., status_unfinished, status_finished, otc.status1.buy.pending, otc.status1.sell.pending, otc.status2.buy.paid, otc.status2.sell.paid). - **status** (string) - Advertisement transaction status (1: Pending Payment, 2: Paid, 3: Transaction Successful, 4: Cancelled, 5: Appeal, 6: Coin Transfer, 7: Abnormal Order). Example: 1 #### Response Example ```json { "code": "", "msg": "", "message": null, "data": [ { "totalPrice": "dolor irure minim", "payTime": -66071485.41974519, "type": "sint L", "buyerId": 18728588.858831063, "buyerComment": "Lorem pariatur culpa", "payCoin": "nostrud sint", "sellerCommnetGrade": 43661358.86004585, "coinSymbol": "est", "sellerId": -83124481.54348831, "price": "reprehenderit officia", "id": 80100799.1043742, "isBlockTrade": -84781852.75093764, "side": "dolor adipisicing incididunt", "sidCid": 37636378.631895095, "nickName": "commodo dolor cillum amet", "advert": { "id": -98700553.6279753, "userId": 71897754.26874045, "status": -41918123.25143856, "side": "ullamco sit ea dolore", "coin": "qui commodo sit Excepteur", "country": "enim esse", "paycoin": "ullamco in veniam deserunt", "payment": "fugiat E", "bankname": "sint in consectetur commodo", "priceRate": 5461107.288492471, "priceRateType": -9248210.302651882, "price": -66779745.07153497, "volume": 46572631.72058594, "feeRate": -56260957.13108041, "minTrade": 32467076.07894437, "maxTrade": 3329254.407976508, "beginDate": -72387161.32557198, "endDate": 99444797.85827425, "limitTime": -79222521.60977994, "terms": "in", "description": "adipisicing do in", "authType": "cillum enim sed", "minvolume": 20805439.701604337, "sell": -21831948.77222365, "beginTime": -62468607.30395776, "endTime": -8638618.314135417, "ctime": "", "personalFeeDiscount": "", "dealVolume": "", "muid": "", "mtime": "", "autoReply": "", "openType": "", "numberCode": "", "companyId": "", "isBlockTrade": "" }, "adsOwner": "", "adsId": "", "sellerComment": "", "buyerCommentGrade": "", "volume": "1", "bidCid": "", "sequence": "", "realName": "John", "feeAmount": "", "paySymbol": "", "createTime": "", "status_text": "status_unfinished", "status": "1" } ] } ``` ``` -------------------------------- ### Retrieve Exchange Token via cURL Source: https://platformdocs.chainup.com/zh/api-reference/thridlogin/login_getExchangeToken A cURL request to the getExchangeToken endpoint to retrieve user-specific exchange tokens. This request is a POST operation requiring mandatory authentication headers or parameters. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/user/getExchangeToken ``` -------------------------------- ### Retrieve Authentication Token via cURL Source: https://platformdocs.chainup.com/zh/api-reference/pay/pay_paymentPage This endpoint performs a GET request to retrieve an authentication token from the ChainUp platform. It requires specific query parameters to validate the merchant and user identity. ```cURL curl --request GET \ --url http://service.xxx.com/platformapi/chainup/open/auth/token ``` -------------------------------- ### POST /platformapi/chainup/open/user/registerOrLoginToGetOpenApi Source: https://platformdocs.chainup.com/zh/api-reference/thridlogin/login_registerOrLoginToGetOpenApi Registers a new user or logs in an existing user to obtain an Open API key and secret. Users can be identified by either mobile number or email. ```APIDOC ## POST /platformapi/chainup/open/user/registerOrLoginToGetOpenApi ### Description Registers a new user or logs in an existing user to obtain an Open API key and secret. Users can be identified by either mobile number or email. ### Method POST ### Endpoint /platformapi/chainup/open/user/registerOrLoginToGetOpenApi ### Parameters #### Query Parameters - **appKey** (string) - Required - Merchant's unique appKey. - **countryCode** (string) - Required - Country code for the registered user. - **mobileNumber** (string) - Required - Mobile number of the registered user (if provided, countryCode must also be provided). - **email** (string) - Required - Email address of the user (either email or mobileNumber must be provided). - **password** (string) - Required - Password for creating the user. - **invitedCode** (string) - Required - Invitation code. - **ip** (string) - Required - IP whitelist. - **sign** (string) - Required - Signature. ### Request Example ```json { "appKey": "xxx_xxx", "countryCode": "93", "mobileNumber": "1990099121", "email": "xxx@xxx.com", "password": "xxxxxx", "invitedCode": "SDOOMXA", "ip": "192.168.1.1", "sign": "2ae04ed9165624419bad68e9e0f3f2sa9fbd2ae04ed916511624419bad68e9e20f3f29fbd" } ``` ### Response #### Success Response (200) - **code** (string) - Return code. - **msg** (string) - Success or failure message. - **data** (object) - Contains user and API credentials. - **uid** (string) - User ID. - **apiKey** (string) - API key. - **secret** (string) - API secret. #### Response Example ```json { "code": "0", "msg": "suc", "data": { "uid": "23998752", "apiKey": "47e2468b6dc5277fe19417d44daa834a", "secret": "f1abbd4ef74ec2d046dea8a85a659076" } } ``` ``` -------------------------------- ### Retrieve Agent User Bonus Records (cURL) Source: https://platformdocs.chainup.com/zh/api-reference/increment/asset_agent_user_bonus This snippet demonstrates how to retrieve agent user bonus records using a cURL command. It specifies the POST request method and the endpoint URL. The request requires an `appKey` and `sign` as query parameters, along with optional parameters for filtering and pagination. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/record/agent_user_bonus ``` -------------------------------- ### Other Transfer List Response Structure Source: https://platformdocs.chainup.com/zh/api-reference/asset/asset_otherTransferList This is an example of the JSON response received when querying the otherTransferList endpoint. It contains a 'code' for status, a 'msg' for messages, and a 'data' object that includes a 'financeList' array with transaction details. ```json { "code": "0", "msg": "suc", "data": { "financeList": [ { "id": 1, "uid": 23998148, "amount": "121.000000000000", "coinSymbol": "FILCOIN", "createTime": "2023-10-11 10:33:04", "transactionScene": "present_coin", "createdAtTime": 1696991584000, "status": 1 } ] } } ``` -------------------------------- ### Refund Order API Request and Response Source: https://platformdocs.chainup.com/zh/api-reference/pay/coin_refundOrder This snippet demonstrates how to initiate a refund request using cURL and shows the expected JSON response structure. The request requires mandatory fields like appKey, order ID, amount, and currency, returning an order number upon success. ```bash curl --request POST \ --url http://service.xxx.com/platformapi/chainup/open/opay/refundOrder ``` ```json { "code": "", "msg": "o", "data": { "orderNum": "" } } ```