API การทำรายการรับเงิน (Pay-In)
ประมาณ 3 นาที
API Pay-in ภูมิภาค USDT (USDT). ดู Payment methods。
Request
Pay-In API เปิดให้ร้านค้าสามารถเริ่มต้นธุรกรรมการรับเงินจากลูกค้าได้ API นี้รองรับวิธีการชำระเงินด้วยคริปโทเคอร์เรนซีหลายประเภท เพื่อให้การรับและจัดการสินทรัพย์ดิจิทัลมีความปลอดภัยและมีประสิทธิภาพ
Request Path:
sandbox:
https://sandbox-gateway.smilepayz.com/v2.0/transaction/pay-in
production:https://gateway.smilepayz.com/v2.0/transaction/pay-in
Header Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | application/json request body. |
| X-TIMESTAMP | M | String | Datetime with zone offset, format yyyy-MM-ddTHH:mm:ss±HH:mm |
| X-SIGNATURE | M | String | Signature of JSON body (see product Signature doc). |
| X-PARTNER-ID | M | String | Your merchantID |
Body Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| orderNo | M | String(32) | Merchant-unique id |
| purpose | M | String(64) | Memo to payer |
| merchant | M | Object | Wraps merchantId and optional sub-merchant fields. |
| merchantId | M | String | Smilepayz merchantId for this call. |
| merchantName | O | String | Merchant display name. |
| subMerchantId | O | String | Sub-merchant ID. |
| subMerchantName | O | String | Name for subMerchantId. |
| money | M | Object | Currency plus amount for this transaction. |
| currency | M | String | Fixed to USDT. |
| amount | M | Number | Amount |
| network | M | String | เครือข่ายบล็อกเชนที่ใช้สำหรับสกุลเงินดิจิทัล รูปแบบ: รหัสเครือข่ายที่กำหนดไว้ล่วงหน้า ตัวอย่าง: ERC20, BEP20, TRC20 ระบุเครือข่ายบล็อกเชนที่ใช้ประมวลผลธุรกรรม |
| productDetail | O | String(128) | รายละเอียดสินค้า หรือบริการ รูปแบบ: สตริงเข้ารหัส UTF-8 ความยาวสูงสุด: 128 ตัวอักษร ใช้เพื่อระบุและรายงานธุรกรรม |
| paymentMethod | O | String | See Payment methods doc. |
| expiryPeriod | O | Number | ExpiryPeriod, default 3600. |
| redirectUrl | O | String(256) | HTTPS post-pay return URL, max 256 chars. |
| callbackUrl | O | String(256) | HTTPS async status URL, max 256 chars. |
Example Body – Transaction Request:
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
"network": "TRC20",
"merchant": {
"merchantId": "20001",
"merchantName": "Smilepayz Demo Store"
},
"payer": {
"phone": "+66812345678",
"email": "[email protected]"
},
"money": {
"amount": 100,
"currency": "USDT"
},
"orderNo": "20001usdtwallet98b010db244c99d",
"paymentMethod": "WALLET",
"purpose": "Crypto checkout — demo invoice",
"redirectUrl": "https://docs.smilepayz.com/en/"
}
Response
HTTP Response
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | application/json response or callback body. |
| X-TIMESTAMP | M | String | Datetime with zone offset, format yyyy-MM-ddTHH:mm:ss±HH:mm |
Body Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| code | M | String | 00 success, other values error. |
| message | M | String | UTF-8 human-readable result line. |
| orderNo | M | String | Merchant-unique id |
| tradeNo | O | String | Smilepayz tradeNo for this order. |
| merchant | M | Object | Wraps merchantId and optional sub-merchant fields. |
| merchantId | M | String | Smilepayz merchantId for this call. |
| merchantName | O | String | Merchant display name. |
| subMerchantId | O | String | Sub-merchant ID. |
| subMerchantName | O | String | Name for subMerchantId. |
| money | M | Object | Currency plus amount for this transaction. |
| currency | M | String | Fixed to USDT. |
| amount | M | Number | Amount |
| transactionTime | M | String | Transaction completion timestamp Format: yyyy-MM-ddTHH:mm:ss Example: 2024-12-17T10:55:00 Used for transaction timing and audit |
| channel | M | Object | Channel payload (paymentUrl, qrString, …). |
| status | O | String | Order or payment status enum value. |
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
{
"channel": {
"paymentMethod": "WALLET",
"paymentUrl": "https://gateway-test.smilepayz.com/cashier/#/loading?tradeNo=3012003025112812141312194",
"cardData": {
"payeeBankCard": "TS8taf44vwibX7z4vE7aqrA7xVQjzzGKoZ",
"payAmount": 100.0,
"network": "TRC20"
}
},
"merchant": {
"accountNo": "11120001202406101410",
"merchantId": "20001",
"merchantName": "Smilepayz Demo Store"
},
"money": {
"amount": 100,
"currency": "USDT"
},
"orderNo": "20001usdtwallet98b010db244c99d",
"tradeNo": "3012003025112812141312194",
"status": "PROCESSING",
"transactionTime": "2024-11-19T12:51:47+07:00",
"code": "00",
"message": "Successful",
"responseCode": "2009000",
"responseMessage": "Successful"
}
Notification
HTTP Request
| Field | Required | Type | Description |
|---|---|---|---|
| Content-Type | M | String | application/json request body. |
| X-TIMESTAMP | M | String | Datetime with zone offset, format yyyy-MM-ddTHH:mm:ss±HH:mm |
| X-SIGNATURE | M | String | Callback body signature (see Callback signature guide). |
Body Parameters
| Field | Required | Type | Description |
|---|---|---|---|
| orderNo | M | String | Merchant-unique id |
| tradeNo | M | String | Smilepayz tradeNo for this order. |
| merchantId | M | String | Smilepayz merchantId for this call. |
| merchantName | M | String | Optional Merchant display name. |
| subMerchantId | O | String | Sub-merchant ID. |
| subMerchantName | O | String | Name for subMerchantId. |
| paymentMethod | M | String | See Payment methods doc. |
| transactionTime | M | String | Transaction completion timestamp Format: yyyy-MM-ddTHH:mm:ss Example: 2024-12-17T10:55:00 Used for transaction timing and audit |
| status | M | String | Order or payment status enum value. |
| money | M | Object | Currency plus amount for this transaction. |
| currency | M | String | Fixed to USDT. |
| amount | M | Number | Amount |
| payer | M | Object | Payer object per region rules (see Payer model). |
Return
การตอบกลับที่สำคัญ
Notification Response: โปรดตอบกลับด้วยสตริง
SUCCESSเพียงอย่างเดียว เพื่อยืนยันว่าระบบของคุณได้รับการแจ้งเตือนแล้ว
{
"orderNo": "20001usdtwallet98b010db244c99d",
"tradeNo": "3012003025112812141312194",
"merchantId": "20001",
"merchantName": "Smilepayz Demo Store",
"subMerchantId": "",
"subMerchantName": "",
"paymentMethod": "WALLET",
"transactionTime": "2024-11-19T12:51:47+07:00",
"status": "SUCCESS",
"money": {
"currency": "USDT",
"amount": 100
},
"payer": {
"name": "Demo Payer",
"email": "[email protected]"
}
}
SUCCESS
