Skip to main content

revoke Method

Overview

The revoke method cancels an existing recurring payment mandate. Once revoked, no future automatic charges can be made using this mandate. Use this when customers cancel their subscriptions or recurring services.

Business Use Case: A customer cancels their SaaS subscription. You call revoke to stop all future billing and comply with their cancellation request.

Purpose

Why revoke mandates?

ScenarioBenefit
Subscription cancellationHonor customer cancellation requests
ComplianceMeet regulatory requirements for recurring billing
Customer retentionClean revocation improves re-subscription likelihood
Billing hygieneRemove inactive mandates to reduce system clutter

Key outcomes:

  • Future automatic charges are blocked
  • Customer billing stops immediately
  • Compliance with cancellation regulations

Request Fields

FieldTypeRequiredDescription
mandate_idstringYesThe mandate ID to revoke
reasonstringNoReason for revocation (customer_canceled, etc.)

Response Fields

FieldTypeDescription
mandate_idstringThe revoked mandate ID
statusMandateStatusNew status: REVOKED
revoked_atstringISO 8601 timestamp of revocation
status_codeintHTTP-style status code (200, 404, etc.)

Example

SDK Setup

from orchestratorx_prism import RecurringPaymentClient

recurring_client = RecurringPaymentClient(
connector='stripe',
api_key='YOUR_API_KEY',
environment='SANDBOX'
)

Request

request = {
"mandate_id": "mandate_xxx",
"reason": "customer_canceled"
}

response = await recurring_client.revoke(request)

Response

{
"mandate_id": "mandate_xxx",
"status": "REVOKED",
"revoked_at": "2024-01-15T10:30:00Z",
"status_code": 200
}

Important Notes

  • Immediate effect - Revocation takes effect immediately
  • No refunds - Revoking doesn't refund past charges
  • Idempotent - Calling revoke multiple times returns same result
  • No undo - A revoked mandate cannot be reactivated; setup a new one instead

Error Handling

Error CodeMeaningAction
404Mandate not foundCheck mandate_id is correct
410Already revokedMandate was already revoked

Best Practices

  • Always revoke when customer cancels subscription
  • Keep record of revocation reason for support
  • Confirm successful revocation before updating subscription status
  • Notify customer that cancellation is complete

Next Steps

  • charge - Process recurring payments before revocation
  • setup_recurring - Create new mandate if customer resubscribes