Skip to main content

Recurring Payments (1.0)

Download OpenAPI specification:Download

Recurring Payments API requests specification

Recurring payments

Recurring payments Public API requests specification

Create draft recurring payment

Create draft recurring payment which can be processed later

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec
Request Body schema: application/json
reference
required
string <= 12 characters ^[a-z0-9-]+$
recurringAmount
required
string^[0-9]*.[0-9]{2}$

The amount of money that will come to your bank account from the client during the active period of regular payments

recurringPaymentDate
required
string

Javascript date. First payment date of recurring payment. Note: Due to banks requirements , the first payment date must be 6 working days in the future.

numberOfPayments
required
integer

Expected number of payments. Set 0 for indefinite

frequency
required
string
Enum: "one_week" "one_month" "three_months" "one_year"

Time interval between payments.

initialPaymentAmount
string^[0-9]*.[0-9]{2}$

Set if you want to request single immediate payment

customerName
string
customerEmail
string

Responses

Request samples

Content type
application/json
{
  • "reference": "12345abc",
  • "recurringAmount": "0.50",
  • "recurringPaymentDate": "2022-12-24T00:00:00Z",
  • "numberOfPayments": 0,
  • "frequency": "one_week",
  • "initialPaymentAmount": "0.50",
  • "customerName": "John Doe",
  • "customerEmail": "email@example.com"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "created": true,
  • "result": {
    }
}

Create and process recurring payment

Create and process recurring payment. Recurring payment and initial payment(if present) status will be 'sent' and link will be generated

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec
Request Body schema: application/json
reference
required
string <= 12 characters ^[a-z0-9-]+$
recurringAmount
required
string^[0-9]*.[0-9]{2}$

The amount of money that will come to your bank account from the client during the active period of regular payments

recurringPaymentDate
required
string

Javascript date. First payment date of recurring payment. Note: Due to banks requirements , the first payment date must be 6 working days in the future.

numberOfPayments
required
integer

Expected number of payments. Set 0 for indefinite

frequency
required
string
Enum: "one_week" "one_month" "three_months" "one_year"

Time interval between payments.

initialPaymentAmount
string^[0-9]*.[0-9]{2}$

Set if you want to request single immediate payment

customerName
string
customerEmail
string

Responses

Request samples

Content type
application/json
{
  • "reference": "12345abc",
  • "recurringAmount": "0.50",
  • "recurringPaymentDate": "2022-12-24T00:00:00Z",
  • "numberOfPayments": 0,
  • "frequency": "one_week",
  • "initialPaymentAmount": "0.50",
  • "customerName": "John Doe",
  • "customerEmail": "email@example.com"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "success": true,
  • "result": {
    }
}

Get recurring payment

Get recurring payments data by ID

path Parameters
id
required
string
Example: 62b48c5b6ba2cd6a040b20a8

Mongoose Object ID of the target entity

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "id": "3858f642-e92f-431c-9d38-46d15efb7fba",
  • "invoiceRefNumber": "ref-123456",
  • "recurringAmount": "0.50",
  • "firstPaymentDate": "2022-12-24T00:00:00Z",
  • "finalPaymentDate": "2022-12-24T00:00:00Z",
  • "expectedNumberOfPayments": 0,
  • "frequency": "one_week",
  • "status": "sent",
  • "initialPayment": {
    },
  • "customerName": "John Doe",
  • "customerEmail": "email@example.com",
  • "createdAt": "2022-12-24T00:00:00Z",
  • "currency": "string",
  • "qrCodeData": "string"
}

List recurring payments

Get list of recurring payments

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec

Responses

Response samples

Content type
application/json; charset=utf-8
[
  • {
    }
]

Edit recurring payment

Edit recurring payment data

path Parameters
id
required
string
Example: 62b48c5b6ba2cd6a040b20a8

Mongoose Object ID of the target entity

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec
Request Body schema: application/json
reference
required
string <= 12 characters ^[a-z0-9-]+$
recurringAmount
required
string^[0-9]*.[0-9]{2}$

The amount of money that will come to your bank account from the client during the active period of regular payments

recurringPaymentDate
required
string

Javascript date. First payment date of recurring payment. Note: Due to banks requirements , the first payment date must be 6 working days in the future.

numberOfPayments
required
integer

Expected number of payments. Set 0 for indefinite

frequency
required
string
Enum: "one_week" "one_month" "three_months" "one_year"

Time interval between payments.

initialPaymentAmount
string^[0-9]*.[0-9]{2}$

Set if you want to request single immediate payment

customerName
string
customerEmail
string

Responses

Request samples

Content type
application/json
{
  • "reference": "12345abc",
  • "recurringAmount": "0.50",
  • "recurringPaymentDate": "2022-12-24T00:00:00Z",
  • "numberOfPayments": 0,
  • "frequency": "one_week",
  • "initialPaymentAmount": "0.50",
  • "customerName": "John Doe",
  • "customerEmail": "email@example.com"
}

Response samples

Content type
application/json; charset=utf-8
{
  • "saved": true,
  • "result": {
    }
}

Process draft recurring payment by ID

Process draft recurring payment. Recurrin payment and initial payment(if present) status will be changed to 'send' and link will be generated

path Parameters
id
required
string
Example: 62b48c5b6ba2cd6a040b20a8

Mongoose Object ID of the target entity

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "success": true,
  • "result": {
    }
}

Delete recurring payment. Active or paid recurring

Delete recurring payment. Active or paid recurring payments can't be deleted

path Parameters
id
required
string
Example: 62b48c5b6ba2cd6a040b20a8

Mongoose Object ID of the target entity

header Parameters
terminal-secret
required
string <uuid>
Example: 3858f642-e92f-431c-9d38-46d15efb7fba
terminal-id
required
string
Example: 62b48adf6ba2cd6a040b1eec

Responses

Response samples

Content type
application/json; charset=utf-8
{
  • "deleted": true
}

Webhooks

Webhooks are used to notify your application about events that happen in FenaPay. For example, when a payment is completed, a webhook will be sent to your application with the payment data. You can use webhooks to automate your business processes and integrate FenaPay with your CRM, ERP, or other systems.

Recurring payments status update Webhook

Request Body schema: application/json

Webhook payload

One of
id
string
invoiceRefNumber
string <= 12 characters ^[a-z0-9-]+$
recurringAmount
string^[0-9]*.[0-9]{2}$

The amount of money that will come to your bank account from the client during the active period of regular payments

firstPaymentDate
string

Javascript date. First payment date of recurring payment. Note: Due to banks requirements , the first payment date must be 3 working days in the future.

finalPaymentDate
string

Javascript date. Final payment date of recurring payment. Calculated date of final payment. If numberOfPayments has been set

expectedNumberOfPayments
integer

Expected number of payments. Set 0 for indefinite

frequency
string
Enum: "one_week" "one_month" "three_months" "one_year"

Time interval between payments.

status
string
Enum: "draft" "sent" "active" "paid" "rejected" "warning" "cancelled" "overdue"

Draft - draft recurring payments. Sent - link for customer has been generated and can be provided to a customer.Active - The customer successfully set the recurring payment and it is in progress. Paid - All payments have been fully paid Rejected - recurring payments set up has been failed. Warning - one of the payments didn’t arrive on the expected date or amount of money was less than the recurring amount. Cancelled - payment has been cancelled by customer or user set status as cancelled manually.Overdue - link for payment initiation is expired.

object (RecurringInitialPaymentResult)
customerName
string
customerEmail
string
createdAt
string
currency
string
link
string

payment link

qrCodeData
string

Responses

Request samples

Content type
application/json
{
  • "id": "3858f642-e92f-431c-9d38-46d15efb7fba",
  • "invoiceRefNumber": "ref-123456",
  • "recurringAmount": "0.50",
  • "firstPaymentDate": "2022-12-24T00:00:00Z",
  • "finalPaymentDate": "2022-12-24T00:00:00Z",
  • "expectedNumberOfPayments": 0,
  • "frequency": "one_week",
  • "status": "sent",
  • "initialPayment": {
    },
  • "customerName": "John Doe",
  • "customerEmail": "email@example.com",
  • "createdAt": "2022-12-24T00:00:00Z",
  • "currency": "string",
  • "qrCodeData": "string"
}

Common

Initiate recurring payment

Initiate recurring payment

Request Body schema: application/json
type
string

'recurring payment'

id
string

Hashed ID from the payment link (the one after rp?=)

provider
string

Selected provider

Responses

Request samples

Content type
application/json
{
  • "type": "string",
  • "id": "string",
  • "provider": "string"
}

Response samples

Content type
application/json; charset=utf-8
"Unauthorized"