Cancel Express Checkout Subscription
Audience:
Low-code EngineersSkill Prerequisites:
Actions,Tokens,PayPal business account
Cancels a PayPal subscription (a recurring payments profile), so the user isn't billed again. You identify the subscription by its profile ID, which PayPal - Express Checkout returns when it creates the subscription.
A canceled subscription can't be restarted. The user has to subscribe again.
This action is part of the PayPal add-on (DnnSharp.PayPal). The add-on is installed separately and needs the PAYPAL feature in your license. If it isn't licensed, the action fails with a "not licensed" error. If you don't see the PayPal actions, the add-on isn't installed.
Typical Use Cases
- Let users cancel their own subscription from a button on their account page
- Cancel a subscription from an admin listing, for example after a refund
- Cancel a subscription when the user's account is closed
Don't use it to
- Refund a payment. Canceling only stops future billing.
- Cancel an Authorize.Net or Stripe subscription. It only works with PayPal subscriptions.
Related Actions
| Action Name | Description |
|---|---|
| PayPal - Express Checkout | Creates the subscription and returns its profile ID. It explains the whole PayPal flow. |
| PayPal - Parse IPN Request | Reads the notification PayPal sends when a subscription is canceled. |
| Get Transaction Details | Reads the details of a single PayPal payment. |
Input Parameter Reference
| Parameter | Description | Supports Tokens | Default | Required |
|---|---|---|---|---|
| API Username | The API username of your PayPal account's classic API (NVP/SOAP) credentials. Use the sandbox credentials when Go Live is off. | Yes | empty string | Yes |
| API Password | The API password that goes with the username. | Yes | empty string | Yes |
| API Signature | The API signature that goes with the username. | Yes | empty string | Yes |
| Go Live | When on, the request goes to PayPal's live API. When off, it goes to the PayPal sandbox (api-3t.sandbox.paypal.com). Use the same setting as when the subscription was created. | Yes | false | No |
| Subscription Profile Id | The ID of the subscription to cancel, for example [PayPalProfileId]. | Yes | empty string | Yes |
| Cancellation Note | Why the subscription is canceled. PayPal includes it in the cancellation email it sends to the user. | Yes | empty string | No |
If the credentials or the profile ID are empty, the action fails with an error such as The ProfileId parameter is required.
Output Parameters Reference
Type a name without brackets, for example CancelErrorCode, and use it later as [CancelErrorCode].
| Parameter | Description |
|---|---|
| Error Code Output Token Name0 | 0 when the subscription was canceled. Otherwise, PayPal's error code, or -1 if PayPal couldn't be reached. |
| Error Message Output Token Name | PayPal's error message, or empty when the subscription was canceled. |
Considerations
- Check the error code. The action doesn't fail when PayPal refuses the cancellation, and it has no On Success or On Error lists. The actions after it always run, so give them a condition such as
[CancelErrorCode] == "0". - Check who's canceling. If users cancel their own subscription, read the profile ID from your database for the current user. Don't take it from a field or query string the user can change.
- Update your own records. PayPal stops billing, but your application doesn't know unless you save it, for example with Run SQL Query.
- Notifications. PayPal also sends an IPN with
profile_statusset toCancelled. That can run the On Subscription Canceled list of PayPal - Express Checkout, within its 7-day limit. - Keep the credentials out of the action. The API password is a password field, but the signature isn't, and both are stored with the action. Use tokens, for example from a setting.
- The action uses PayPal's classic NVP
ManageRecurringPaymentsProfileStatusmethod with the actionCancel.
Examples
To understand how to use the below examples, please see Running Examples.
1. Cancel the current user's subscription
These actions load the profile ID saved for the current user, cancel the subscription on PayPal and, if that worked, mark it as canceled. If PayPal refuses, the user sees PayPal's message. The credentials come from tokens.
[
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Description": "Load the user's subscription",
"Parameters": {
"SqlQuery": "SELECT PayPalProfileId FROM Members WHERE UserId = @UserId",
"BindTokens": [
{
"name": "UserId",
"value": "[User:UserId]"
}
],
"OutputTokenName": "Member"
}
},
{
"Title": "Cancel Express Checkout Subscription",
"ActionType": "PayPal.CancelExpressCheckoutSubscription",
"Description": "Cancel the subscription on PayPal",
"Condition": "[Member:PayPalProfileId] != \"\"",
"Parameters": {
"PayPalExpressId": "[PayPalApiUser]",
"PayPalExpressPassword": "[PayPalApiPassword]",
"PayPalExpressSignature": "[PayPalApiSignature]",
"PayPalExpressLiveMode": true,
"ProfileId": "[Member:PayPalProfileId]",
"CancellationNote": "Canceled at your request from your account page.",
"ErrorCodeTokenName": "CancelErrorCode",
"ErrorMessageTokenName": "CancelErrorMessage"
}
},
{
"Title": "Run SQL Query",
"ActionType": "RunSql",
"Description": "Mark the subscription as canceled",
"Condition": "[CancelErrorCode] == \"0\"",
"Parameters": {
"SqlQuery": "UPDATE Members SET ProfileStatus = 'Cancelled' WHERE UserId = @UserId",
"BindTokens": [
{
"name": "UserId",
"value": "[User:UserId]"
}
]
}
},
{
"Title": "Display Error Message",
"ActionType": "ShowError",
"Description": "Show PayPal's error",
"Condition": "[CancelErrorCode] != \"0\"",
"Parameters": {
"Message": "<p>We couldn't cancel your subscription: [CancelErrorMessage]</p>"
}
}
]
Revised 09/27/2026