Developer Guide
Integrate Payrant's powerful payment APIs into your application with our comprehensive documentation, code examples, and interactive guides.
Getting Started
Base URL
Authentication
All API requests require authentication using a Bearer token in the Authorization header:
YOUR_API_KEY with your actual API key from the Payrant dashboard.
Authentication
Payrant uses API keys to authenticate requests. You can view and manage your API keys in the Payrant dashboard.
Getting Your API Key
- Sign up for a Payrant account
- Navigate to the API section in your dashboard
- Generate a new API key
- Copy and securely store your API key
Virtual Accounts API
Create Virtual Account
Creates a new Payrant virtual account linked to user's NIN for receiving payments.
Headers
| Key | Value | Description |
|---|---|---|
| Content-Type | application/json | Request content type |
| Authorization | Bearer YOUR_API_KEY | Your API authentication token |
Request Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| documentType | string | Yes | Type of document (e.g., "nin") |
| documentNumber | string | Yes | NIN number or document identifier |
| virtualAccountName | string | Yes | Name for the virtual account |
| customerName | string | Yes | Customer's full name |
| string | Yes | Customer's email address | |
| accountReference | string | Yes | Unique reference for the account |
Response (Success)
200 OK
Checkout API
Initialize Checkout Transaction
Create a new checkout transaction and generate a virtual account for payment collection.
Headers
| Key | Value | Description |
|---|---|---|
| Content-Type | application/json | Request content type |
| Authorization | Bearer YOUR_API_KEY | Your API authentication token |
Request Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Customer's email address | |
| amount | number | Yes | Transaction amount in NGN |
| callback_url | string | No | URL to redirect after payment |
| webhook_url | string | No | URL to receive payment notifications |
| metadata | object | No | Additional data (order_id, customer_name, etc.) |
Response (Success)
200 OK
Response (Error)
400 Bad Request
Verify Checkout Transaction
Check the status of a checkout transaction using its reference.
Headers
| Key | Value | Description |
|---|---|---|
| Authorization | Bearer YOUR_API_KEY | Your API authentication token |
URL Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| reference | string | Yes | Transaction reference from initialize response |
Response (Success)
200 OK
Response (Not Found)
404 Not Found
Payout API
Bank Transfer / Payout
Initiate a bank transfer to any Nigerian bank account. Supports all major banks and fintech companies.
Headers
| Key | Value | Description |
|---|---|---|
| Content-Type | application/json | Request content type |
| Authorization | Bearer YOUR_API_KEY | Your API authentication token |
Request Body
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| bank_code | string | Yes | Bank code (e.g., "090405" for Moniepoint) |
| account_number | string | Yes | Recipient's account number |
| account_name | string | Yes | Recipient's account name |
| amount | number | Yes | Transfer amount (minimum 10 NGN) |
| description | string | No | Transfer description/remark |
| notify_url | string | No | Your webhook URL for transfer notifications |
Response (Success)
200 OK
Response (Error)
400 Bad Request
Validate Account Name
Validate and retrieve the account name for a given bank code and account number before initiating a transfer.
Request Body
Response (Success)
200 OK
Get Available Banks
Retrieve a list of all supported Nigerian banks and their codes.
Response (Success)
200 OK
Webhooks
Webhooks allow you to receive real-time notifications about payment events. Payrant will send HTTP POST requests to your specified webhook URLs when events occur.
Payment Webhook
Receive notifications when payments are made to your virtual accounts or checkout transactions.
Headers
| Key | Value | Description |
|---|---|---|
| Content-Type | application/json | Content type of the payload |
| X-Payrant-Signature | HMAC-SHA256 signature | Webhook signature for verification |
| X-Payrant-Event | payment.successful | Event type (for checkout payments) |
Webhook Payload (Virtual Account Payment)
Webhook Payload (Checkout Payment)
• Checkout Payments:
"account_name": "Checkout Transaction (Payrant)"• Virtual Account Payments:
"account_name": "user@email.com(Payrant)"
Webhook Verification (PHP)
Transfer Status Webhook
Receive notifications when transfer status changes (processing, completed, failed).
Webhook Events
| Event | Description |
|---|---|
| transfer.processing | Transfer initiated and being processed |
| transfer.completed | Transfer successful, funds delivered |
| transfer.failed | Transfer failed, funds refunded |