GetRecurringPayment

Endpoint

Overview

The "GetRecurringPayment" endpoint is a GET request. It is used to get all recurring payments created in your account.

The endpoint on Swagger is: Payment_GetRecurringPayment.

Now, we are going to declare the endpoint and its models along with each accepted parameter and possible value.

📘

Request Header

Add "Authorization": "Bearer {Token}" to request header. Token of demo configuration can be found here.


Request Model

The request is a GET request without any parameters.


Response Model

After viewing the Response Model that you will get as a result of your request, here, you will find full details about the Data Model of this API endpoint. Let's check it and its contents.

Response FieldTypeDescription
RecurringPaymentarray of RecurringPaymentModel objects

RecurringPaymentModel

Response FieldTypeDescription
RecurringId stringA unique number for each recurring payment. It's recommended to save this ID in your system with your customer profile so that, you can keep track of all payments done against that customer. Moreover, you will be able to cancel it when needed later on.
RecurringStatus stringACTIVE: The recurring payment is being processed normally but its iterations have not been completed yet.

UNCOMPLETED: MyFatoorah tried to withdraw the recurring value but the payment has failed and also Retry Counts have been executed and produced failed payments.

COMPLETED: The recurring payment has been executed successfully with all its iterations and will not be executed again.

CANCELED:: The recurring status is changed to canceled when you use CancelRecurringPayment endpoint to stop a recurring payment from being executed.

DRAFT:The recurring status is initially set as draft. When the first payment (first invoice before recurring) is done the status changes to active.
CreationDate string
RecurringValue numberThe value to be paid by your customer.
RecurringType stringRecurring type you set in the request while creating the recurring payment.

Possible values: (Custom-Daily-Weekly-Monthly)
IntervalDays integerValid when recurring type is set to "custom"
ExecutedTimes integerHow many times the recurring payment has been already executed.
LastPayDate stringLast date the recurring payment was executed.
NextPayDate stringNext date the recurring payment will be executed.
IsActive booleanWhether the recurring status is active or not
RecurringInvoices array of RecurringInvoicesModel objectsThe list of invoices related to this recurring payment.

RecurringInvoicesModel

Response FieldTypeDescription
InvoiceIdinteger
CustomerReferencestring
CustomerNamestring
CustomerMobilestring
CreatedDatestring
InvoiceStatusstring

Sample Messages

/v2/GetRecurringPayment
{
  "IsSuccess": true,
  "Message": "",
  "ValidationErrors": null,
  "Data": {
    "RecurringPayment": [
      {
        "RecurringId": "RECUR2136",
        "RecurringStatus": "Canceled",
        "CreationDate": "2021-04-13T11:57:51.733",
        "RecurringValue": 50,
        "RecurringType": "Custom",
        "IntervalDays": 1,
        "ExecutedTimes": 0,
        "LastPayDate": "2021-04-13T11:57:51.733",
        "NextPayDate": "2021-04-14T00:00:00",
        "IsActive": false,
        "RecurringInvoices": null
      },
      {
        "RecurringId": "RECUR2171",
        "RecurringStatus": "Active",
        "CreationDate": "2021-04-22T15:17:56.38",
        "RecurringValue": 50,
        "RecurringType": "Custom",
        "IntervalDays": 180,
        "ExecutedTimes": 0,
        "LastPayDate": "2021-04-22T15:17:56.38",
        "NextPayDate": "2021-10-19T00:00:00",
        "IsActive": true,
        "RecurringInvoices": null
      },
      {
        "RecurringId": "RECUR2137",
        "RecurringStatus": "Uncompleted",
        "CreationDate": "2021-04-13T12:06:41.067",
        "RecurringValue": 50,
        "RecurringType": "Custom",
        "IntervalDays": 1,
        "ExecutedTimes": 2,
        "LastPayDate": "2021-04-15T04:02:45.717",
        "NextPayDate": "2021-04-16T00:00:00",
        "IsActive": false,
        "RecurringInvoices": [
          {
            "InvoiceId": 614309,
            "CustomerReference": null,
            "CustomerName": "fname lname",
            "CustomerMobile": "+965",
            "CreatedDate": "2021-04-14T04:03:31.277",
            "InvoiceStatus": "Paid"
          },
          {
            "InvoiceId": 615024,
            "CustomerReference": null,
            "CustomerName": "fname lname",
            "CustomerMobile": "+965",
            "CreatedDate": "2021-04-15T04:02:43.077",
            "InvoiceStatus": "Paid"
          }
        ]
      },
      ...
    ]
  }
}