Recurring Payment allows businesses to set up subscription-based payments. This endpoint is used to make subsequent purchases using a stored card token obtained from a previous recurring payment. This is specifically for card transactions.
Request
METHOD: POST
Endpoint: <https://api.hydrogenpay.com/bepay/api/v1/Payment/Subsequentpurchase>
Request Parameters
Mandatory | Type | Name | Comment |
---|---|---|---|
Yes | String | transactionRef | Unique reference for the transaction. |
Yes | String | cardToken | Unique reference for the transaction. |
No | String | currency | Default to NGN if not passed, other currencies available are USD and GBP. |
Yes | Decimal | amount | Amount to be charged from the card. |
cardToken is part of the response from the callback.
Response Parameters
Field | Type | Description |
---|---|---|
statusCode | String | 90000 |
message | String | Validation Failed |
data | Object | List of validation errors |
responseCode | String | Code indicating the result of the transaction. |
responseDescription | String | Description of the transaction result. |
transactionReference | String | Reference for the transaction. |
amount | Number | Amount charged. |
remittanceAmount | Number | Amount remitted. |
customerName | String | Name of the customer. |
transactionStatus | String | Detailed transaction status. |
maskedPan | String | Masked Primary Account Number of the card. |
cardExpiry | String | Encrypted card expiry details. |
transactionId | String | Unique ID for the transaction. |
completedTimeUtc | String | Time when the transaction was completed (in UTC). |
canRetry | Boolean | Indicates if the transaction can be retried. |
callBackUrl | String | URL for callbacks. |
recurringCardToken | String | Token for the recurring card. |
Sample Request
{
"transactionRef": "30002699_371243f9e2",
"cardToken": "4f89ebb9-f98b-4c3c-82f6-2f9f2ff67ff2",
"currency": "NGN",
"amount": 50000
}
Sample Response
{
"statusCode": "90000",
"message": null,
"data": {
"responseCode": "0000",
"responseDescription": "Approved by Financial Institution",
"transactionReference": "30002699_371243f9e2",
"amount": 50000,
"remittanceAmount": 50000,
"customerName": "Test Payment",
"transactionStatus": "Paid",
"maskedPan": "462294******3705",
"cardExpiry": "U07ztgi5V7Gkrit2Zd6mLVaQEpFDpY2wMkKBuPY92nqp90/c78SYS1ojOY/+B3N5DDxu8kuKKCbZ/723JzweaQ==",
"transactionId": "49d60000-48af-96b2-a74f-08dc8853e8d9",
"completedTimeUtc": "Jun 9th 2024 | 07:15am",
"canRetry": true,
"callBackUrl": "",
"recurringCardToken": "4f89ebb9-f98b-4c3c-82f6-2f9f2ff67ff2"
}
}