Native Checkout Integration

Obtain the receiving address, you can customize the checkout page on your Application/Web, using it to receive payment

Integrate with the Native Checkout API to build the checkout page for your sites/apps. Users complete the payment in your sites/apps and there's no need to skip to external pages. You can completely control your users' checkout experience.

Step 1: Create Payment Order

Submit payment order and receive payment address

POST https://admin.ccpayment.com/ccpayment/v1/bill/create

Return receiving address/QR code and order information

Headers

NameTypeDescription

Sign*

String

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

Timestamp*

String

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

Appid*

String

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

Content-Type*

String

application/json; charset=utf-8

Request Body

NameTypeDescription

remark

String

Remark

merchant_order_id*

String

Order ID in Merchant's system. A unique ID for every order

product_price*

String

Amount should be paid for this order (in USD by default, no more than two digits after the dot)

token_id*

String

Tells CCPayment's server which coin and which network should be used for the transaction. You can get the token_id by calling the interface or find it on this sheet

denominated_currency*

String

Currency for the order. Pass "token" if you want to show the price in crypto. Pass corresponding currency code if you want to show the price in fiat.

order_valid_period

Integer

The valid duration for the order.

Time period in seconds (10 digits).

The parameter passed by the merchant should be less than the order's valid period in Merchant's system. Cause on-chain transactions may need some time to proceed.

BTC will arrive within 24 hours and other tokens will usually arrive within 30 minutes.

Orders will be valid for 24 hrs by default. The max valid duration is 10 days (max valid duration for Satoshi is 2 hours).

custom_value

String

Merchant custom field - This custom value field will be returned in transaction status notification.

notify_url

String

The URL address will be notified via a POST request when the order status changes. Ensure the URL is accessible to receive notifications from the payment platform.

Response (Success 200)

Header

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": {
		"amount": "0.5",//new parameter name: product_price
		"order_id": "202301090616511612332555323101184",
		"logo": "https://resource.cwallet.com/token/icon/usdt.png",
		"network": "TRC20",
		"pay_address": "TYWnk1EGALQyYst2yFSd29QQQTEkuKMbyt",
		"memo": "",
		"token_id": "0912e09a-d8e2-41d7-a0bc-a25530892988",
		"crypto": "USDT",
		"order_valid_period":823456
	}
}

Parameters

NameValueRequired TypeDescription

code

10000

Integer

msg

Success

String

data

Object

data.amount

0.5

String

new parameter name: product_price; Amount (in USD by default)

data.order_id

202301090616511612332555323101184

String

CCPayment order ID

data.logo

String

Token icon

data.network

TRC20

String

Pay on this Network

data.token_id

0912e09a-d8e2-41d7-a0bc-a25530892988

String

Token to request

data.pay_address

TYWnk1EGALQyYst2yFSd29QQQTEkuKMbyt

String

The temporary payment address for current order,only effectivewithin the order validity period.

data.memo

String

Memo/tag, Uniquely identifies

data.crypto

USDT

String

Token symbol

data.order_valid_period

823456

Integer

Request Body Example

{
  "remark": "",
  "token_id": "0912e09a-d8e2-41d7-a0bc-a25530892988",
  "product_price": "0.5",
  "merchant_order_id": "3735077979050379",
  "denominated_currency": "USD",
  "order_valid_period":823456
}

Step 2: Get deposit result

CCPayment will notify merchant of the final transaction result. Go to Webhook Configuration Guide.

pageAPI Deposit Webhook Notification

Once the merchant has processed the order, please return {http code: 200} and include a “success” string in the HTTP response body.

If CCPayment does not receive “success” as a response from the merchant, CCPayment will keep pushing the notification up to 6 times. Any response other than “success” will be regarded as a failure, and CCPayment will keep sending the notification.

Example

$this->response->setString("success")

✅ Now you have completed the entire integration process for native checkout!

Except for webhook notifications, you can get the order information via the Call Order Information Interface. The status of the API returned has a time lag with the webhook status maybe, Handle idempotency properly.

Native checkout diagram

Order status of API deposit

View order status in API Deposit tab.

Payment InfoOrder Within Valid PeriodOrder status

Non-payment

Yes

Awaiting payment

Non-payment

No

Expired

Part-payment

Yes

Underpayment

Part-payment

No

Underpayment(Overdue)

Paid in full

Yes

Paid

Paid in full

No

Paid(Overdue)

Overpayment

Yes

Overpayment

Overpayment

No

Overpayment(Overdue)

Last updated