Process Adyen refunds from approved Zendesk tickets

When a support ticket is marked refund-approved, submit the Adyen refund, reply to the customer, and post a summary to finance in Slack.

Agentic Task
ZendeskAdyenSlackCustomer SupportFinanceNotifications & AlertsFeedback Triage
PromptCreate

Build an agent workflow that processes approved Adyen refunds surfaced through Zendesk support tickets. Trigger: a Zendesk webhook that fires whenever a ticket is updated. The agent should only act when the updated ticket carries the approval signal, either a refund-approved tag or a status of Refund Approved. Any other ticket update is a no-op.

On a qualifying update, the agent uses Zendesk Show Ticket and Zendesk List Ticket Comments to load the full ticket and its conversation. From that content it extracts four fields: the Adyen pspReference for the original captured payment, the refund amount, the currency, and a short refund reason. Sensible defaults apply: if no amount is specified, treat it as a full refund of the original captured amount referenced on the ticket; if no reason is specified, use a short default such as "Customer request approved by support".

Guardrails before calling Adyen. If the pspReference is missing or the agent is not confident which captured payment to refund, the agent must refuse to act. In that case it posts an internal note on the ticket asking the support agent to add the pspReference and stops. If the extracted amount is above a configurable threshold (expose this as a workflow input, for example a maxAutoRefundAmount and its currency), the agent must also refuse to auto-refund and instead post an internal note flagging the ticket for a human approver.

When the guardrails pass, the agent calls Adyen Refund a Captured Payment against the pspReference with the extracted amount and currency. Derive a stable idempotency key from the ticket ID (for example zd-refund-<ticket_id>) and pass it as the Idempotency-Key input so re-firing the same approval never creates a duplicate refund. Use the same value for Adyen's reference field so the refund is easy to reconcile later.

Adyen refunds are asynchronous. The HTTP response returns received with a refund pspReference, but the final outcome arrives later via Adyen's REFUND webhook. Treat the initial response as pending and make that clear in every downstream message. Do not tell the customer the refund is complete.

After Adyen accepts the request, the agent uses Zendesk Update Ticket to add a public reply to the customer. The reply should confirm that the refund has been submitted to Adyen, state the amount and currency, and explain that the funds should appear in the original payment method within a few business days pending final confirmation from the payment provider. Do not include the raw pspReference in the public reply; keep that for internal notes.

Then the agent uses Slack Send a Message to post a summary to a configurable finance channel (default #finance). The Slack message should include the Zendesk ticket link, the customer name or email, the amount, currency, refund reason, the original pspReference, and the new refund pspReference from Adyen, along with a note that the final outcome will arrive via the Adyen REFUND webhook.

Expose these workflow inputs: Zendesk approval signal (tag name or status value), maxAutoRefundAmount plus its currency, the finance Slack channel, and the default refund reason. Log the refund pspReference on the ticket as an internal note so finance can match it to the eventual Adyen webhook during reconciliation.

Additional information

What does this prompt do?
  • Watches Zendesk for tickets tagged refund-approved (or moved to a Refund Approved status) and springs into action the moment one is updated.
  • Reads the ticket and its conversation, pulls out the Adyen payment reference, refund amount, currency, and reason, and defaults to a full refund when no amount is specified.
  • Submits the refund to Adyen with an idempotency key derived from the ticket ID so the same approval can never be charged twice.
  • Replies to the customer on the ticket confirming the refund is in flight and lets them know Adyen delivers the final outcome asynchronously.
  • Drops a summary into your #finance Slack channel with the ticket, the customer, the amount, and the refund reference so reconciliation is one click away.
What do I need to use this?
  • A Zendesk account with permission to read tickets, update tickets, and receive outgoing webhooks on ticket events
  • An Adyen merchant account with a user allowed to submit refunds against captured payments
  • A Slack workspace and a #finance (or equivalent) channel the agent can post into
  • A convention for approving refunds in Zendesk, either a refund-approved tag or a dedicated Refund Approved status
  • An upper amount threshold above which the agent should pause and wait for a human
How can I customize it?
  • Swap the refund-approved tag or Refund Approved status for whatever signal your team already uses to mark an approval
  • Change the finance Slack channel, or route different currencies or amounts to different channels
  • Raise or lower the auto-refund threshold, or add a second review step for anything over a certain size
  • Tweak the customer reply template, including how the pending Adyen outcome is explained

Frequently asked questions

How does the agent know a refund has been approved?
It listens for Zendesk ticket update events and only acts when the ticket carries your refund-approved signal, either a specific tag or a status like Refund Approved. Any other ticket update is ignored.
What if the ticket does not mention an Adyen payment reference?
The agent refuses to act and leaves a note asking the support agent to add the payment reference. It will not guess or search for it, so you cannot accidentally refund the wrong charge.
Can it refund any amount, or is there a ceiling?
You set a threshold. Anything at or below that amount is refunded automatically. Anything above pauses the workflow and asks a human to approve it, so large refunds always get a second pair of eyes.
Why does the customer reply say the refund is pending?
Adyen confirms refunds asynchronously. The refund is submitted immediately, but the final result arrives via a follow-up notification from Adyen, so we tell the customer to expect the money in the usual few business days rather than promising it is already done.
Will the same ticket ever be refunded twice?
No. The agent uses an idempotency key derived from the ticket ID, so if the same ticket fires the workflow again, Adyen returns the original refund without creating a duplicate.
What if the refund is declined by Adyen?
The customer reply and the Slack summary include the refund reference so finance can watch for the final status. When the refund is declined, your finance team is notified via the Adyen webhook and can follow up on the same ticket.

Stop hand-typing every approved refund into Adyen.

Turn a refund-approved tag in Zendesk into a submitted Adyen refund, a customer reply, and a finance heads-up in under a minute.