API Reference · v1.0

Payment Gateway API

Payment Gateway API

REST API for merchant integration — payments, withdrawals, settlement & webhooks.
REST API สำหรับเชื่อมต่อระบบ Merchant — ฝากเงิน ถอนเงิน Settlement และ Webhook

This documentation covers all HTTP endpoints exposed by the gateway, along with the asynchronous webhook callbacks delivered to your notify_url when payment, withdrawal, or settlement orders complete.

เอกสารนี้ครอบคลุมทุก HTTP endpoint ที่ payment gateway เปิดให้เรียกใช้
พร้อมทั้งระบบ Webhook ที่จะส่งสถานะกลับไปที่ notify_url ของคุณ เมื่อรายการฝากเงิน ถอนเงิน หรือ Settlement เสร็จสมบูรณ์

🤖 Building with an AI assistant?
🤖 ใช้ AI ช่วยเขียนโค้ดอยู่ใช่ไหม?

Download llms-full.md — a single, self-contained reference (~86 KB Markdown) covering all endpoints, webhooks, errors, and integration patterns. Paste it into ChatGPT, Claude, Cursor, or Copilot along with your task to get accurate, production-ready integration code.

ดาวน์โหลด llms-full.md — เอกสารอ้างอิงไฟล์เดียว (~86 KB Markdown) ครอบคลุมทุก endpoint, webhook, error, และ integration pattern
paste เข้า ChatGPT, Claude, Cursor หรือ Copilot พร้อมโจทย์ของคุณ เพื่อให้ AI สร้างโค้ด integration ที่ถูกต้องและพร้อม production

⬇ Download llms-full.md ⬇ ดาวน์โหลด llms-full.md
📮 Prefer Postman? Download the collection
📮 ใช้ Postman? ดาวน์โหลด collection ไปลองเลย

Grab paymentstack-api.postman_collection.json — a ready-to-run Postman collection covering every endpoint. Import it, set four collection variables (baseUrl, merchant_id, token, secret), and press Send. A built-in pre-request script computes the X-SIGNATURE HMAC for you on every call — no manual signing.

ดาวน์โหลด paymentstack-api.postman_collection.json — Postman collection พร้อมใช้ ครบทุก endpoint
Import แล้วตั้งค่าตัวแปร 4 ตัว (baseUrl, merchant_id, token, secret) จากนั้นกด Send ได้เลย
หมายเหตุ: มี pre-request script คำนวณ X-SIGNATURE (HMAC) ให้อัตโนมัติทุกครั้ง ไม่ต้องเซ็นเอง

⬇ Download Postman collection ⬇ ดาวน์โหลด Postman collection

What you'll find here

เนื้อหาในเอกสารนี้

The API uses HMAC-SHA256 signature authentication over plain JSON requests. All endpoints are POST and require a signed body containing your merchant_id, token, and time (Unix epoch seconds). Start with the Getting Started guide, then read Authentication & Signature before jumping into endpoint references.

API ใช้ HMAC-SHA256 signature สำหรับยืนยันตัวตน
ทุก endpoint เป็น POST และ body ต้องมี merchant_id, token, และ time เสมอ
แนะนำให้อ่าน Getting Started ก่อน ตามด้วย Authentication & Signature แล้วค่อยดู endpoint ที่ต้องการ

Endpoints at a glance

รายการ Endpoint

Account

บัญชี

Payments (Deposit)

การฝากเงิน

POST/payment/create
Create QR payment
สร้างคำสั่งฝาก (QR)
Generate a PromptPay QR code for the customer to scan and pay.
สร้าง PromptPay QR ให้ลูกค้าสแกนเพื่อชำระเงิน
POST/payment/create-transfer
Create bank transfer payment
สร้างคำสั่งฝาก (โอน)
Issue a bank transfer instruction (no QR) for the customer to deposit.
สร้างรายการโอนเงินผ่านธนาคาร (ไม่มี QR)
POST/payment/create-flex
Create flex payment (auto channel)
สร้างคำสั่งฝาก (flex — เลือก channel อัตโนมัติ)
One call — the gateway picks the best channel and returns a single payment link.
เรียกครั้งเดียว — ระบบเลือก channel ที่ดีที่สุดให้ แล้วส่งลิงก์ชำระเงินกลับมาลิงก์เดียว
POST/payment/query
Query payment status
เช็คสถานะการฝาก
Look up the current status and details of a payment order.
ตรวจสอบสถานะและรายละเอียดของรายการฝาก
POST/slip/upload
Upload payment slip
อัปโหลดสลิป
Submit a payment slip image for QR verification when needed.
ส่งภาพสลิปเพื่อใช้ตรวจสอบ QR

Withdrawals (Payout)

การถอนเงิน

Settlement (THB)

Settlement (THB)

Webhooks

Webhooks

Conventions used in this guide

รูปแบบที่ใช้ในเอกสาร

  • Code examples are shown in cURL, Node.js, and PHP. Use the tabs above each code block to switch.
  • ตัวอย่างโค้ดมีให้ทั้ง cURL, Node.js, และ PHP สลับได้ด้วยแท็บด้านบนของ code block
  • The placeholder https://<your-api-domain> represents the API base URL provisioned by your payment gateway admin.
  • https://<your-api-domain> คือ placeholder ของ base URL ที่ Payment gateway admin จะแจ้งให้คุณทราบ
  • The placeholder <your-merchant-webhook-URL> represents your own webhook receiver — the URL you tell us to call when an order completes.
  • <your-merchant-webhook-URL> คือ URL webhook ฝั่งคุณ ที่ระบบเราจะเรียกเมื่อรายการสำเร็จ
  • All amounts are in Thai Baht (THB) unless stated otherwise.
  • จำนวนเงินทั้งหมดเป็น Thai Baht (THB) เว้นแต่จะระบุไว้
  • All timestamps in callback payloads are Unix milliseconds.
  • Timestamp ใน callback payload ทุกตัวเป็น Unix milliseconds