API PAYIN
Request
The Pay-In API enables merchants to initiate payment collection transactions from customers.
Supported payment methods include:
QRPAY (Quick Response Payment)
Bank transfers
Digital wallets
Credit/debit cards
Other digital payment channels
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 | HTTP content type specification Fixed value: application/json Required for proper request parsing |
X-TIMESTAMP | M | String | ISO 8601 datetime format with timezone offset Format: yyyy-MM-ddTHH:mm:ss±HH:mm Example: 2020-12-17T10:55:00+07:00 Note: Must be current server time within ±5 minutes |
X-SIGNATURE | M | String | Digital signature for request authentication. See Signature Generation |
X-PARTNER-ID | M | String | Unique merchant identifier assigned by the platform Format: Alphanumeric string Used for merchant authentication and transaction routing Please enter merchantID |
Body Parameters
Field | Required | Type | Description |
---|---|---|---|
orderNo | M | String(32) | Unique transaction identifier for merchant tracking Format: Alphanumeric characters only Length: 6-32 characters Must be unique within merchant scope |
purpose | M | String(64) | Human-readable transaction description Format: UTF-8 encoded string Length: 1-64 characters Used for transaction history and reporting |
merchant | M | Object | Merchant identification and business information container Contains primary and sub-merchant details Required for transaction routing and settlement |
merchantId | M | String | Primary merchant identifier assigned by the platform Format: Alphanumeric string Used for transaction routing and settlement processing |
merchantName | O | String | Registered business name of the merchant Format: UTF-8 encoded string Displayed in payment interface and transaction records |
subMerchantId | O | String | Sub-merchant identifier for multi-level merchant structures Format: Alphanumeric string Required for sub-merchant transaction processing |
subMerchantName | O | String | Sub-merchant business name for display purposes Format: UTF-8 encoded string Shown in payment interface and transaction records |
money | M | Object | Transaction amount and currency specification container Defines payment value and monetary unit Required for payment processing and settlement |
currency | M | String | ISO 4217 currency code specification Fixed value: THB (Thai Baht) Determines payment processing rules and settlement currency |
amount | M | Number | Transaction amount in smallest currency unit Format: Integer value Example: 200 represents THB 200.00 Range: 100-999999999 |
payer | M | Object | Customer payment information container Used for payment verification and customer communication |
name | M | String | Customer full name for payment verification Format: UTF-8 encoded string Used for payment processing and transaction records |
accountNo | M | String | Customer bank account number for payment processing Format: numeric string Used for bank transfer payment verification |
bankName | M | String | Customer bank name for payment processing Format: Predefined bank codes Examples: KBANK, BBL, SCB See Payment Method List |
paymentMethod | M | String | Preferred payment method specification Fixed Value: QRPAY or KBANK See Payment Method List |
expiryPeriod | O | Number | Payment session timeout duration in seconds Format: Integer value Default: 3600 seconds (1 hour) |
redirectUrl | O | String(256) | Post-payment redirect destination URL Format: Valid HTTP/HTTPS URL Maximum length: 256 characters Customer is redirected here after payment completion |
callbackUrl | O | String(256) | Webhook notification endpoint URL Format: Valid HTTP/HTTPS URL Maximum length: 256 characters Receives real-time transaction status updates |
Important Notes
1. Payment Method Selection: If paymentMethod is not specified, Smilepayz will return a checkout page for customers to select their preferred payment method
2. Payer Information Requirement: When paymentMethod is specified, you must provide the payer name, account number, and bank name for payment verification
3. Bank Name Reference: For supported bank names, please see Payment Method List
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
{
"payer": {
"name": "test",
"accountNo": "123456789009",
"bankName": "KBANK"
},
"merchant": {
"merchantId": "20001"
},
"money": {
"amount": 10000,
"currency": "THB"
},
"orderNo": "20001e9d98b010db244c99d457c",
"paymentMethod": "QRPAY",
"purpose": "Purpose For Transaction from Java SDK",
"redirectUrl": "https://docs.smilepayz.com/en/"
}
Response
HTTP Response
Field | Required | Type | Description |
---|---|---|---|
Content-Type | M | String | HTTP response content type specification Fixed value: application/json Indicates JSON response format |
X-TIMESTAMP | M | String | ISO 8601 datetime format with timezone offset Format: yyyy-MM-ddTHH:mm:ss±HH:mm Example: 2020-12-17T10:55:00+07:00 |
Body Parameters
Field | Required | Type | Description |
---|---|---|---|
code | M | String | API response status code indicating operation result Format: Two-digit string Success: "00", Error: Other codes Used for programmatic response handling |
message | M | String | Human-readable response status description Format: UTF-8 encoded string Provides detailed information about the operation result Localized based on request language |
orderNo | M | String | Original merchant transaction identifier for reference Format: Same as request orderNo Used for transaction tracking and reconciliation |
tradeNo | O | String | Internal transaction reference number for system tracking Format: System-generated alphanumeric string Used for internal transaction management and support |
merchant | M | Object | Merchant information container with account details Contains merchant identification and account information See Merchant Model |
merchantId | M | String | Primary merchant identifier assigned by the platform Format: Alphanumeric string Used for transaction routing and settlement processing |
merchantName | O | String | Registered business name of the merchant Format: UTF-8 encoded string Displayed in payment interface and transaction records |
subMerchantId | O | String | Sub-merchant identifier for multi-level merchant structures Format: Alphanumeric string Required for sub-merchant transaction processing |
subMerchantName | O | String | Sub-merchant business name for display purposes Format: UTF-8 encoded string Shown in payment interface and transaction records |
money | M | Object | Transaction amount details with currency specification Contains confirmed payment amount and currency See Money Model |
currency | M | String | ISO 4217 currency code specification Fixed value: THB (Thai Baht) Determines payment processing rules and settlement currency |
amount | M | Number | Transaction amount in smallest currency unit Format: Integer value Example: 200 represents THB 200.00 Range: 100-999999999 |
payAmount | O | Number | Actual payment amount after fees and adjustments Format: Decimal value Example: 199.98 represents THB 199.98 Used for settlement calculations |
transactionTime | M | String | ISO 8601 datetime format (yyyy-MM-ddTHH:mm:ss±HH:mm) Example: 2020-12-17T10:55:00+07:00 Timestamp when transaction was processed by the system |
channel | M | Object | Payment processing channel details and instructions Contains payment method, URLs, and additional data See Channel Model |
status | O | String | Current transaction processing status Format: Predefined status codes Examples: PROCESSING, SUCCESS, FAILED See Status Model |
Content-type: application/json
X-TIMESTAMP: 2020-12-17T10:55:00+07:00
{
"channel": {
"additionalInfo": {},
"paymentMethod": "QRPAY",
"paymentUrl": "https://gateway.smilepayz.com/cashier/#/loading?tradeNo=111200572411191251468673",
"qrString": "00020101021229370016A0000006770101110113006680870163353037645406299.985802TH63048436"
},
"merchant": {
"accountNo": "11120001202406101410",
"merchantId": "20001",
"merchantName": "test"
},
"money": {
"amount": 300,
"payAmount": 299.98,
"currency": "THB"
},
"orderNo": "878d95fe75ef4c49b11d266afa8dd849",
"status": "PROCESSING",
"tradeNo": "111200012411191251468673",
"transactionTime": "2024-11-19T12:51:47+07:00"
}
{
"channel": {
"additionalInfo": {},
"paymentMethod": "BANK",
"paymentUrl": "https://gateway.smilepayz.com/cashier/#/loading?tradeNo=1112001125042408363186433",
"receiverBankName": "KBANK",
"vaNumber": "2053617290"
},
"code": "00",
"merchant": {
"accountNo": "11120011202402290943",
"merchantId": "20011",
"merchantName": "bradytest123www"
},
"message": "Successful",
"money": {
"amount": 100,
"payAmount": 99.99,
"currency": "THB"
},
"orderNo": "20011b5baff0ed8ac4f0c873920e",
"status": "PROCESSING",
"tradeNo": "1112001125042408363186433",
"transactionTime": "2025-04-24T08:36:32+07:00"
}
Notification
HTTP Request
Field | Required | Type | Description |
---|---|---|---|
Content-Type | M | String | HTTP notification content type specification Fixed value: application/json Indicates JSON payload format |
X-TIMESTAMP | M | String | ISO 8601 datetime format with timezone offset Format: yyyy-MM-ddTHH:mm:ss±HH:mm Example: 2020-12-17T10:55:00+07:00 |
X-SIGNATURE | M | String | Digital signature for notification verification Format: Base64 encoded signature Used to verify notification authenticity See how to check this value |
Body Parameters
Field | Required | Type | Description |
---|---|---|---|
orderNo | M | String | Original merchant transaction identifier for reference Format: Same as request orderNo Used for transaction reconciliation and tracking |
tradeNo | M | String | Internal transaction reference number for system tracking Format: System-generated alphanumeric string Used for internal transaction management and support |
merchantId | M | String | Primary merchant identifier for transaction routing Format: Alphanumeric string Used for merchant identification and settlement processing |
merchantName | M | String | Registered merchant business name for display Format: UTF-8 encoded string Shown in transaction records and reports |
subMerchantId | O | String | Sub-merchant identifier for multi-level structures Format: Alphanumeric string Included when sub-merchant is involved in transaction |
subMerchantName | O | String | Sub-merchant business name for display purposes Format: UTF-8 encoded string Included when sub-merchant is involved in transaction |
paymentMethod | M | String | Payment method used for transaction processing Format: Predefined payment method codes Examples: QRPAY, BANK Indicates the actual payment channel used |
transactionTime | M | String | ISO 8601 datetime format (yyyy-MM-ddTHH:mm:ss±HH:mm) Timestamp when transaction was completed by payment provider |
status | M | String | Final transaction processing status Format: Predefined status codes Examples: SUCCESS, FAILED Indicates the final outcome of the transaction See Status Model |
money | M | Object | Final transaction amount details with currency Contains confirmed payment amount and currency May differ from request amount due to fees or adjustments See Money Model |
currency | M | String | ISO 4217 currency code specification Fixed value: THB (Thai Baht) Determines payment processing rules and settlement currency |
amount | M | Number | Transaction amount in smallest currency unit Format: Integer value Example: 200 represents THB 200.00 Range: 100-999999999 |
payAmount | O | Number | Actual payment amount after fees and adjustments Format: Decimal value Example: 199.98 represents THB 199.98 Used for settlement calculations |
payer | M | Object | Customer information provided during payment Format: Customer data object Contains payer details when available See Payer Model |
Return
Important
Notification please return only string SUCCESS
{
"merchantId": "20001",
"merchantName": "test",
"money": {
"amount": 150,
"currency": "THB"
},
"orderNo": "20001f7d65167e8b1419896f2dfb",
"payer": {
"name": "payerName",
"accountNo": "*****25432"
},
"paymentMethod": "QRPAY",
"status": "SUCCESS",
"tradeNo": "111200012412151710505955",
"transactionTime": "2024-12-15T17:10:51"
}
SUCCESS