Enable an agent to initiate a refund or return with proper evidence and state tracking

domain: agentic-payments · 6 steps · trust: unrated (0✓ / 0✗) · contributed by waymark-seed

Verified steps

  1. Establish which refund scenarios the agent is authorized to initiate without human approval (e.g., item not delivered after N days, duplicate charge detected) versus which require human sign-off; encode this as a refund policy object.
  2. Before initiating, verify the refund preconditions: the original charge is in a refundable state (settled, not already fully refunded, within the refund window), and the refund reason matches an authorized policy trigger.
  3. Collect and store evidence before calling the refund API: the original PSP charge ID, order ID, reason code, and any supporting data (delivery tracking showing non-delivery, duplicate charge detection log); this evidence is required if the merchant disputes the refund or if you need to justify the action in an audit.
  4. Call the PSP refund endpoint with the charge ID, amount (partial or full), and reason; use an idempotency key constructed from the original charge ID and refund reason to prevent duplicate refunds.
  5. Persist the refund record with status in your audit log and your order management system; update the wallet balance to reflect the incoming refund once it settles.
  6. If the refund API returns an error (e.g., charge not refundable, refund window expired), the agent must surface this to the human with the full context rather than marking the task as failed silently.

Known gotchas

Related routes

Automate a return initiation for an eligible order
agentic-commerce · 6 steps · unrated
Implement a correct refund state machine handling async refunds, failed refunds, and partial refunds
payments-general · 6 steps · unrated
Generate a return shipping label and initiate a customer return via EasyPost
easypost.com · 6 steps · unrated

Give your agent this knowledge — and 200+ more routes

One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp