การรับชำระเงิน (Pay-In · ไทย)API Pay-in ภูมิภาค ไทย (THB ). ดู Payment methods 。
Request POST /v2.0/transaction/pay-in
Request Path: sandbox: https://sandbox-gateway.smilepayz.com/v2.0/transaction/pay-in production: https://gateway.smilepayz.com/v2.0/transaction/pay-in
Field Required Type Description Content-TypeM String application/json request body.X-TIMESTAMPM String Format: yyyy-MM-ddTHH:mm:ss±HH:mm X-SIGNATUREM String Signature of JSON body (see product Signature doc). X-PARTNER-IDM String Your merchantID (alphanumeric).
Body Parameters Field Required Type Description orderNoM String(32) Merchant-unique id, 6–32 alphanumeric. purposeM String(64) Memo to payer, 1–64 UTF-8 chars. merchantM Object Wraps merchantId and optional sub-merchant fields. merchantId M String Smilepayz merchantId for this call. merchantName O String UTF-8 merchant display name. subMerchantId O String Sub-merchant ID. subMerchantName O String UTF-8 name for subMerchantId . moneyM Object Currency plus amount for this transaction. currency M String Fixed to THB . amount M Number THB amount as integer per channel rules. payerM Object Payer object per region rules (see Payer model). name M String Beneficiary full name (UTF-8). accountNo M String Settlement accountNo if gateway returns it. bankName M String Bank code (e.g. KBANK , BBL , SCB ); see Payment methods doc. paymentMethodM String Code (see Payment methods doc). expiryPeriodO Number Session TTL seconds , default 3600 , max 86400 unless noted. redirectUrlO String(256) HTTPS post-pay return URL, max 256 chars. callbackUrlO String(256) HTTPS async status URL, max 256 chars.
Example Body – Transaction Request: Header Min Body
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
X-SIGNATURE: 7MHd9v5/m9JeqmDZVwWBZUZ5J5...7120QnFEny7Qm7uQR1G0TWCh10fsU6nVxiRoeoQ==
X-PARTNER-ID: 20001
{
"orderNo" : "20001e9d98b010db244c99d457c" ,
"purpose" : "Purpose For Transaction from Java SDK" ,
"merchant" : {
"merchantId" : "20001"
} ,
"money" : {
"currency" : "THB" ,
"amount" : 10000
} ,
"payer" : {
"name" : "test" ,
"accountNo" : "123456789009" ,
"bankName" : "KBANK"
} ,
"paymentMethod" : "QRPAY" ,
"redirectUrl" : "https://docs.smilepayz.com/en/"
}
Responses HTTP Request Field Required Type Description Content-TypeM String application/json request body.X-TIMESTAMPM String Format: yyyy-MM-ddTHH:mm:ss±HH:mm
Body Parameters Field Required Type Description codeM String 00 success, other values error.messageM String UTF-8 human-readable result line. orderNoM String Merchant-unique id, 6–32 alphanumeric. tradeNoO String Smilepayz tradeNo for this order. merchantM Object Wraps merchantId and optional sub-merchant fields. merchantId M String Smilepayz merchantId for this call. merchantName O String UTF-8 merchant display name. subMerchantId O String Sub-merchant ID. subMerchantName O String UTF-8 name for subMerchantId . moneyM Object Currency plus amount for this transaction. currency M String Fixed to THB . amount M Number THB amount as integer per channel rules. payAmount O Number Settled amount after fees (decimal THB). transactionTimeM String yyyy-MM-ddTHH:mm:ss±HH:mmchannelM Object Channel payload (paymentUrl , qrString , …). paymentMethod O String Code (see Payment methods doc). paymentUrl M String Cashier URL to open for the payer. qrString O String PIX or channel copy-paste string if returned. receiverBankName O String Bank code when channel is bank transfer. vaNumber O String VA / reference when returned. statusO String Order or payment status enum value.
Header QRPAY Response Body BANK Response Body
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
{
"code" : "00" ,
"message" : "Successful" ,
"orderNo" : "878d95fe75ef4c49b11d266afa8dd849" ,
"tradeNo" : "111200012411191251468673" ,
"merchant" : {
"merchantId" : "20001" ,
"merchantName" : "test" ,
"accountNo" : "11120001202406101410"
} ,
"money" : {
"currency" : "THB" ,
"amount" : 300 ,
"payAmount" : 299.98
} ,
"transactionTime" : "2024-11-19T12:51:47+07:00" ,
"channel" : {
"paymentMethod" : "QRPAY" ,
"paymentUrl" : "https://gateway.smilepayz.com/cashier/#/loading?tradeNo=111200572411191251468673" ,
"qrString" : "00020101021229370016A0000006770101110113006680870163353037645406299.985802TH63048436"
} ,
"status" : "PROCESSING"
}
{
"code" : "00" ,
"message" : "Successful" ,
"orderNo" : "20011b5baff0ed8ac4f0c873920e" ,
"tradeNo" : "1112001125042408363186433" ,
"merchant" : {
"merchantId" : "20011" ,
"merchantName" : "bradytest123www" ,
"accountNo" : "11120011202402290943"
} ,
"money" : {
"currency" : "THB" ,
"amount" : 100 ,
"payAmount" : 99.99
} ,
"transactionTime" : "2025-04-24T08:36:32+07:00" ,
"channel" : {
"paymentMethod" : "BANK" ,
"paymentUrl" : "https://gateway.smilepayz.com/cashier/#/loading?tradeNo=1112001125042408363186433" ,
"receiverBankName" : "KBANK" ,
"vaNumber" : "2053617290"
} ,
"status" : "PROCESSING"
}
Notification/Callback HTTP Request Field Required Type Description Content-TypeM String application/json request body.X-TIMESTAMPM String Format: yyyy-MM-ddTHH:mm:ss±HH:mm X-SIGNATUREM String Callback body signature (see Callback signature guide ).
Body Parameters Field Required Type Description orderNoM String Merchant-unique id, 6–32 alphanumeric. tradeNoM String Smilepayz tradeNo for this order. merchantIdM String Smilepayz merchantId for this call. merchantNameM String UTF-8 merchant display name. subMerchantIdO String Sub-merchant ID. subMerchantNameO String UTF-8 name for subMerchantId . paymentMethodM String Code (see Payment methods doc). transactionTimeM String Format: yyyy-MM-ddTHH:mm:ss statusM String Order or payment status enum value. moneyM Object Currency plus amount for this transaction. currency M String Fixed to THB . amount M Number THB amount as integer per channel rules. payAmount O Number Net amount when returned. payerO Object Payer object per region rules (see Payer model).
Return Important
Respond with the string SUCCESS only.
Request Response
{
"orderNo" : "20001f7d65167e8b1419896f2dfb" ,
"tradeNo" : "111200012412151710505955" ,
"merchantId" : "20001" ,
"merchantName" : "test" ,
"subMerchantId" : "" ,
"subMerchantName" : "" ,
"paymentMethod" : "QRPAY" ,
"transactionTime" : "2024-12-15T17:10:51" ,
"status" : "SUCCESS" ,
"money" : {
"currency" : "THB" ,
"amount" : 150
} ,
"payer" : {
"name" : "payerName" ,
"accountNo" : "*****25432"
}
}
ถัดไป
การโอนจ่าย (Pay-out · ไทย)