PayGet API Documentation

Complete API reference for PayGet integration

GET Get Profile

Mendapatkan detail profil pengguna berdasarkan API Key

/api/profile
Authentication
Type Key Value
Header x-api-key YOUR_API_KEY
Query Param apiKey YOUR_API_KEY
Example Request
GET /api/profile HTTP/1.1 Host: https://payget.sakuin.id x-api-key: YOUR_API_KEY
Success Response (200)
{ "success": true, "profile": { "username": "john_doe", "level": "member", "balance": 100000 } }
Error Responses
{ "success": false, "message": "API Key is required." }

{ "success": false, "message": "Invalid API Key." }
API Playground
Response:
POST Create Payment

Membuat permintaan pembayaran (top up saldo)

/api/payment
Authentication
Type Key Value
Header x-api-key YOUR_API_KEY
Header Content-Type application/json
Body Parameters
Parameter Type Required Description
amount number Required Minimal 100, maksimal 5.000.000
Example Request
POST /api/payment HTTP/1.1 Host: https://payget.sakuin.id x-api-key: YOUR_API_KEY Content-Type: application/json { "amount": 50000 }
Success Response (200)
{ "success": true, "message": "Payment request created successfully.", "paymentId": "a1b2c3d4e5f6g7h8", "qrCode": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA...", "amount": 50000, "balanceReceived": 50000, "fee": 0 }
Fee Structure:
  • Saldo masuk dipotong 0,8% untuk amount > Rp 500.000
  • Tidak ada potongan untuk amount <= Rp 500.000
  • Jumlah minimal: Rp 100
  • Jumlah maksimal: Rp 5.000.000
  • Payment expired dalam 10 menit
  • QRIS code dalam format base64
API Playground
Response:
POST Cancel Payment

Membatalkan payment milik API key yang sedang berstatus Pending

/api/payment/:id/cancel
Authentication
Type Key Value
Header x-api-key YOUR_API_KEY
Path Parameters
Parameter Type Required Description
id string Required Payment ID yang ingin dibatalkan
Example Request
POST /api/payment/a1b2c3d4e5f6g7h8/cancel HTTP/1.1 Host: https://payget.sakuin.id x-api-key: YOUR_API_KEY
Success Response (200)
{ "success": true, "message": "Payment cancelled successfully", "payment": { "id": "a1b2c3d4e5f6g7h8", "status": "Expired" } }
Catatan:
  • Hanya payment Pending yang dapat dibatalkan
  • Payment Success atau Expired tidak dapat dibatalkan
  • Payment harus milik API key yang digunakan
GET Payment Status

Mengecek status pembayaran berdasarkan Payment ID

/api/payment-status/:id
Path Parameters
Parameter Type Required Description
id string Required Payment ID yang ingin dicek
Example Request
GET /api/payment-status/a1b2c3d4e5f6g7h8 HTTP/1.1 Host: https://payget.sakuin.id
Success Response (200)
{ "success": true, "status": "Pending", "id": "a1b2c3d4e5f6g7h8", "amount": 50000 }
Status Payment:
  • Pending: Menunggu konfirmasi
  • Success: Berhasil dikonfirmasi
  • Expired: Kadaluarsa (lebih dari 10 menit)
API Playground
Response: