Skip to main content

Deposit request

is used to initiate a deposit request

Request address

  • API Address (requestURI) : /openapi/v1/deposit/request

Request parameters

Parameter nameTypeRequirementDescription
trackingIdStringRMerchant tracking ID, each transaction operation of each merchant should be guaranteed to be unique, and the length is limited to 50 characters
businessNameStringRThe name of the deposit business, such as the name of the product/business, is limited to 50 characters
assetTypeIntegerRAsset type, [0: Cryptocurrency, 1: Fiat Currency]
amountBigDecimalRThe amount cannot be greater than 999999999999.99
assetNameStringRAsset name/currency, limited to 20 characters
userSelectableIntegerRWhether the user is optional, [0: not optional, 1: optional]. Optional: Fields such as network type/payment type can be left blank and specified by the cashier page when submitting
netProtocolStringCNetwork type/payment type. userSelectable=0 is required, and the length is limited to 20 characters
bankCodeStringCBank code. For payment types of some currencies, userSelectable=0 is required to verify
webhookUrlStringRThe callback URL/webhook URL of the notification callback is limited to 255 characters
successPageUrlStringRThe address of the page where the deposit is successfully redirected, and the length is limited to 255 characters
remarkStringOTransaction remarks cannot exceed 255 characters. Add some additional data or identifiers to the transaction, such as the order number, and the interface will return
activeTimeIntegerRValid duration, unit: milliseconds. A value greater than 0 indicates a permanent validity period, and a value greater than 0 indicates a limited validity period (up to 7 days).
text1StringOText 1. It is only used for the display of the cashier page, does not participate in the payment, the example is "1000", the length is limited to 40 characters, 20 is recommended to achieve the best display effect
text2StringOText 2. It is only used for the display of the cashier page, does not participate in the payment, the example is "$1000", the length is limited to 40 characters, 20 is recommended to achieve the best display effect
text3StringOText 3. It is only used for the display of the cashier page, does not participate in the payment, the example is "Mfedfring", the length is limited to 40 characters, 20 is recommended to achieve the best display effect
text4StringOText 4. It is only used for the display of the cashier page, and does not participate in the payment, the example is "1USD = 1038KRW", the length is limited to 40 characters, 20 is recommended to achieve the best display effect
userIdStringRThe user ID is limited to 64 characters in length
userIpStringOThe IP address of the user, which is limited to 64 characters in length
skipPageIntegerOWhether to skip the cashier page, [1: skip page, 0: do not skip page]. The default is not skipped. When skip is selected, the API will directly return the required information for payment, but not the address of the cashier page

Sample request

{
"trackingId": "20220408123456789",
"businessName": "Deposit",
"assetType": 1,
"amount": 100,
"assetName": "USD",
"userSelectable": 1,
"netProtocol": "bank",
"webhookUrl": "https://yourdomain.com/webhook",
"successPageUrl": "https://yourdomain.com/success",
"remark": "Deposit",
"activeTime": 0,
"text1": "100",
"text2": "$100",
"text3": "Mfedfring",
"text4": "1USD = 1038KRW",
"userId": "123456",
"userIp": "127.0.0.1",
"skipPage": 0
}

Response parameters

Parameter nameTypeRequirementdescription
trackingIdStringRMerchant tracking ID
redirectPageUrlStringRThe address of the payment page to which you are redirected. When skipPage=1 is in the request parameter, the value of this field is the address of the upstream payment page, otherwise it is the address of the cashier page of the system
walletAddressStringCWallet address. This field is meaningful when skipPage=1 in the request parameter, which is the wallet address provided to the user for cryptocurrency deposits
expireTimestampLongRExpiration timestamp, accurate to millisecond
remarkStringCTransaction Notes. Add some additional data or identifiers to the transaction, such as the order number, and the interface will return

Sample response

{
"code": 200,
"msg": "success",
"data": {
"trackingId": "20220408123456789",
"redirectPageUrl": "https://yourdomain.com/pay",
"walletAddress": "0x1234567890abcdef",
"expireTimestamp": 1670505600000,
"remark": "Deposit"
}
}

Sample code

  public static void main(String[] args) {
String uri = "/openapi/v1/deposit/request";
String paymentOpenapiAccessKey = "your_accessKey";
String paymentOpenapiSecretKey = "your_secretKey";

String url = "https://test-gateway.mcconnects.com/mc-payment" + uri;
String timestamp = String.valueOf(System.currentTimeMillis());
// hutool http client
// HttpRequest httpRequest = HttpUtil.createPost(url)
// .header("Content-Type", "application/json")
// .header("X-Access-Key", paymentOpenapiAccessKey)
// .header("X-Signature", AKSKUtil.calculateHMAC(paymentOpenapiAccessKey + timestamp + uri,
// paymentOpenapiSecretKey))
// .header("X-Timestamp", timestamp)
// .header("X-RequestURI", uri);
// String body = httpRequest.body("""
// {
// "bankCode": "",
// "amount": 1,
// "successPageUrl": "https://yourdomain.com/deposit/success",
// "activeTime": 1800000,
// "businessName": "Deposit",
// "remark": "Deposit",
// "userSelectable": 0,
// "userId": "userId",
// "webhookUrl": "https://yourdomain.com/webhook/deposit",
// "assetType": "0",
// "netProtocol": "ERC20",
// "skipPage": 0,
// "assetName": "ETH",
// "userIp": "192.168.1.1",
// "trackingId": "trackingId"
// }
// """).execute().body();
// System.out.println(body);

// java17 http client
try {
HttpClient client = HttpClient.newHttpClient();
java.net.http.HttpRequest request = java.net.http.HttpRequest.newBuilder()
.uri(URI.create(url))
.header("Content-Type", "application/json")
.header("X-Access-Key", paymentOpenapiAccessKey)
.header("X-Signature", AKSKUtil.calculateHMAC(paymentOpenapiAccessKey + timestamp + uri,
paymentOpenapiSecretKey))
.header("X-Timestamp", timestamp)
.header("X-RequestURI", uri)
.POST(java.net.http.HttpRequest.BodyPublishers.ofString("""
{
"bankCode": "",
"amount": 1,
"successPageUrl": "https://yourdomain.com/deposit/success",
"activeTime": 1800000,
"businessName": "Deposit",
"remark": "Deposit",
"userSelectable": 0,
"userId": "userId",
"webhookUrl": "https://yourdomain.com/webhook/deposit",
"assetType": "0",
"netProtocol": "ERC20",
"skipPage": 0,
"assetName": "ETH",
"userIp": "192.168.1.1",
"trackingId": "trackingId"
}
""")).build();
String body2 = client.send(request, HttpResponse.BodyHandlers.ofString()).body();
System.out.println(body2);
} catch (IOException e) {
throw new RuntimeException(e);
} catch (InterruptedException e) {
throw new RuntimeException(e);
}

}