Documentation

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.

Quick start

  1. Register an application (JWT) to receive an X-API-Key.
  2. Create a payment with your provider of choice.
  3. Redirect the customer to the returned checkoutUrl.
  4. Receive a webhook at your application's webhookUrl when 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"
  }'