Recurring Payment is only available for card transactions and not transfers.
Recurring Payment allows businesses to set up subscription-based payments. This operation collects essential details to create a recurring payment request, including the amount, currency, customer details, and subscription frequency. Customers can use this request to generate payment links, enabling the completion of payments through any payment card provider.
This payment request supports Mastercard, Visa, and Verve cards for transactions in NGN (Nigerian Naira) and USD (United States Dollar).
Request
METHOD: POST
Endpoint: https://api.hydrogenpay.com/bepay/api/v1/merchant/initiate-payment
Request parameters
Mandatory | Type | Name | Comment |
---|---|---|---|
Yes | Decimal | amount | Amount to debit the customer. |
Yes | Customerβs Email Address. | ||
Yes | String | customerName | Customer's name. |
No | String | currency | Default to NGN if not passed, other currencies available are USD and GBP. |
No | String | description | Payment Description. |
No | String | meta | Contains any other information you want to be recorded with the transaction. |
No | String | transactionRef | Unique transaction ref for Payment. It will be automatically generated for you if you don't specify. |
Yes | String | callback | Redirect URL after payment has been completed on the gateway. |
Yes | String | frequency | Frequency of recurring payment: 0 - Daily, 1 - Weekly, 2 - Monthly, 3 - Quarterly, 4 - Yearly, 5 - Disable auto debit. |
Yes | Boolean | isRecurring | Indicates if the payment is recurring. |
Yes | String | endDate | End date for the recurring payment cycle in ISO 8601 format (e.g., 2024-10-29T19:01:41.745Z). |
Set frequency to 5 if you would like to charge the cards for subsequent purchase manually.
Success Response
Field | Type | Value |
---|---|---|
statusCode | Integer | 90000 |
message | String | Initiate Payment Saved Successfully. |
transactionRef | String | Transaction Client Reference |
url | String | Payment gateway redirect URL |
Missing Callback Response
Field | Type | Value |
---|---|---|
statusCode | String | 10001 |
message | String | Callback is Required |
data | Object | null |
Invalid Currency Response
Field | Type | Description |
---|---|---|
statusCode | String | 10001 |
message | String | Invalid Currency |
data | Object | null |
Missing Field Response
Field | Type | Description |
---|---|---|
statusCode | String | 400 |
success | Boolean | false |
message | String | Validation Failed |
error | Object | List of validation errors |
Sample Request
{
"amount": 50,
"customerName": "Dev Test",
"email": "[email protected]",
"currency": "NGN",
"description": "test desc",
"meta": "test meta",
"callback": "https://hydrogenpay.com",
"frequency": 1,
"isRecurring": true,
"endDate": "2024-12-29T19:01:41.745Z"
}
Sample Response
{
"statusCode": "90000",
"message": "Initiate payment Saved successfully.",
"data": {
"transactionRef": "36934683_547155b0f1",
"url": "https://payment.hydrogenpay.com?transactionId=699d0000-3f48-c6a3-2cd5-08dcf72f50dd&Mode=19289182"
}
}