API Documentation

Panduan lengkap integrasi Paydigital API

Panduan Pengguna (Umum)

1

Pendaftaran & Login

Daftar akun baru menggunakan email dan password. Setelah berhasil, Anda akan masuk ke halaman Dashboard.

2

Membuat Toko / Bisnis Baru

Di halaman Dashboard, masukkan nama Toko atau Bisnis Anda di kolom yang tersedia lalu klik "Buat Toko". Anda wajib memiliki setidaknya satu toko untuk menerima pembayaran.

3

Menerima Pembayaran (QRIS)

Klik tombol Terima Pembayaran di Dashboard. Lalu isi nominal (minimal Rp 1.000) dan nama pelanggan (opsional).

Sistem akan otomatis menambahkan kode unik (contoh: Anda isi Rp 10.000, tagihan bisa jadi Rp 10.387).
4

Barcode QRIS Siap Discan!

Akan muncul gambar QRIS di layar. Tunjukkan ke pelanggan atau download gambar tersebut dan kirim via WhatsApp. Pembayaran akan otomatis terdeteksi jika berhasil.

Integrasi API (Khusus Developer)

Gunakan API di bawah ini jika Anda ingin mengintegrasikan pembayaran otomatis ke website atau bot Anda sendiri.

1. Otentikasi & API Key

Dapatkan API Key Anda dari menu Toko di Dashboard. Semua request API memerlukan pengiriman API Key melalui form data api_key atau Header: Authorization: Bearer {API_KEY}.

POST

Create Payment

https://paydigital.biz.id/api/create_payment.php

Form Data (POST)

Parameter Tipe Keterangan
api_keyStringWajib
store_idIntWajib (ID Toko Anda)
amountIntMinimal 1000
descriptionStringOpsional (Deskripsi pembayaran)
customer_nameStringOpsional (Nama pelanggan)

Contoh Response Berhasil (JSON)

{ "status": "success", "data": { "invoice": "PYG20231201123456", "amount": 10000, "unique_code": 387, "total_amount": 10387, "qr_content": "000201010212266....DBD7", "qr_url": "https://api.qrserver.com/v1/create-qr-code/?size=300x300&data=...", "payment_url": "http://paydigital.biz.id/pay.php?invoice=PYG20231201123456", "expired_at": "2023-12-01 15:00:00" } }

Contoh Request (cURL)

curl -X POST http://paydigital.biz.id/api/create_payment.php \ -H "Authorization: Bearer PYG1234567890abcdef" \ -d "store_id=1" \ -d "amount=10000" \ -d "description=Pembelian Produk A" \ -d "customer_name=John Doe"

Contoh Request (PHP cURL)

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://paydigital.biz.id/api/create_payment.php"); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query([ 'store_id' => 1, 'amount' => 10000, 'description' => 'Pembelian Produk A', 'customer_name' => 'John Doe' ])); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer PYG1234567890abcdef" ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Contoh Request (Node.js Fetch)

fetch("http://paydigital.biz.id/api/create_payment.php", { method: "POST", headers: { "Authorization": "Bearer PYG1234567890abcdef", "Content-Type": "application/x-www-form-urlencoded" }, body: new URLSearchParams({ "store_id": "1", "amount": "10000", "description": "Pembelian Produk A", "customer_name": "John Doe" }) }) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.log('error', error));
GET/POST

Cek Status Pembayaran

http://paydigital.biz.id/api/payment.php?invoice={invoice}

Parameter Request

Parameter Tipe Keterangan
api_keyStringWajib
invoiceStringWajib (Nomor invoice transaksi)

Contoh Response Berhasil (JSON)

{ "status": "success", "data": { "invoice": "PYG20231201123456", "amount": 10000, "unique_code": 387, "total_amount": 10387, "status": "paid", "paid_at": "2023-12-01 14:30:00", "customer_name": "John Doe", "store_name": "Toko Example" } }

Contoh Request (cURL)

curl -X GET "http://paydigital.biz.id/api/payment.php?invoice=PYG20231201123456" \ -H "Authorization: Bearer PYG1234567890abcdef"

Contoh Request (PHP cURL)

<?php $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, "http://paydigital.biz.id/api/payment.php?invoice=PYG20231201123456"); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Authorization: Bearer PYG1234567890abcdef" ]); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); echo $response; ?>

Contoh Request (Node.js Fetch)

fetch("http://paydigital.biz.id/api/payment.php?invoice=PYG20231201123456", { method: "GET", headers: { "Authorization": "Bearer PYG1234567890abcdef" } }) .then(response => response.json()) .then(result => console.log(result)) .catch(error => console.log('error', error));

Error Codes

Code Message Description
400 Bad Request Parameter tidak valid atau kurang
401 Unauthorized API Key tidak valid atau kadaluarsa
404 Not Found Resource tidak ditemukan
429 Too Many Requests Rate limit terlampaui
500 Internal Server Error Error server internal