Logo
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

  1. Create Payment - Merchant creates a payment with paymentMethod: 'promptpay'
  2. Generate QR Code - One2Pays generates a QR code for the customer
  3. Customer Scans - Customer scans QR code with their banking app
  4. Payment Confirmed - Payment is confirmed instantly
  5. 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

  1. Customer sees QR code on payment page
  2. Opens mobile banking app
  3. Scans QR code or enters phone number
  4. Confirms payment in banking app
  5. Payment is confirmed instantly

Best Practices

  1. Display QR Code Clearly - Ensure QR code is large and clear
  2. Provide Instructions - Guide customers on how to use PromptPay
  3. Handle Timeouts - PromptPay payments expire after a set time
  4. Monitor Webhooks - Listen for payment status updates via webhooks

On this page