Tích hợp trong 5 phút. Gọi API đầu tiên của bạn ngay bây giờ.
Tạo tài khoản Pay27 và lấy API Key chỉ trong 30 giây. API Key sẽ được dùng để xác thực mọi request sau này.
curl -X POST https://api.pay27.vn/v1/auth/register \
-H "Content-Type: application/json" \
-d '{
"email": "dev@yourcompany.vn",
"password": "your-secure-password",
"name": "Your Company"
}'
# Response
{
"id": "usr_abc123",
"email": "dev@yourcompany.vn",
"api_key": "pb_live_x1y2z3a4b5c6d7e8f9",
"plan": "starter"
}Console Dashboard - API Key Management
(Screenshot placeholder - Bảng quản lý API Key)
Tạo payout đầu tiên qua endpoint POST /v1/payouts. Chọn cổng thanh toán, số tiền, đơn vị tiền tệ và người nhận.
curl -X POST https://api.pay27.vn/v1/payouts \
-H "Authorization: Bearer pb_live_x1y2z3..." \
-H "Content-Type: application/json" \
-d '{
"gateway": "paypal",
"amount": 100.00,
"currency": "USD",
"recipient": "recipient@example.com",
"note": "Thanh toán tháng 6/2026"
}'
# Response
{
"id": "txn_9k8j7h6g5f",
"status": "processing",
"gateway": "paypal",
"amount": 100.00,
"currency": "USD",
"created_at": "2026-06-02T07:30:00Z"
}// Cài đặt: npm install @pay27/sdk
import { Pay27 } from "@pay27/sdk";
const client = new Pay27({
apiKey: "pb_live_x1y2z3a4b5c6d7e8f9",
environment: "production",
});
const payout = await client.payouts.create({
gateway: "paypal",
amount: 100.0,
currency: "USD",
recipient: "recipient@example.com",
note: "Thanh toán tháng 6/2026",
});
console.log(payout.id); // txn_9k8j7h6g5f
console.log(payout.status); // processing# Cài đặt: pip install pay27-sdk
from pay27 import Pay27Client
client = Pay27Client(
api_key="pb_live_x1y2z3a4b5c6d7e8f9",
environment="production"
)
payout = client.payouts.create(
gateway="paypal",
amount=100.00,
currency="USD",
recipient="recipient@example.com",
note="Thanh toán tháng 6/2026"
)
print(payout.id) # txn_9k8j7h6g5f
print(payout.status) # processingExpose một endpoint trên server của bạn để nhận thông báo giao dịch real-time. Pay27 sẽ gửi POST request với chữ kýHMAC-SHA256 để bạn xác thực.
// Webhook endpoint (Express.js)
const express = require("express");
const crypto = require("crypto");
const app = express();
app.post("/webhooks/pay27", express.json(), (req, res) => {
const signature = req.headers["x-pay27-signature"];
const secret = process.env.PAY27_WEBHOOK_SECRET;
// Verify signature
const payload = JSON.stringify(req.body);
const expected = crypto
.createHmac("sha256", secret)
.update(payload)
.digest("hex");
if (signature !== expected) {
return res.status(401).json({ error: "Invalid signature" });
}
// Xử lý event
const { event, data } = req.body;
switch (event) {
case "payout.completed":
console.log(`Payout ${data.id} thành công!`);
break;
case "payout.failed":
console.error(`Payout ${data.id} thất bại`);
break;
}
res.json({ received: true });
});
app.listen(3000, () => console.log("Webhook server running on :3000"));Endpoint cần expose
POST endpoint public (HTTPS), trả về 200 OK trong 5 giây.
Luôn verify signature
Dùng secret từ Dashboard để HMAC-SHA256 verify payload.
Chỉ với 3 bước đơn giản, bạn đã có thể nhận thanh toán từ 27 cổng toàn cầu qua một API duy nhất. Bắt đầu ngay hôm nay.