2.0 Updated one more payment callback, changed the original payto interface name to payback. The old version is still compatible
2.1 Changed the original names appKey and appSecret to businessKey and businessSecret
2.2 add some verification instructions and add recordid detection interface
Test environment: https://paytest-api.cctip.io/
Official environment: https://pay-api.cctip.io/
Request:
header, which belongs to the public part
of the interface:
body:
Body example:
The data returned is all in the structure of Json, and the fields are composed as follows:
integer
is an error code; when it is 0, it represents a successful requeststring
, error messagespecific data
, defined according to different interfacesMerchant robot:
telegram
CCTip·APP:
telegram
twitter
discord
reddit
apple
businessKey and businessSecret will be provided to merchants by CCPay
:
Signing steps for parameters:
Convert json to string in body to get A. No need for stitching if without body;
Be sure to use "_" to stitch them according to the following example format:
businessKey + _ + platform + _ + reqId + _ + A
. After stitching them, get Str;
Generate signature signature on Str with businessSecret. Don't convert the case, but save it as it is:
Note: For PHP language developers, please set the fourth parameter of the hash_hmac function, raw_output, to true
URL of the online signature debugging tool:https://1024tools.com/hmac
The Token information returned in this interface is currently supported by CCPay. If it is not in the return list, it suggests that it is not supported. For the value of
chain_id
andcontract
in other related interfaces, please refer to this interface. The legality of the user's token recharge should also be subject to the one here, so as to prevent the token recharge attack of repeated symbols.
Router | Method | Authentification | Frequency limit | Header parameter |
---|---|---|---|---|
/v1/ccpay/token/list | GET | Yes | 5s/time | Yes |
Parameter:
Return
Failure:
Success:
interface maintenance
This interface allows merchants to help users generate relevant information for on-chain
deposit.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/order/deposit/submit | POST | Yes | 20ms/time | Yes |
Parameters:
All fields, except backup
, are required;
integer, the id of the chain where the Token is located
contract
string, the contract value of Tokenstring, the value to be deposited in the order,
not a precision amplification value`Return:
Failure:
Success:
interface maintenance
This interface allows merchants to withdraw their tokens for the CCTip system from the chain to the chain address
specified by the user.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/withdraw | POST | Yes | 20ms/time | Yes |
Parameteres:
All fields are required
to_bot_id string, the user who the merchant wants to withdraw the corresponding Token to, the user id on the robot platform
chain_id integer
, the id of the chain where the Token to be withdrawn is located
contract
string, the contract value of the Token to be withdrawn`
amount
string, the value of withdrawal, not a precision amplification value
address
, the withdrawal address specified by the user
Return:
Failure:
Success:
This interface allows merchants to transfer their Token assets to designated users. Please note that the payback interface here is not the same as the payto
command to deposit tokens in the cctip_bot
robot private chat interface.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/payback | POST | Yes | 20ms/time | Yes |
Parameters:
All parameters, unless otherwise specified, are required
Fill in either
to_bot_id
orto_sys_id
below. If both are filled in,to_sys_id
should prevail.
chain_id
integer, the id of the chain where the Token to be withdrawn is locatedcontract
string, the contract value of the Token to be withdrawnamount
string, the value of withdrawal, not a precision amplification value
order_id
is an optional parameter. Ccpay will record it, if any. When the request is successfully processed by this interface, the order_id is no longer available. A replay error will be returned.Return:
Failure:
Success:
This interface allows merchants to query the Token balance of their merchant account in the CCTip system.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/business/balance | POST | Yes | 20ms/time | Yes |
Parameters:
All parameters are required
chain_id integer, the id of the chain where the Token to be queried is located
contract string, the contract value of the Token to be queried
Failure:
Success:
US$/unit
This interface allows merchants to query all chain-supported wallet addresses of their merchant accounts
in the CCTip system.
Router | Method | Authentification | Frequency Limit | Head Parameter |
---|---|---|---|---|
/v1/ccpay/business/address | POST | Yes | 20ms/time | Yes |
Parameters:
Failure:
Success:
Note: No tokens can be deposited to the address of TRON directly temporarily
This interface allows merchants to send requests in the background service to verify whether the AccessToken
issued by CCTip·APP
is valid.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/accesstoken/check | POST | Yes | 10ms/time | Yes |
Parameters:
All parameters, unless otherwise specified, are required
Return:
Failure:
Success:
This interface allows merchants to send a request in the background service to check whether the charging order corresponding to recordid has been recorded. Since October 8, 2020, although the call back notification office has been able to ensure that the recharge will be returned only after the account is reached, it is recommended that the merchant check the recordid with this interface when receiving the callback or other necessary time!
Note: the best time to call the interface is within minutes after receiving the callback. If it is called after a long time, the result of the order expiration may be obtained.
Router | Method | Authentification | Frequency Limit | Header Parameter |
---|---|---|---|---|
/v1/ccpay/record/check | POST | Yes | 20ms/time | Yes |
Parameters:
All parameters, unless otherwise specified, are required
Return:
Failure:
Success:
The deposit / withdrawal callback includes the following four scenarios:
To receive callbacks from CCPay, the merchant must provide an interface that meets the following requirements. CCPay will call the following interface then.
Link: {host}/ccpay/notify
, host
is the service domain name of the merchant, not in ip format:
ccpay.cctip.io/v1/
47.23.44.252:81
Method: POST
header:
Requested parameters:
Composition of Public Parameter Requests for analysis
;CCTip·APP
interface. It is transparently transmitted.5
, the internal data is analyzed as follows:
5. Tip: To uniquely determine a user based on user_id
, it is advised to combine the platfrom
parameter.
Signature method:
reqId + _ + A
to get Str;signature
on Str with the businessSecret of the merchant:What the merchant needs to do:
replay attacks
; signature_2
with your own businessSecret according to Step 4, and then compare signature == signature_2. If they are consistent, then the request information has not been tampered with.Signature code example:
httpCode
of 200
must be returned to CCPayWhen CCPay calls back the merchant’s notify
interface, if the returned response has a httpCode other than 200, then CCPay will consider the request to be unreachable. It will store the request information, and then make the next call strategically
. All request information will be the same, including reqId. If the same callback still fails after a certain number of retries, CCPay will record
and discard
the callback.
Value | Description |
---|---|
20 | The AccessToken issued by CCTip·APP has expired or is illegal |
Value | Description |
---|---|
100 | Parameter error |
101 | CCPay internal service error |
102 | Failed to verify signature |
103 | Interface access limit |
104 | Request replay |
105 | Unsupported platform |
106 | Parameter error |
110 | Insufficient transfer balance |
112 | The merchant withdraws tokens to the user, and orderld replays |
120 | The deposit order does not exist |
Value | Description |
---|---|
145 | recordId overdue |
146 | recordId not exist |
Value | Description |
---|---|
157 | Withdrawal parameter error |
158 | Internal error of withdrawal system |
159 | Insufficient withdrawal balance |
160 | Unsupported token withdrawn |
161 | Insufficient withdrawal fee |
162 | TRON chain. The withdrawal address cannot be an address that has not been created yet |
163 | TRON chain. The withdrawal address cannot be your own address. |
164 | The record of application for withdrawal does not exist |
165 | On-chain withdrawal function is under maintenance |
Value | Description |
---|---|
200X | Database operation error |