Skip to content

The moment it happens

Track PayPal refunds in Slack

Every refund is reported with the buyer, amount and the payment it reverses.

Runs
The moment it happens
Apps
PayPal
AI
Not needed
Access
REST app (client credentials)

Send this to your assistant

Create a ClickRuntime automation: when a PayPal payment is refunded, post the buyer, refunded amount and original transaction ID to #finance in Slack.

Paste it into your assistant. It tells you what it will send or change before it runs live.

First time? Adding ClickRuntime to your assistant takes about two minutes.

Why use it

Why teams use this automation

Refunds matter to more than the person who clicked the button. When a PayPal payment is refunded, the finance lead needs to adjust the books, the support team wants to know the customer was taken care of, and the shop owner wants to spot refund spikes. Without an alert, a refund is just another line in PayPal that nobody sees until the monthly review.

When PayPal sends a refund event, its signature is verified, the refund amount is read, and the link back to the original capture is picked up. A Slack message then tells the team that a refund happened, how much it was and which payment it relates to, so people can follow the trail without searching.

It is useful for stores with several people handling support and for owners who want a quick sense of how often returns happen.

What you get out of it

  • Books stay accurate

    Finance can record the refund on the day it happens rather than discovering it at month end. The books then match the PayPal balance and reconciliation takes much less effort.

  • Support sees the whole story

    If the customer writes in afterward, the person answering can find the refund in the channel and confirm the amount. That avoids asking the customer for a reference or double refunding.

  • Spot refund spikes quickly

    A cluster of refunds on a single product often signals a defect, a shipping delay or a misleading listing. The channel makes the pattern visible days before the monthly numbers would.

  • Catch accidental or unauthorized refunds

    If a refund appears that nobody on the team remembers issuing, you can investigate right away. Fast awareness limits the damage from a mistake, a compromised login or a dispute handled badly.

  • Direct link to the original payment

    The message points to the capture the refund relates to, so you do not need to hunt through PayPal. One click shows the original sale and its details. That saves several minutes on each lookup.

How it works

What happens, step by step

  1. When a PayPal refund is issued, PayPal tells ClickRuntime straight away.

  2. ClickRuntime checks the message really came from PayPal, then reads the refund amount and the original transaction.

  3. A message goes to your #finance Slack channel with the amount, the customer and the original transaction ID.

Before it runs live

  • Connect PayPal
  • Paste your automation's link into the other app's webhook settings

What you get

RunsThe moment it happens
Track PayPal refunds in Slackjust nowSucceeded
Slack · #finance↩️ Refund of USD 45.00 to dana@acme.example Original transaction: 2GG279541U471931P

Build your own

Need it to work differently?

This template is a starting point. Copy the prompt and change it, or describe a different automation from scratch, with your own conditions, more apps or an AI step. Your assistant writes it, tests it and runs it on ClickRuntime.
  • Your own rules

    Conditions, thresholds, filters and exceptions, written the way you'd explain them to a colleague.

  • Any number of apps

    One automation can read from one app and update several others. Over 248 apps are ready, and anything with an API works too.

  • AI where it helps

    Summaries, classification, extraction and drafts use ClickRuntime's built-in AI, with no extra key.

  • On a schedule or on each event

    Runs as often as every 5 minutes, or the moment an app sends an event, and keeps track of what it already handled.

Changes you can ask for

  • Act only on the items that match your own rules, and skip the rest
  • Add an AI step, for example to summarize, sort or draft a reply
  • Add another app, for example also send it to Slack
  • Combine it with other PayPal steps into one automation

Under the hood

The code that runs this automation

This is the Python script that runs each time the automation starts. Your AI assistant writes it for you when you send the prompt, and you allow each step in your assistant. To change how the automation works, describe the change to your assistant and it updates the script for you. For every function it can use, see the script reference.
refund_issued_alert.pyexample
from clickruntime import on_event, credentials, http, notify

API = "https://api-m.paypal.com"

def paypal_headers():
    resp = http.post(f"{API}/v1/oauth2/token", data={"grant_type": "client_credentials"},
                     auth=(credentials.secret("PAYPAL_CLIENT_ID"), credentials.secret("PAYPAL_CLIENT_SECRET")))
    resp.raise_for_status()
    return {"Authorization": f"Bearer {resp.json()['access_token']}"}

@on_event
def handle(event):
    body = event.json
    if body.get("event_type") != "PAYMENT.CAPTURE.REFUNDED":
        return {"posted": False}
    headers = paypal_headers()
    refund = http.get(f"{API}/v2/payments/refunds/{body['resource']['id']}", headers=headers).json()
    capture_url = next(l["href"] for l in refund["links"] if l["rel"] == "up")
    capture = http.get(capture_url, headers=headers).json()
    order_id = capture["supplementary_data"]["related_ids"]["order_id"]
    payer = http.get(f"{API}/v2/checkout/orders/{order_id}", headers=headers).json()["payer"]
    amount = refund["amount"]
    notify.slack(f"↩️ Refund of {amount['currency_code']} {amount['value']} to {payer['email_address']}\n"
                 f"Original transaction: {capture['id']}", channel="#finance")
    return {"refund": refund["id"]}

FAQ

Common questions

Does a partial refund trigger the alert?
Yes. PayPal sends an event for each refund, including partial ones, and the message shows the amount that was refunded. That lets you tell a full return from a small goodwill gesture at a glance.
Can refunds issued from outside PayPal show up?
The alert reacts to refunds PayPal reports through its webhooks. Refunds made inside PayPal, through its API or from your own tools that call PayPal, are reported. A refund handled outside PayPal, such as a bank transfer, is not.
Is the customer's name included in the message?
The refund event focuses on amounts and the link to the original capture. If you want the name, the original payment can be fetched using that link, and your AI assistant can add that detail after you ask.
What permissions does it need?
REST app (client credentials). Nothing else in your accounts is used.
Does it need AI?
No. It runs without AI, so it doesn't use your plan's AI allowance.
How many runs does it use?
One run for each event the app sends.
Can I change how it works?
Yes. Describe the change to your AI assistant, for example a different schedule, channel or filter. It updates the automation, tests it and tells you what changed.

Set up “Track PayPal refunds in Slack” from your assistant

Copy the prompt above, or connect your assistant first. Free plan, no credit card.