Server to Server Bank Transfer
Overview
Process bank transfers directly through your server using Cashonrails S2S APIs.
Integration Steps
- List Available Banks
- Initialize Bank Transfer
- Verify Transaction
Each step has specific requirements. Follow the detailed guides below for implementation.
Base URL
https://mainapi.stag.cashonrails.com/api/v1/s2s
1. List Available Banks
Retrieve list of available banks for transfer:
curl --location '{{baseurl}}/banktransfer/list' \
--header 'Authorization: Bearer YOUR_SECRET_KEY'
Sample Response:
{
"status": true,
"message": "Banks retrieved successfully",
"data": [
{
"name": "Wema Bank",
"code": "wema",
"logo": "https://..."
}
// ... other banks
]
}
2. Initialize Bank Transfer
Initialize a bank transfer transaction:
curl --location '{{baseurl}}/banktransfer/initialize' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer YOUR_SECRET_KEY' \
--data-raw '{
"email": "test@email.com",
"amount": "100",
"currency": "NGN",
"reference": "{{reference}}",
"provider": "wema"
}'
Parameter | Type | Required | Description |
---|---|---|---|
string | Yes | Customer’s email address | |
amount | string | Yes | Amount to transfer |
currency | string | Yes | Currency code (e.g., NGN) |
reference | string | Yes | Unique transaction reference |
provider | string | Yes | Bank code from banks list |
Sample Response:
{
"status": true,
"message": "Transfer initialized successfully",
"data": {
"reference": "COR_202402210123456789",
"account_number": "1234567890",
"account_name": "CASHONRAILS/TEST",
"bank_name": "Wema Bank",
"amount": "100",
"currency": "NGN"
}
}
3. 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. Bank transfers may take a few minutes to complete.