API Keys

Your API Credentials

ใช้ API Key เหล่านี้เพื่อเชื่อมต่อ ZynexPay กับเว็บไซต์หรือแอปของคุณ ห้ามเปิดเผย Secret Key ให้ผู้อื่น

Live Keys

Production
Publishable Key ใช้ฝั่ง Frontend — สามารถเปิดเผยได้
Secret Key ใช้ฝั่ง Backend เท่านั้น — ห้ามเปิดเผย!
อย่าฝัง Secret Key ในโค้ดฝั่ง Frontend หรือ Mobile App — ใช้งานผ่าน Server เท่านั้น

Test Keys

Sandbox
Test Publishable Key ใช้ทดสอบฝั่ง Frontend — ไม่มีการเรียกเก็บเงินจริง
Test Secret Key ใช้ทดสอบฝั่ง Backend — ไม่มีการเรียกเก็บเงินจริง

Quick Start Guide

1
Copy API Keys

คัดลอก Publishable Key และ Secret Key ด้านบน

2
Install SDK

ติดตั้ง ZynexPay SDK ลงในโปรเจกต์ของคุณ

3
Configure Keys

ตั้งค่า API Key ในโค้ดของคุณ

4
Go Live!

ทดสอบด้วย Test Keys แล้วเปลี่ยนเป็น Live Keys เมื่อพร้อม

Example: Initialize ZynexPay
// Server-side (Node.js)
const zynexpay = require('zynexpay');

zynexpay.configure({
  secretKey: 'sk_live_YOUR_SECRET_KEY',
  version: '2026-03-01'
});

// Create a payment
const payment = await zynexpay.payments.create({
  amount: 1500.00,     // THB
  currency: 'THB',
  description: 'Order #1234',
  callback_url: 'https://yoursite.com/webhook'
});

Regenerate API Keys