跳到主要内容

Payment Request

Request

API URL: /merchant/payment

HeaderContentDescription
Content-Typetext/plain
Authorization{token_type} {access_token}Concat token_type and access_token with whitespace.
ParamTypeRequiedSignatureDescription
user_idStringMerchant identification
order_idStringPayment order Id of merchant system. The order id should be unique.
amountStringTransaction amount (Support up to 6 decimal places)
currencyStringPlease refer to Currencies & Channels
channelStringPlease refer to Currencies & Channels
bank_codeStringOptionalIf this param is provided, you need to add it to the sign string.
real_nameStringOptionalRequired for RMB transactions to comply with China government regulations.
callback_urlURLThe url to receive callback request from PTS when transaction complete.
redirect_urlURLWhen the payment process finished, the client will be redirected to this URL.
timestampIntegerRequest timestamp (10 digits)
remarkStringRemark
signStringSignature string

Response

There are three types of payment response methods.

提示

You should notify PTS customer service to configure this for you to match actual usage situation.

Redirect

Return a javascript code with redirect_url, the user will be redirected to actual payment webpage automatically.

HTML

Return a html input form to user with automatically submit javascript. You should forward entire response content to user and make sure html and javascript workable.

JSON

Return request result in JSON format (when response code=1000)

ParamTypeRequiredSignDescription
user_idStringMerchant identification
order_idStringPayment order Id of merchant system. The order id should be unique.
transaction_idStringPTS transaction id
channelStringPlease refer to Currencies & Channels
submit_currencyStringSubmit currency
submit_amountFloatSubmit amount (Support up to 6 decimal places)
accept_currencyStringThe currency real paid
accept_amountFloatPaid amount of accept currency (Support up to 6 decimal places)
exchange_rateFloatExchange rate
pay_urlURLThe webpage which to pay the amount
wallet_addressStringCrypto exclusive, if need, please inform customer service staff
expired_atIntegerCrypto exclusive, if need, please inform customer service staff
signStringSignature string
// Example
{
"code": "1000",
"message": "Accepted",
"data": {
"user_id": 1,
"order_id": "20210521184906",
"transaction_id": "P12021052118495503889",
"channel": "CNY2TRC",
"submit_currency": "CNY",
"submit_amount": 1000,
"accept_currency": "USDT-TRC",
"accept_amount": 165.9181999999,
"exchange_rate": 0.1659182,
"sign": "jgtOKfV48sOD2NjBZ4WhiAUMwTgux9fTH53jNzNR..."
}
}

Cashier

While payment request channel assigned to cashier means channel and currency are not specified. PTS will return cashier_url and let user make decision on their own.

// Example: response of request with channel="cashier"
{
"cashier_url": "https://example.com/cashier?order_id=TP20210715135507&token=3281DCF1C8A6D7AFA0B96CFDD874F417"
}