N8N Tools - PayPal Enhanced icon

N8N Tools - PayPal Enhanced

Complete PayPal integration with 70+ operations including Orders, Subscriptions, Invoicing, Disputes, Webhooks, and Partner management

Orders → Cancel Payment

AI-generated

Overview

The node "N8N Tools - PayPal Enhanced" provides a comprehensive integration with PayPal's API, supporting over 70 operations across multiple resources such as Orders, Subscriptions, Invoicing, Disputes, Webhooks, Payments, Products, Plans, Partner Referrals, and Reporting.

For the Orders resource with the Cancel Payment operation, this node allows users to cancel an uncaptured payment authorization on a PayPal order. This is useful in scenarios where an authorized payment needs to be voided before capture, for example, if the customer cancels the order or if there was an error in the payment process.

Practical examples:

  • Voiding an authorized payment when an order is canceled by the customer.
  • Preventing capture of funds for an order that will not be fulfilled.
  • Managing payment authorizations programmatically within automated workflows.

Properties

Name Meaning
ID The unique identifier of the payment authorization to cancel (required).
Additional Options Collection of optional parameters:
- Environment PayPal environment to use: Sandbox or Live.
- Page Size Number of items per page for list operations (not relevant for cancel payment).
- Start Time Start date filter in ISO 8601 format (not relevant for cancel payment).
- End Time End date filter in ISO 8601 format (not relevant for cancel payment).

Output

The node outputs a JSON object containing:

  • resource: The resource name, here "orders".
  • operation: The operation performed, here "cancelPayment".
  • success: Boolean indicating if the operation succeeded.
  • All fields returned by the PayPal API response for the cancel payment request.
  • creditsUsed: Number of API credits used for the request (from validation response).
  • creditsRemaining: Remaining API credits after the request (from validation response).
  • timestamp: ISO string timestamp of when the operation was executed.

No binary data output is produced by this operation.

Dependencies

  • Requires credentials for:
    • An API key credential for the external "N8N Tools API" service used for validation.
    • A PayPal OAuth2 API credential providing an access token and environment info.
  • The node makes HTTP requests to:
    • The N8N Tools API for validating the requested operation.
    • The PayPal REST API endpoint (https://api-m.sandbox.paypal.com or https://api-m.paypal.com) depending on the environment.
  • Proper configuration of these credentials in n8n is necessary for successful execution.

Troubleshooting

  • Invalid JSON in Request Body: If a JSON body is provided and is malformed, the node throws an error. Ensure JSON syntax is correct.
  • Validation Failure: If the N8N Tools API validation fails, the node throws an error indicating validation failure. Check API key and permissions.
  • Unknown Operation or Resource: If an unsupported operation or resource is selected, the node throws an error specifying the unknown operation/resource.
  • Authorization Errors: If PayPal OAuth2 token is invalid or expired, requests to PayPal API will fail. Refresh or reconfigure credentials.
  • Network Issues: Connectivity problems to either the N8N Tools API or PayPal API will cause failures. Verify network access.
  • Continue On Fail: If enabled, the node will continue processing subsequent items even if one fails, returning error details in the output JSON.

Links and References

Discussion