OMI PAYMENT
Developer Platform
API Documentation

เชื่อมต่อ OMI PAYMENT ได้อย่างมั่นใจ

คู่มือสำหรับนักพัฒนา ตั้งแต่การสร้าง API Key การส่ง Request การอ่าน Response ไปจนถึงการจัดการ Error, Rate Limit และ Billing

API Key Authentication
JSON Response
HTTPS
Developer Console
API Integration Workspace
Ready
Base URL
https://api.thairak.store
Version
v1
Format
JSON
API Tester
ทดลองส่ง Request จาก Dashboard

ภาพรวม API

OMI PAYMENT ช่วยให้ระบบของคุณส่งรูปสลิป เพื่ออ่านข้อมูลธุรกรรม ตรวจสอบสถานะ และตรวจสอบยอดเงินที่คาดหวังผ่าน HTTP API

อัปโหลดรูปสลิป
รองรับ JPG, PNG และ WEBP
ตรวจสอบข้อมูล
อ่านผู้โอน ผู้รับ ยอดเงิน และเลขอ้างอิง
รับผลแบบ JSON
นำผลลัพธ์ไปใช้ในระบบได้ทันที

Authentication

ยืนยันตัวตนด้วย API Key

ทุกคำขอต้องส่ง API Key ผ่าน HTTP Header โดยสร้างและจัดการ API Key ได้จาก Dashboard

API Key Header
X-API-Key: YOUR_API_KEY
อย่าเปิดเผย API Key ใน Frontend หรือ Repository สาธารณะ ควรเรียก API จาก Backend ของระบบเท่านั้น

Quick Start

เริ่มใช้งานใน 3 ขั้นตอน

1
สมัครสมาชิก
สร้างบัญชีและเข้าสู่ Dashboard
2
สร้าง API Key
คัดลอก Secret Key และเก็บให้ปลอดภัย
3
ส่ง Request
ส่ง API Key พร้อมรูปแบบ multipart/form-data
Slip Verification

ตรวจสอบสลิป

POST
https://api.thairak.store/v1/slips/verify.php

Request Parameters

ชื่อ ประเภท จำเป็น รายละเอียด
slip_image File จำเป็น รูปสลิป JPG, PNG หรือ WEBP ขนาดไม่เกิน 10 MB
amount Number ไม่บังคับ ยอดเงินที่คาดหวัง เช่น 100 หรือ 100.50
เมื่อส่งค่า amount ระบบจะตรวจสอบว่ายอดเงินบนสลิป ตรงกับยอดที่ระบุหรือไม่

ตัวอย่างการเรียก API

เลือกภาษาที่ใช้ในระบบของคุณ

cURL
curl --request POST \
  --url https://api.thairak.store/v1/slips/verify.php \
  --header "X-API-Key: YOUR_API_KEY" \
  --form "slip_image=@/path/to/slip.jpg" \
  --form "amount=100.50"
PHP cURL
<?php

$curl = curl_init();

curl_setopt_array(
    $curl,
    [
        CURLOPT_URL =>
            'https://api.thairak.store/v1/slips/verify.php',

        CURLOPT_RETURNTRANSFER =>
            true,

        CURLOPT_POST =>
            true,

        CURLOPT_HTTPHEADER => [
            'X-API-Key: YOUR_API_KEY',
        ],

        CURLOPT_POSTFIELDS => [
            'slip_image' =>
                new CURLFile(
                    '/path/to/slip.jpg'
                ),

            'amount' =>
                '100.50',
        ],
    ]
);

$response = curl_exec(
    $curl
);

$httpStatus = curl_getinfo(
    $curl,
    CURLINFO_HTTP_CODE
);

curl_close(
    $curl
);

$data = json_decode(
    (string)$response,
    true
);

print_r(
    $data
);
JavaScript / Node.js
const formData = new FormData();

formData.append(
    'slip_image',
    slipFile
);

formData.append(
    'amount',
    '100.50'
);

const response = await fetch(
    'https://api.thairak.store/v1/slips/verify.php',
    {
        method: 'POST',

        headers: {
            'X-API-Key':
                'YOUR_API_KEY'
        },

        body:
            formData
    }
);

const result = await response.json();

console.log(
    result
);
ตัวอย่าง JavaScript เหมาะสำหรับ Backend Runtime เช่น Node.js ไม่ควรฝัง API Key ใน JavaScript ที่ทำงานบน Browser

Successful Response

HTTP 200

เมื่อคำขอสำเร็จ API จะตอบข้อมูลผลตรวจสอบ ข้อมูลธุรกรรม ค่าใช้จ่าย และ Request ID

HTTP 200
{
  "success": true,
  "message": "ตรวจสอบสลิปสำเร็จ",
  "data": {
    "request_id": "56570345-477a-4593-a3fd-c39e30f962ad",
    "verified": true,
    "slip": {
      "verified": true,
      "reference": "619115344637I000015B9790",
      "transaction_date": "2026-07-10T08:04:00.000Z",
      "amount": 100.5,
      "sender": {
        "bank_code": "030",
        "name": "ชื่อผู้โอน",
        "account": "0204xxxx4444"
      },
      "receiver": {
        "bank_code": "004",
        "name": "ชื่อผู้รับ",
        "account": "12xxxx2589"
      }
    },
    "billing": {
      "billable": true,
      "cost": 0.5,
      "balance_after": 299.5
    }
  }
}
data.verified
ผลการตรวจสอบหลักของคำขอ
data.slip.reference
เลขอ้างอิงรายการจากสลิป
data.billing.cost
ค่าบริการของ Request นี้
data.request_id
รหัสสำหรับติดตาม Request

Error Response

รูปแบบข้อผิดพลาดมาตรฐาน

{
  "success": false,
  "message": "เครดิตไม่เพียงพอ",
  "data": {
    "request_id": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
  },
  "error": {
    "code": "insufficient_credit"
  }
}

Error Codes

HTTP Error Code รายละเอียด
401 invalid_api_key API Key ไม่ถูกต้อง หรือไม่ได้ส่ง API Key
402 insufficient_credit เครดิตใน Wallet ไม่เพียงพอ
405 method_not_allowed เรียก Endpoint ด้วย Method ที่ไม่รองรับ
422 slip_image_required ไม่ได้ส่งไฟล์ slip_image
422 invalid_amount ยอดเงินที่ส่งมาไม่ถูกต้อง
429 rate_limit_exceeded เรียก API เกินขีดจำกัดของแพ็กเกจ
500 internal_error เกิดข้อผิดพลาดภายในระบบ
503 service_unavailable บริการหรือ Provider ยังไม่พร้อมใช้งาน

Rate Limit

จำนวน Request ขึ้นอยู่กับแพ็กเกจ และระบบส่งข้อมูลขีดจำกัดกลับผ่าน Response Header

X-RateLimit-Limit-Minute จำนวนสูงสุดต่อนาที
X-RateLimit-Remaining-Minute จำนวนที่เหลือในนาทีปัจจุบัน
X-RateLimit-Limit-Day จำนวนสูงสุดต่อวัน
X-RateLimit-Remaining-Day จำนวนที่เหลือภายในวัน
เมื่อเกินขีดจำกัด API จะตอบ HTTP 429 พร้อม Header Retry-After เพื่อแจ้งเวลาที่ควรรอก่อนเรียกใหม่

Billing และเครดิต

ค่าบริการจะถูกหักจาก Wallet ตามราคาแพ็กเกจและ Billing Mode ของบริการ

every_request
คิดค่าบริการทุก Request
success_only
คิดค่าบริการเมื่อ Provider ตอบสำเร็จ
verified_only
คิดค่าบริการเมื่อ verified เป็น true
ตรวจสอบค่าใช้จ่าย

สมาชิกสามารถดูเครดิตคงเหลือ ประวัติ Wallet ค่าใช้จ่ายของแต่ละ Request และยอดคงเหลือหลังหักได้จาก Dashboard

ดูราคาและแพ็กเกจ

พร้อมทดลองเรียก API จริง

ใช้ API Tester ใน Dashboard เพื่อเลือก API Key อัปโหลดรูปสลิป ส่ง Request และดูผลตอบกลับได้จากหน้าเดียว

เข้าสู่ระบบเพื่อทดสอบ API

ต้องการความช่วยเหลือ?

พบปัญหาในการเชื่อมต่อ หรือมีคำถามเกี่ยวกับ API สามารถติดต่อทีมงานพร้อมแจ้ง Request ID เพื่อช่วยให้ตรวจสอบได้รวดเร็วขึ้น

ติดต่อเรา