Build with the PGLink API
One unified API for Xendit, Midtrans and Mayar.id. Create payments, payment links and subscriptions, then receive real-time webhooks โ without juggling three integrations.
Getting Started
Install, configure environment variables and run the aggregator locally.
API Reference
Applications, payments, payment links, subscriptions and callbacks.
Payment Providers
Compare Xendit, Midtrans and Mayar.id and pick the right one.
Mayar.id
Invoice-based payments, channels and the payment.received webhook.
Webhooks
Verify, process and secure provider callbacks forwarded to your app.
Architecture
Modules, the provider abstraction and how a payment flows through the system.
Quick start
- Register an application (JWT) to receive an
X-API-Key. - Create a payment with your provider of choice.
- Redirect the customer to the returned
checkoutUrl. - Receive a webhook at your application's
webhookUrlwhen it is paid.
Every provider is exposed through the same request shape. Only the
provider field and the provider-specific fields change.
curl -X POST http://localhost:3000/payments \
-H "X-API-Key: your-app-api-key" \
-H "Content-Type: application/json" \
-d '{
"amount": 50000,
"provider": "MAYAR",
"applicationOrderId": "ORDER-12345",
"customerName": "Budi Santoso",
"customerEmail": "budi@example.com",
"customerPhone": "081234567890",
"description": "Order #12345"
}'