ClickDirectPay Simple Coin Payment API

ClickDirectPay's Express Coin Payment (ECP) is a simplified payment service that makes it easy for businesses to accept Bitcoin and other cryptocurrencies as a form of payment just like credit card, Paypal or cash. To minimize integration and any security issues from the merchant side, ECP method redirects a customer to ClickDirectPay's hosted pages where a customer can complete their payment and be redirected back to the merchant's site.

Payment Flow

Payment Flow

Getting Started

Before getting started, make sure you have your merchant ID and API Key accessible. This would have been provided to you during your on boarding set up. API key must remain private and should only be accessible by the developer / owner.

If you are having any issues, feel free to submit a ticket and one of our technical support team member will be able to assist.


ECP uses a SHA-256 hash of the following to authorize a creation of a payment transaction via POST request.

  • Merchant ID
  • Timestamp
  • Transaction Amount
  • Transaction Currency
  • API Key

Create Payment Order

To begin accepting a payment, a token must first be generated and issued for the transaction. This establishes a secure layer when sending transactions through our system. You will POST to URL below passing below parameters.


POST /mxapi/payrequest


Parameters Description
Merchant ID
Timestamp represented in milliseconds
positive integer
Transaction amount presented as a positive integer. This can be an integer represented in fiat or crypto (ex. 100 or 0.3568)
Three-letter ISO currency code (fiat) or supported coin symbols (crypto).
Merchant's internal order reference number
OPTIONAL, string
Description of product or service
OPTIONAL, currency
Three-letter supported coin symbols required ONLY IF txnCurrency is a fiat currency code (e.g. USD) otherwise not required to provide.
OPTIONAL, string
URL where customer will be redirected to after completing payment and will supercede any default result URL stored in merchant profile. This is typically a result page on your site.

This field is required ONLY IF default result URL within merchant profile has NOT been provided.
OPTIONAL, string
URL where service will inform merchant of the status of the payment and will supercede any default callback URL stored in merchant profile.

As crypto payments are not always instantaneous, our service will push the result to merchant once the status of payment has changed.

This field is required ONLY IF default callback URL within merchant profile has NOT been provided.
Using SHA256 hash of merchantId + requestSalt + txnAmount + txnCurrency + merchant API key

*Must be in this order

For example, if your merchantId is TEST999999901, requestSalt 1516420191301, txnAmount is 10.0, txnCurrency is LTC and your merchant API Key is testapikey12345678

Then your calculated SHA256 hash (txnAuthz) would be:


Example Response

   "tokenId" : "YO151642019133295092",
   "merchantId" : "TEST999999901",
   "issuedOn" : "2018-01-20T03:49:51.332+0000",
   "validUntil" : "2018-01-20T03:54:51.332+0000",
   "usedOn" : null,
   "txnId" : 1104

tokenId: A one time use token issued by CDP for specific transaction
txnId: A unique transaction identifier in CDP system

Payment Redirect

Once a token has been generated by Create Payment Order, you will redirect to CDP’s URL below passing below parameters.


HTTP REDIRECT /paymerchant.html?txnTokenId=xxxxxx&txnId=xxxxxx


Parameters Description
The tokenId received from Create Payment Order response.
The txnId generated from Create Payment Order response.


User is redirected to CDP hosted payment page. Note that you are not passing us the amount and currency of payment as these are retrieved from CDP’s system.

Payment Confirmation

Once redirected, there will be a page allowing the user to confirm the transaction details which include:

  • Your (business) name
  • Amount of item
  • Amount to pay (in chosen cryptocurrency)
  • Your transaction reference number

If the user decides to proceed, this will take the user to the Payment page in order to complete the payment. If the user decides to cancel the transaction the system will redirect the user back to your site.


Once user has confirmed the transaction, it’s time to make the payment. The process of paying using cryptocurrency can be broken into two parts - Payment Address and Coin Payment.

Payment Address

The payment page will display your public (receiving) address in order to accept the coin. This is also represented in a QR code on screen to allow users to scan the code and pre-populate this address. This page remains on screen until the user decides they have captured the necessary information to make payment and exits this page. Note: This address is a one-time use address and a new address is always generated on every new transaction.

Coin Payment

Making a coin payment is an asynchronous process. The actual payment by the user can be completed in various ways but will require the user to send the coin to your receiving address.

Note: Live transaction confirmations will vary depending on the coin used for payment. For additional resources on this, please refer to the Resource Center.

The user may return to your website by either cancelling this transaction or clicking complete.

Payment Result

The user will be redirected back to your site if user completes the payment page or cancels the transaction. The URL of the result page is the resultUrl passed in Create Payment Order (if not blank) or a default URL registered on your account profile, if the resultUrl is blank.



The txnId generated from Create Payment Order response.
Please refer to the Result Codes
Merchant’s internal order reference number passed during the Create Payment Order


Since cryptocurrency payments are asynchronous, it is likely the result code will indicate a Pending state. As it normally takes a few minutes to confirm a transaction on the blockchain, there can be two ways we will notify you.

Check Transaction Status

Once user has confirmed the transaction, it’s time to make the payment. The process of paying using cryptocurrency can be broken into two parts - Payment Address and Coin Payment.

Callback URL

We will post the result to the callbackUrl you set in the Create Payment Order request, once the transaction has an update to its status.


We may request for a notification email which will be stored under your account profile. Once a transaction has an update to its status, we will notify you at this email.

Response Codes

Result Codes

Code Status Description
000 Success Amount paid was equal to requested amount.
001 Success Amount paid was more than requested amount.
002 Success Amount paid was less than requested amount.
100 Pending When a generated public address is created to receive payment.
800 Cancelled When a customer cancels a transaction during the payment process using the Cancel button.
900 Failed When an internal error occurs within our system.

Error Codes

Code Description
E2001 Invalid transaction token
E2002 Transaction token already used
E2003 Transaction token already expired
E2004 Invalid transaction authorization
E2010 Invalid transaction
E2011 Invalid transaction request
E2020 Invalid transaction amount
E2021 Transaction failed
E2022 Unsupported currency
E2023 Unsupported fiat currency
E2024 Unsupported crypto currency
E2025 Unsupported currency conversion
E2026 Invalid crypto address
E2027 The crypto address was not found in our system
E2028 Currency is required
E2029 Transaction not found
E5000 Payment was made in different currency
E5001 Invalid payment notification. Authorization failed
E5002 Invalid transaction ID
E9999 System Error

Supported Coins List

Supported Coin Symbol Confirmations
Bitcoin BTC 2
Bitcoin Cash BCH 3
Litecoin LTC 3
Ether ETH 3

Resource Center

SDK Download Package

To assist your integration, we have a downloadable SDK Package written in PHP. This package is a step by step to help you easily integrate with ClickDirectPay.

Download SDK

Payment Buttons

Payment Buttons

Where to Buy Coins

You can refer to this link for information on where to buy coins.


This resource center is meant as additional support information. CDP is not responsible for any misuse or incorrect use of suggested resources and/or links.