Pay with Moniepoint
Overview
Process Moniepoint payments directly through your server using Cashonrails S2S APIs.
Integration Steps
- Initialize Moniepoint Payment
- Verify Transaction
- Cancel Transaction
Each step has specific requirements. Follow the detailed guide below for implementation.
Base URL
https://api.cashonrails.com/api/v1/s2s
1. Initialize Moniepoint Payment
Initialize a Moniepoint payment transaction:
curl --location '{{baseurl}}/moniepoint/initialize' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--data-raw '{
"email": "test@email.com",
"amount": "100",
"currency": "NGN",
"reference": "{{reference}}"
}'| Parameter | Type | Required | Description |
|---|---|---|---|
| string | Yes | Customer’s email address | |
| amount | string | Yes | Amount to charge |
| currency | string | Yes | Currency code (e.g., NGN) |
| reference | string | Yes | Unique transaction reference |
Sample Response:
{
"success": true,
"message": "Account generated successfully",
"data": {
"total_amount": "100",
"account_name": "John Doe Test",
"account_number": 14771243030,
"bank_name": "Moniepoint",
"expires": "2026-01-02T10:52:05.763658Z",
"_links": {
"url": "https://api.cashonrails.com/api/v1/checkout/verify-transaction/s2sref_768706372376985",
"method": "GET"
}
}
}2. Verify Transaction
Always verify the transaction status:
curl -X GET '{{baseurl}}/transaction/verify/{reference}' \
-H "Authorization: Bearer YOUR_SECRET_KEY"Sample Response:
{
"status": true,
"message": "Transaction verified successfully",
"data": {
"reference": "COR_202402210123456789",
"amount": "100",
"currency": "NGN",
"status": "success",
"payment_method": "bank_transfer"
}
}Always verify transaction status before confirming payment. Payments may take a few minutes to complete.
3. Cancel Transaction
You can cancel a transaction that is still pending or in progress:
curl -X GET {{baseurl}}/transaction/cancel/{reference} \
-H "Authorization: Bearer YOUR_SECRET_KEY"Replace {reference} with your transaction reference.
Cancellation Rules
- Only pending or processing transactions can be cancelled
- Completed transactions cannot be cancelled (use refund instead)
- Failed transactions are already inactive and don’t need cancellation
- Once cancelled, a transaction cannot be resumed
Last updated on