Recipe: Refund decision drafter (human-in-loop)
A structured workflow that drafts refund decisions from order context, surfaces the reasoning for human review, and logs the final outcome.
Ingredients
- Order ID, payment gateway, and dispute reason
- Customer history (prior refunds, account age)
- Product type (digital license vs physical)
- Refund policy ruleset (JSON)
- Human approval step via internal dashboard
Steps
- Ingest order context. Pull order metadata, payment status, and dispute reason from the SellAuth webhook payload.
- Score eligibility. Compare against the refund policy ruleset — check time window, product type, and customer risk flags.
- Draft decision. Generate a structured recommendation (approve / deny / escalate) with a plain-English rationale.
- Queue for review. Push the draft to the internal review queue. No action is taken until a human confirms.
- Log outcome. On approval or override, write the final decision to the audit log and trigger the refund via gateway API.
Guardrails
- Drafts are read-only until human sign-off
- Escalation threshold: refunds above $250 or third dispute in 90 days
- All decisions are immutable once logged
Note: This recipe assumes you have the SellAuth integration and internal dashboard already configured. See SellAuth setup for prerequisites.