Current Token Rate Interface

Amount in USD = Amount in the target token * Current Token Rate. Take BTC for an example: 10000 USD = 0.059 BTC*16944.3 USD (the current rate of BTC)

Return current rate of target token

POST https://admin.ccpayment.com/ccpayment/v1/token/rate

Return the real-time price of the target token and its equivalent value in passed amount in USD

Headers

NameTypeDescription

Appid*

string

Merchant's unique credential. Find it on the Developer page.

Timestamp*

string

Timestamp in seconds (10-digit). The request is valid for two minutes.

Sign*

string

SHA-256 (APPID + APP Secret +timestamp+body (json string)). Signature guide.

Content-Type*

String

application/json; charset=utf-8

Request Body

NameTypeDescription

amount*

string

Amount in USD

token_id*

string

Token ID for the target token. Get token id by calling interface or checking it on the sheet

Response

NameValueRequiredTypeDescription

Appid

202302010636261620672405236006912

Y

string

Merchant's unique credential. Find it on the Developer page.

Timestamp

1677152490

Y

string

Timestamp in seconds (10-digit). The request is valid for two minutes.

Sign

871f0223c66ea72435208d03603a0cb00b90f6ac4a4ba725d00164d967e291f6

Y

string

SHA-256 (appId + appSecret + timestamp+body (json string))

Body

{
	"code": 10000,
	"msg": "success",
	"data": {
		"price": "16944.3",
		"value": "0.0590168965374787"
	}
}

Parameters

NameValueRequiredTypeDescription

code

10000

Integer

msg

Success

String

Status description

data

Object

Return data

data.price

16944.3

String

Current rate of the target token

data.value

0.0590168965374787

String

Target token's equivalent value in passed amount in USD

Request Body Example

{
	"amount": "1000",
	"token_id": "f36ad1cf-222a-4933-9ad0-86df8069f916",
}

Last updated