Cancel Recurring

Cancel an existing recurring payment plan using DigetPay's Server-to-Server (S2S) API.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

The Cancel Recurring API allows merchants to cancel an active recurring payment plan using its unique RecurringId.

Once the plan is successfully canceled, its status changes to Canceled, and no further scheduled recurring payments will be processed under that plan.

Previously executed payments and their associated invoices remain available for tracking and reconciliation.


API Endpoint

Method: POST

Endpoint:

https://api.digetpay.com/v1/payment/s2s/CancelRecurring

Authentication

Include your DigetPay API key in the request header.

HeaderValue
x-api-keyYOUR_API_KEY

DigetPay uses the same API base URL for Test and Live environments.

  • Test API Key: Cancel a recurring plan in the test environment.
  • Live API Key: Cancel a recurring plan in the production environment.

Query Parameters

ParameterTypeRequiredDescription
RecurringIdStringYesUnique identifier of the recurring plan to cancel.

The RecurringId is returned when creating a recurring payment plan through the Make Recurring API.


Request Example

The following example cancels the recurring payment plan with ID RECUR16.

curl --location --request POST \
'https://api.digetpay.com/v1/payment/s2s/CancelRecurring?RecurringId=RECUR16' \
--header 'x-api-key: YOUR_API_KEY'

No request body is required in the supplied API example.


Success Response Example

The following response was returned after successfully canceling an active recurring payment plan.

{
  "IsSuccess": true,
  "Message": "Recurring canceled",
  "Data": {
    "RecurringId": "RECUR16",
    "RecurringStatus": "Canceled",
    "CreationDate": "2026-11-01T18:19:09.493Z",
    "RecurringValue": 1000,
    "RecurringType": "Daily",
    "IntervalDays": null,
    "ExecutedTimes": 2,
    "Iteration": 5,
    "RetryCount": 1,
    "LastPayDate": "2026-11-01T21:00:00.090Z",
    "NextPayDate": null,
    "IsActive": false,
    "LastFailureReason": null,
    "RecurringInvoices": [
      {
        "InvoiceId": 7329683,
        "PaymentId": "07077329683392703974",
        "CustomerReference": "cust-1001",
        "CustomerName": "fname lname",
        "CustomerMobile": "966512345678",
        "CreatedDate": "2026-11-01T18:19:12.211Z",
        "InvoiceStatus": "Paid",
        "FailureReason": null,
        "Kind": "INITIAL"
      },
      {
        "InvoiceId": 7329836,
        "PaymentId": "07077329836392718074",
        "CustomerReference": "cust-1001",
        "CustomerName": "fname lname",
        "CustomerMobile": "966512345678",
        "CreatedDate": "2026-11-01T21:00:02.590Z",
        "InvoiceStatus": "Paid",
        "FailureReason": null,
        "Kind": "SCHEDULED"
      }
    ]
  }
}

Response Parameters

General Response

ParameterTypeDescription
IsSuccessBooleanIndicates whether the cancellation request was processed successfully.
MessageStringGeneral API response message.
DataObjectContains the updated recurring payment plan information.

Recurring Plan Details

ParameterTypeDescription
RecurringIdStringUnique identifier of the canceled recurring payment plan.
RecurringStatusStringUpdated recurring plan status. Returns Canceled in the successful example.
CreationDateString (DateTime)Date and time when the recurring plan was originally created.
RecurringValueNumberConfigured recurring payment amount.
RecurringTypeStringBilling frequency, such as Daily, Weekly, Monthly, or Custom.
IntervalDaysInteger / NullCustom billing interval in days, if applicable.
ExecutedTimesIntegerNumber of payment executions recorded before cancellation.
IterationIntegerOriginally configured number of payment iterations.
RetryCountIntegerConfigured retry count for failed payments.
LastPayDateString (DateTime) / NullDate and time of the most recent recorded payment.
NextPayDateString (DateTime) / NullNext scheduled payment date. Returns null after cancellation in this example.
IsActiveBooleanIndicates whether the recurring plan is active. Returns false after successful cancellation.
LastFailureReasonString / NullLatest recorded failure reason, if applicable.
RecurringInvoicesArrayInvoices associated with the recurring plan, including previously executed payments.

RecurringInvoices Object

ParameterTypeDescription
InvoiceIdIntegerInvoice identifier.
PaymentIdStringPayment identifier associated with the invoice.
CustomerReferenceString / NullMerchant-defined customer reference.
CustomerNameStringCustomer name associated with the invoice.
CustomerMobileStringCustomer mobile number.
CreatedDateString (DateTime)Invoice creation date and time.
InvoiceStatusStringPayment status of the invoice, such as Paid.
FailureReasonString / NullReason for payment failure, if applicable.
KindStringInvoice type: INITIAL or SCHEDULED in the supplied example.

Understanding the Cancellation Result

When a recurring plan is successfully canceled, the response confirms its updated status.

{
  "IsSuccess": true,
  "Message": "Recurring canceled",
  "Data": {
    "RecurringId": "RECUR16",
    "RecurringStatus": "Canceled",
    "ExecutedTimes": 2,
    "Iteration": 5,
    "NextPayDate": null,
    "IsActive": false
  }
}

What Happens After Cancellation?

  • RecurringStatus: Changes from Active to Canceled.
  • IsActive: Changes to false.
  • NextPayDate: Becomes null, indicating no upcoming payment is scheduled.
  • ExecutedTimes: Retains the number of previously recorded payment executions.
  • RecurringInvoices: Previously created invoices remain available.

Example: Cancellation Before Plan Completion

In the supplied example, the recurring plan originally contained five payment iterations.

FieldBefore CancellationAfter Cancellation
RecurringIdRECUR16RECUR16
RecurringStatusActiveCanceled
ExecutedTimes22
Iteration55
IsActivetruefalse
NextPayDate2026-11-02T21:00:00.000Znull

The recurring plan was canceled after two successful executions, before reaching the configured five iterations.

The remaining scheduled payments are no longer scheduled under the canceled plan.


Verifying Cancellation

After submitting the cancellation request:

  1. Check that IsSuccess is true.
  2. Confirm that RecurringStatus is Canceled.
  3. Confirm that IsActive is false.
  4. Check that NextPayDate is null.
  5. Optionally, use the Get Recurring API to retrieve the updated plan status.

Important: Do not consider a recurring plan canceled solely because an HTTP request was completed. Verify the cancellation result returned by DigetPay.


Previously Executed Payments

Canceling a recurring plan does not change the status of payments already processed.

In the provided example, the plan contains two successful payments:

Payment TypeInvoice IDStatus
Initial Payment7329683Paid
Scheduled Payment7329836Paid

Both invoices remain associated with the recurring plan after cancellation.

Note: Canceling a recurring plan is not the same as refunding previous transactions. Any refund must be handled separately through the applicable refund process.


When to Use This API

Use the Cancel Recurring API when:

  • A customer requests cancellation of their subscription.
  • A merchant needs to stop an existing recurring billing plan.
  • A subscription or membership is terminated.
  • The merchant needs to prevent additional scheduled charges under an active recurring plan.

Best Practices

  • Store the RecurringId securely when creating the recurring plan.
  • Verify the recurring plan identifier before submitting a cancellation request.
  • Confirm the successful cancellation response.
  • Update the subscription status in your system after confirmation.
  • Retain previous payment references for tracking and reconciliation.
  • Handle customer cancellation requests according to your subscription terms.
  • Keep merchant API keys secure and never expose them in frontend applications.

Related APIs

  • Make Recurring — Create a new recurring payment plan.
  • Get Recurring — Retrieve details and status of an existing recurring plan.
  • List Recurring Plans — Retrieve all recurring payment plans associated with the merchant.

For additional information, refer to the Recurring Payments Overview.

Path Params
string
required
Response
200
Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here!