N8N Tools - PayPal Enhanced icon

N8N Tools - PayPal Enhanced

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

Payments → Refund Payment

AI-generated

Overview

The node provides an enhanced integration with PayPal, supporting over 70 operations across multiple PayPal resources such as Orders, Subscriptions, Invoicing, Disputes, Webhooks, Payments, Products, Plans, Partner Referrals, and Reporting. Specifically for the Payments resource and the Refund Payment operation, this node allows users to refund a captured payment via PayPal's API.

This is useful in scenarios where you need to automate refund processing for payments captured through PayPal, such as in e-commerce platforms or subscription services. For example, if a customer requests a refund, this node can be used within an n8n workflow to trigger the refund automatically by providing the payment capture ID and optional refund details.

Properties

Name Meaning
ID The unique identifier of the captured payment to refund.
Request Body JSON object containing additional refund details (e.g., amount, reason).
Additional Options Optional settings including:
- Environment: "Sandbox" or "Live" PayPal environment.
- Page Size: Number of items per page for list operations (not relevant here).
- Start Time / End Time: Date filters in ISO 8601 format (not relevant here).

Output

The node outputs a JSON object containing:

  • resource: The resource name ("payments").
  • operation: The operation performed ("refundPayment").
  • success: Boolean indicating if the refund was successful.
  • All fields returned by the PayPal API refund endpoint, which typically include refund transaction details such as refund ID, status, amount refunded, and timestamps.
  • creditsUsed and creditsRemaining: Metadata about API usage from the external validation service.
  • timestamp: The ISO timestamp when the operation was executed.

No binary data output is produced by this operation.

Dependencies

  • Requires valid credentials for:
    • An API key credential for the external validation service (referred generically).
    • A PayPal OAuth2 access token credential with appropriate permissions.
  • The node uses PayPal's REST API endpoints, switching between sandbox and live environments based on user selection.
  • The node performs a pre-validation call to an external API before making the PayPal request.

Troubleshooting

  • Invalid JSON in Request Body: If the JSON provided in the "Request Body" property is malformed, the node will throw an error indicating invalid JSON. Ensure the JSON syntax is correct.
  • Validation Failure: If the external validation API rejects the request, the node throws an error with the validation message. Check API key validity and parameters.
  • Unknown Operation or Resource: Errors occur if unsupported operations or resources are specified. Confirm that "Payments" resource and "Refund Payment" operation are selected.
  • API Authentication Errors: If PayPal OAuth2 credentials are missing or expired, the node will fail. Refresh tokens or reauthenticate as needed.
  • HTTP Request Failures: Network issues or incorrect IDs may cause HTTP errors. Verify the payment capture ID and network connectivity.

Links and References

Discussion