Payment Methods
PromptPay
PromptPay is Thailand's national payment system that allows instant money transfers using phone numbers or national ID numbers.
Overview
PromptPay enables customers to pay instantly using their mobile banking app by scanning a QR code or entering a phone number/national ID.
Features
- Instant Payments - Funds are transferred immediately
- Wide Acceptance - Supported by all major Thai banks
- No Fees - No transaction fees for customers
- Secure - Uses bank-level security
Payment Flow
- Create Payment - Merchant creates a payment with
paymentMethod: 'promptpay' - Generate QR Code - One2Pays generates a QR code for the customer
- Customer Scans - Customer scans QR code with their banking app
- Payment Confirmed - Payment is confirmed instantly
- Webhook Notification - Merchant receives webhook notification
Creating a PromptPay Payment
import crypto from 'crypto';
const API_KEY = process.env.PAYMENT_API_KEY!;
const API_SECRET = process.env.PAYMENT_API_SECRET!;
async function createPromptPayPayment() {
const method = 'POST';
const path = '/api/v1/payments';
const body = JSON.stringify({
amount: '1000.00',
currency: 'THB',
referenceId: 'order-12345',
paymentMethod: 'promptpay',
customerBankAccountName: 'John Doe',
customerBankAccountNumber: '1234567890',
customerBankCode: '004',
description: 'Payment for order #12345',
});
const timestamp = Date.now().toString();
const message = `${timestamp}.${body}`;
const signature = crypto
.createHmac('sha256', API_SECRET)
.update(message)
.digest('hex');
const response = await fetch(`https://api.example.com${path}`, {
method,
headers: {
'X-API-Key': API_KEY,
'X-Timestamp': timestamp,
'X-Signature': `sha256=${signature}`,
'Content-Type': 'application/json',
},
body,
});
const result = await response.json();
// Check nextAction to see if QR code/payment app URL is available
if (result.data.nextAction?.type === 'use_payment_app') {
// Redirect customer to payment page with QR code
window.location.href = result.data.nextAction.paymentAppUrl;
}
}Payment Limits
- Minimum: 1.00 THB
- Maximum: 200,000 THB per transaction
- Daily Limit: Varies by bank (typically 200,000 THB)
Processing Time
- Instant - Payments are confirmed immediately
- Webhook Delivery - Webhooks are sent within seconds of payment confirmation
Customer Experience
- Customer sees QR code on payment page
- Opens mobile banking app
- Scans QR code or enters phone number
- Confirms payment in banking app
- Payment is confirmed instantly
Best Practices
- Display QR Code Clearly - Ensure QR code is large and clear
- Provide Instructions - Guide customers on how to use PromptPay
- Handle Timeouts - PromptPay payments expire after a set time
- Monitor Webhooks - Listen for payment status updates via webhooks