Skip to main content

🌐 Hosted Checkout Page Integration

Integrate with HaloPay's hosted checkout page. Customers are redirected to a HaloPay-hosted checkout page. Simplest integration with minimal front-end work.

📦 Step 1: Create Payment Order

Submit payment order and receive payment address

**POST** https://api.pay.halochat.io/api/entrust/pre-create

Return receiving address/QR code and order information

Headers

NameTypeDescription
X-Sign*StringhmacSHA256 (body (json string)+timestamp+appKey). Signature guide.
X-Timestamp*StringTimestamp in seconds (10-digit). The request is valid for two minutes.
X-Appid*StringMerchant's unique credential. Find it on the AppManage page.
content-type*Stringapplication/json

Request Body

NameTypeRequiredDescription
out_trade_noStringYesOrder ID in Merchant's system. A unique ID for every order
symbolStringYesFiat currency symbol
amountStringYesAmount (rounded to 2 decimal places)
nameStringNoProduct name
imageStringNoProduct image URL
describeStringNoProduct description
time_expireStringNoExpiration time (seconds), 0 indicates default
callback_urlStringNocallback url

Request Body Example

{
"out_trade_no": "uz54NEW9TVhLSIDHUSYB4aEFupKoE7I8",
"symbol": "USD",
"amount": "15",
"name": "PRODUCT_NAME",
"image": "https://callback.com/logo.png",
"describe": "CHECKOUT_DESCRIPTION",
"time_expire": 1773750780,
"callback_url": "https://callback.com/"
}

Response (Success 200)

Header

NameValueRequiredTypeDescription
X-Appidh3j6k9m2n...YStringMerchant's unique credential. Find it on the AppManage page.
X-Timestamp1677152490YStringTimestamp in seconds (10-digit). The request is valid for two minutes.
X-Signe0b78d93...YStringhmacSHA256 (body (json string)+timestamp+appKey). Signature guide.

Body

{
"code": 0,
"msg": "success",
"data": {
"url": "https://checkout.pay.halochat.io/202603172021145994e1572e91672b34",
"time_expire": 1773750780,
"trade_no": "202603172021145994e1572e91672b34"
}
}

Parameters

NameValueRequiredTypeDescription
code0trueInteger
messagesuccesstrueString
datatrueObject
data.urlhttps://checkout.pay.halochat.io/202603172021145994e1572e91672b34trueStringThe webpage address used for payment
data.time_expire1773754032trueIntegerPayment deadline
data.trade_no202603172021145994e1572e91672b34trueStringHaloPay order ID

Response (Fail 200)

{
"code": 10003,
"msg": "Params Error: Invalid amount",
"data": null
}
NameValueRequiredTypeDescription
code10003trueNumber
msgService error, please try againtrueString
datatrueObject
note

As a security measure, we will sign the returned data (and according to this only { code: 0 } should be signed, but it's signing all the returned body.). Additionally, it will return Appid, Sign, Timestamp in the header of the response. The signature method hmacSHA256 (body (json string)+timestamp+appKey). Please use the data with caution if the signature verification fails. It indicates that the data has been tampered with.

tip

The body of HTTP is a json string. Add the content in body of HTTP to the signature. Ensure the body content matches the signature content. As soon as HaloPay receives the request, the body content will be read and the signature will be verified.

Step 2: Configure Webhook to receive payout notification