PAYMENT API DOCS

API Documentation
สำหรับระบบรับชำระเงิน

เอกสารการใช้งาน API สำหรับเชื่อมต่อ PromptPay, TrueWallet และ Verify Slip พร้อมตัวอย่างโค้ดและ response ที่นำไปใช้งานต่อได้ทันที

Quick Reference
Bearer
Auth Header
JSON
Request Body
100/min
Rate Limit

Base URL

All API requests use this origin

https://api.inwcloud.shop
Authentication
Authorization: Bearer YOUR_API_KEY

คุณสามารถขอรับ API Key ได้จากหน้า Dashboard ของคุณ และต้องส่งผ่าน Header ในทุก Request

Generate QR Code

สร้าง QR Code พร้อมเพย์แบบระบุจำนวนเงิน

POST
Endpoint
/v1/promptpay/generate

Request Example

import axios from 'axios';

const response = await axios.post(
    'https://api.inwcloud.shop/v1/promptpay/generate',
    {
        amount: 10
    },
    {
        headers: {
            'Authorization': 'Bearer YOUR_API_KEY'
        }
    }
);

console.log(response.data);

Response Example

{
  status: 'success',
  data: {
    transactionId: 'Market-1-.....',
    qr_url: 'https://api.qrserver.com/v1/create-qr-code/?data=inwcloud&size=300x300&ecc=M&format=png&qzone=1&charset-source=UTF-8&charset-target=UTF-8',
    payload: '000201010.....',
    amount: '10.98',
    expires_at: 1764246956
  },
  rate_limit: { limit: 50, remaining: 49, tier: 'free' },
  customer_type: 'existing'
}

Verify QR Code

ยืนยันการชำระเงินด้วย transactionId

POST
Endpoint
/v1/promptpay/check

Request Example

import axios from 'axios';

const response = await axios.post(
    'https://api.inwcloud.shop/v1/promptpay/check',
    {
        transactionId: 'Market-1........'
    },
    {
        headers: {
            'Authorization': 'Bearer YOUR_API_KEY'
        }
    }
);

console.log(response.data);

Response Example

{
  status: 'success',
  message: 'ชำระเงินสำเร็จ',
  transactionId: 'Market-1......',
  amount: '10.95',
  customer_type: 'existing',
  cost: 0
}
NEED HELP?

ต้องการให้ช่วยเชื่อมต่อ API ใช่ไหม?

ทีมงานสามารถช่วยตรวจ flow การชำระเงิน วาง endpoint และแนะนำการใช้งานให้เหมาะกับระบบของคุณ