Build powerful payment experiences with PayGate's comprehensive API
PayGate API is designed to be simple and intuitive. All requests are made to api.paygate.liper.io over HTTPS.
Authentication is handled via API keys. Include your API key in the Authorization header as a Bearer token.
curl -X GET https://api.paygate.liper.io/v1/transactions \
-H "Authorization: Bearer sk_live_xxxxx" \
-H "Content-Type: application/json"Each PayGate account comes with two API keys: a publishable key and a secret key. Use the secret key for server-side requests only.
Live Secret Key:
sk_live_51234567890abcdef⚠️ Security Note: Never expose your secret key in client-side code. Always keep it server-side only.
Initialize a new payment transaction
{
"amount": 10000,
"currency": "NGN",
"customer_id": "cust_abc123",
"customer_email": "customer@example.com",
"description": "Order #12345",
"escrow": true,
"metadata": {
"order_id": "12345",
"user_id": "user_xyz"
}
}{
"id": "txn_1234567890",
"status": "pending",
"amount": 10000,
"currency": "NGN",
"customer_id": "cust_abc123",
"escrow": true,
"payment_link": "https://pay.paygate.io/txn_1234567890",
"created_at": "2024-03-29T12:30:00Z",
"expires_at": "2024-03-30T12:30:00Z"
}Retrieve details of a specific transaction
GET /v1/payments/{id}curl -X GET https://api.paygate.liper.io/v1/payments/txn_1234567890 \
-H "Authorization: Bearer sk_live_xxxxx"{
"id": "txn_1234567890",
"status": "completed",
"amount": 10000,
"currency": "NGN",
"customer_id": "cust_abc123",
"escrow": true,
"escrow_status": "held",
"payment_method": "card",
"card_last4": "4242",
"metadata": {...},
"created_at": "2024-03-29T12:30:00Z",
"completed_at": "2024-03-29T12:31:00Z"
}Release held escrow funds to the recipient
POST /v1/payments/{id}/release{
"reason": "service_completed",
"metadata": {
"released_by": "merchant_id"
}
}{
"id": "txn_1234567890",
"status": "completed",
"escrow_status": "released",
"released_at": "2024-03-29T13:00:00Z",
"settlement_reference": "sett_1234567890"
}Create a full or partial refund for a completed transaction
POST /v1/payments/{id}/refund{
"amount": 5000,
"reason": "customer_request",
"notes": "Partial refund for cancelled item"
}Webhooks allow you to receive real-time notifications about payment events. Configure your webhook endpoint in the PayGate dashboard.
payment.createdA new payment has been initiated
payment.pendingPayment is awaiting confirmation
payment.completedPayment has been successfully completed
payment.failedPayment attempt failed
escrow.heldFunds have been held in escrow
escrow.releasedEscrow funds have been released
payment.refundedPayment has been refunded
{
"id": "evt_1234567890",
"type": "payment.completed",
"data": {
"id": "txn_1234567890",
"status": "completed",
"amount": 10000,
"currency": "NGN",
"customer_id": "cust_abc123"
},
"created_at": "2024-03-29T12:31:00Z"
}The API uses standard HTTP status codes to indicate success or failure. Error responses include a detailed error message.
OK - Request succeeded
Bad Request - Invalid parameters
Unauthorized - Invalid or missing API key
Forbidden - Access denied
Not Found - Resource does not exist
Too Many Requests - Rate limit exceeded
Internal Server Error
npm install @paygate/sdkpip install paygate-sdkgo get github.com/paygate/sdk-goCheck our comprehensive guides, contact our support team, or join our developer community.