n8n

How to Automate PayPal Order Delivery?

Capture completed PayPal payments and send the digital product file to the buyer right away. Great for teams that sell templates, licenses, or downloads and want instant delivery without manual work. It cuts delays and improves the customer experience.

A webhook receives PayPal events, then a wait step pauses until the transaction is fully settled. A switch filters for payment events and an API call pulls order details like buyer name, email, and item. A field mapping step prepares email content, and a second switch routes by product to select the right file link. The file is fetched as JSON, converted to an email attachment, and an HTML email goes out to the buyer with the correct subject and dynamic details.

Set up a PayPal app and webhook, then connect OAuth in n8n for the order details call. Replace the placeholder file URL, add your SMTP email credentials, and adjust the product rules to match your items. Expect delivery to move from hours to seconds and handle more orders without adding staff. Ideal for selling n8n templates, JSON assets, keys, or any digital file.

What are the key features?

  • Webhook capture of PayPal events to start the process when a payment occurs.
  • Wait step ensures the transaction is fully completed before sending files.
  • Switch filter routes only payment events for clean processing.
  • HTTP request pulls order details from PayPal with OAuth to get buyer and item data.
  • Set node maps first name, last name, email, and product for the email content.
  • Second switch selects the correct product link or template based on the item.
  • HTTP request downloads a JSON file that represents the digital product.
  • Code step converts JSON to a binary attachment for email delivery.
  • Email send node delivers a custom HTML message with the file attached.

What are the benefits?

  • Reduce manual fulfillment from 20 minutes to under 1 minute per order
  • Improve accuracy by pulling buyer data directly from PayPal
  • Deliver files instantly after payment to lower support tickets
  • Handle 10 times more orders without adding staff
  • Connect PayPal and your email service in one flow

How do you set it up?

  1. Import the template into n8n: Create a new workflow in n8n > Click the three dots menu > Select 'Import from File' > Choose the downloaded JSON file.
  2. You'll need accounts with PayPal and SMTP. See the Tools Required section above for links to create accounts with these services.
  3. In the Webhook node, copy the production URL. In your PayPal developer dashboard, create a webhook and paste this URL. Select payment completed events to trigger the flow.
  4. In n8n, open the Webhook node and confirm the path and method match the webhook you set in PayPal. Use POST and keep the path consistent.
  5. Open the Get Order Details node. In the credential dropdown, click Create new credential, choose OAuth2, and follow the on screen steps to connect PayPal using your client ID and secret.
  6. Check the Event Capture Type switch. Update the conditions to match the exact PayPal event name you receive for successful payments.
  7. Open the Email Data set node and confirm the JSON paths for buyer name, email, and product match your PayPal payload. Adjust paths if your payload structure differs.
  8. Open the second switch node and define rules for each product you sell. Match by item name, SKU, or any field you trust.
  9. In the getJSON node, replace the placeholder URL with the real file URL for your digital product. Make sure it returns JSON if you are using the provided code step.
  10. Open the Code node and ensure the output binary key is named data because the Email Send node is set to attach data.
  11. Open the Email Send node. In the credential dropdown, click Create new credential and connect your SMTP email service. Set From, To, Subject, and confirm attachments uses data.
  12. Test with a PayPal sandbox event. Trigger a test payment, watch the execution in n8n, confirm the wait step completes, and check that the email arrives with the correct attachment. If the API call fails, verify PayPal OAuth. If no email arrives, verify SMTP and spam filters. If the attachment is empty, verify the getJSON URL and the code step.

Tools Required

$24 / mo or $20 / mo billed annually to use n8n in the cloud. However, the local or self-hosted n8n Community Edition is free.

PayPal

Sign up

No monthly fee; lowest online API rate (US): Expanded Checkout 2.89% + $0.29 per transaction

Credits:
Developed by Amjid Ali. Support: amjid@amjidali.com
Website: https://syncbricks.com
LinkedIn: https://linkedin.com/in/amjidali
YouTube: YouTube channel
Training: http://lms.syncbricks.com
Support link: http://paypal.me/pmptraining

Similar Templates

Join Futurise to access 1,200+ automation templates

Get instant access to ready-made automation workflows for n8n, Make.com, AI agents, and more. Download, customise, and deploy in minutes.