Initial Recurring Payment
In order to process recurring payments, you need to process a first payment in that row. This is technically the way for the customer to accept the terms and conditions of the payment. It is also the way to get payment credentials from the customers, as they are on-session for the first payment. Subsequent recurring payments will be processed in the background without a customer on-session.
Request
Find the API documentation for the request here.
POST /payments/recurring
The payload for the request is very straightforward and in the simplest case looks like this:
{
"amount": 1000,
"currency_code": "EUR",
"reference": "Order #12345",
"recurring_frequency": 28,
"recurring_expiry": "20301010",
"source": {
"type": "checkout"
}
}
Remarks
- Hellgate® encodes amounts in minor units of the respective currency. The example above would be 10.00 EUR.
- The
source.type
denotes that the payment will be initated fully in the front-end, and the card details need to be entered there. - The
recurring_frequency
is the minimum distance between the two payments. In this case, it would be 28 days. - The
recurring_expiry
is the date until which the recurring payment is valid. In this case, it would be 10 October 2030.
All of the payments in the sequence of recurring payments must have an amount less or equal to the initial payment. This is a requirement of the recurring payment provider. If you need to change the amount, you need to process a new initial payment.
Response
Hellgate® responds with a HTTP 200 OK and a JSON payload. The payload contains the session ID to handle the action requirement:
{
"id": "54ba1fdb-7e4e-402b-aebb-66f9d5345cf8",
"amount": {
"requested": 1000
},
"action_requirement": {
"type": "use_sdk",
"session_id": "d5b8e449-13da-4594-bf00-643146fb35d1"
},
"created_at": "2023-10-10T00:00:00Z",
"credential_id": "54ba1fdb-7e4e-402b-aebb-66f9d5345cf8"
"currency_code": "EUR",
"reference": "Order #12345",
"recurring_expiry": "20231010",
"recurring_frequency": 28,
"status": "processing",
"use_case": "RECURRING"
}
This use-case automatically creates payment credentials on file for the customer.
The credential_id
allows you to refer to the credentials in later actions.