Skills

Refund And Dispute

Move money back to a customer in Stripe, or respond to a dispute, with the checks that...

Install

npx skills add ParadevAI/Paradev --skill refund-and-dispute -g -a claude-code -y
Repository
ParadevAI/Paradev15.8k
Category
Writing
Updated
3d ago
License
See repository
Context cost
Lightabout 1,098 tokens
Runs scripts
No, instructions only

What it does

Move money back to a customer in Stripe, or respond to a dispute, with the checks that belong in front of an irreversible write, read the charge first, fix the exact amount, and clear Stripe's human confirmation step. Use when the user asks to refund a payment, cancel and refund a subscription, or handle a chargeback or dispute.

A refund is not a retryable call

Every other Stripe read can be run again for free. A refund cannot. Treat the write as the last step of a short checklist, never as the first attempt at understanding the request.

1. Read the charge before you touch it

The checks live on the charge, so a pi_ id is not where this starts: read the PaymentIntent, follow latest_charge, and read that charge. Skipping the hop is how an agent misses an open dispute, because refunded, amount_refunded, and disputed are not PaymentIntent fields and reading them off one yields undefined rather than an error.

A latest_charge of null ends the job rather than starting it: the PaymentIntent was never confirmed, or no attempt produced a charge, so there is nothing to refund. Say that and stop.

On the charge, check four fields:

  • amount and currency: the only authority for what can be refunded.
  • amount_refunded: a charge refunded in part looks fully refundable from a dashboard glance.
  • status and refunded: a failed or already-refunded charge needs a different answer, not a write.
  • disputed: if a dispute is open, refunding is the wrong instrument. See step 5.

Confirm the mode with get_stripe_account_info first. A live-mode refund issued because the id was assumed to be a sandbox id cannot be undone.

2. Fix the amount in the smallest currency unit, explicitly

Omitting amount refunds the whole charge. A partial refund takes an integer in the smallest unit of the charge's currency, so a $12.34 refund is 1234 and a 1234 yen refund is 1234. Never derive the figure from a human-readable total in the conversation when the charge object is one read away, and say the figure and currency back to the user before writing.

3. State the intent, then write once

Read the whole SKILL.md on GitHub

More in Writing