Cancel an existing recurring payment plan using DigetPay's Server-to-Server (S2S) API.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
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.
| Header | Value |
|---|---|
x-api-key | YOUR_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
| Parameter | Type | Required | Description |
|---|---|---|---|
RecurringId | String | Yes | Unique 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
| Parameter | Type | Description |
|---|---|---|
IsSuccess | Boolean | Indicates whether the cancellation request was processed successfully. |
Message | String | General API response message. |
Data | Object | Contains the updated recurring payment plan information. |
Recurring Plan Details
| Parameter | Type | Description |
|---|---|---|
RecurringId | String | Unique identifier of the canceled recurring payment plan. |
RecurringStatus | String | Updated recurring plan status. Returns Canceled in the successful example. |
CreationDate | String (DateTime) | Date and time when the recurring plan was originally created. |
RecurringValue | Number | Configured recurring payment amount. |
RecurringType | String | Billing frequency, such as Daily, Weekly, Monthly, or Custom. |
IntervalDays | Integer / Null | Custom billing interval in days, if applicable. |
ExecutedTimes | Integer | Number of payment executions recorded before cancellation. |
Iteration | Integer | Originally configured number of payment iterations. |
RetryCount | Integer | Configured retry count for failed payments. |
LastPayDate | String (DateTime) / Null | Date and time of the most recent recorded payment. |
NextPayDate | String (DateTime) / Null | Next scheduled payment date. Returns null after cancellation in this example. |
IsActive | Boolean | Indicates whether the recurring plan is active. Returns false after successful cancellation. |
LastFailureReason | String / Null | Latest recorded failure reason, if applicable. |
RecurringInvoices | Array | Invoices associated with the recurring plan, including previously executed payments. |
RecurringInvoices Object
| Parameter | Type | Description |
|---|---|---|
InvoiceId | Integer | Invoice identifier. |
PaymentId | String | Payment identifier associated with the invoice. |
CustomerReference | String / Null | Merchant-defined customer reference. |
CustomerName | String | Customer name associated with the invoice. |
CustomerMobile | String | Customer mobile number. |
CreatedDate | String (DateTime) | Invoice creation date and time. |
InvoiceStatus | String | Payment status of the invoice, such as Paid. |
FailureReason | String / Null | Reason for payment failure, if applicable. |
Kind | String | Invoice 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
ActivetoCanceled. - 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.
| Field | Before Cancellation | After Cancellation |
|---|---|---|
RecurringId | RECUR16 | RECUR16 |
RecurringStatus | Active | Canceled |
ExecutedTimes | 2 | 2 |
Iteration | 5 | 5 |
IsActive | true | false |
NextPayDate | 2026-11-02T21:00:00.000Z | null |
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:
- Check that
IsSuccessistrue. - Confirm that
RecurringStatusisCanceled. - Confirm that
IsActiveisfalse. - Check that
NextPayDateisnull. - 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 Type | Invoice ID | Status |
|---|---|---|
| Initial Payment | 7329683 | Paid |
| Scheduled Payment | 7329836 | Paid |
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
RecurringIdsecurely 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.
200
