$20.00 refunded twice on the same capture, 2s apart

Status
Needs you
At risk
$20.00
Detected (detector clock)
2026-11-23 19:20

Diagnosis

AI agent (anthropic/claude-haiku-5.5)

The shop refunded $20.00 twice on the same $80.00 payment for the espresso sampler order, two seconds apart, so $40.00 has gone back to the buyer. The two refunds are 49H200786E503940C and 9LY672056T313191W; the second looks like an accidental repeat, not a second decision. Nothing can be undone automatically: the extra $20.00 is already gone from the shop's PayPal balance, and the order is still marked unshipped, so the shop needs to decide what the buyer should keep.

Decisions

The agent proposes, the policy gate decides, the executor calls PayPal.

Ask the owner

Waiting for you

Agent proposed

Only the owner knows whether the buyer should keep the extra $20 or whether the order will ship, and refunds cannot be reversed by Nightshift.

Note: Two $20.00 refunds (49H200786E503940C and 9LY672056T313191W) went out 2 seconds apart on order 8G9687840C628481K, so the buyer has received $40.00 of an $80.00 order. Do you want the buyer to keep the $40.00 (and then mark this resolved), or should we ask

Policy said

Needs approval
  • The agent asked for a human decision.

PayPal returned

No PayPal call for this action.

Evidence

Refunds 49H200786E503940C and 9LY672056T313191W both returned $20.00 from capture 0YT371803K206344D 2 seconds apart. That pattern usually means a retry without an idempotency key, not two decisions.

capture id
0YT371803K206344D
order id
8G9687840C628481K
first refund id
49H200786E503940C
first refund at
2026-10-27T19:20:00.000Z
duplicate refund id
9LY672056T313191W
duplicate refund at
2026-10-27T19:20:02.000Z
amount
$20.00
seconds apart
2
order8G9687840C628481Kcapture0YT371803K206344Drefund49H200786E503940Crefund9LY672056T313191W

All ids are real PayPal sandbox objects; GET them with your sandbox credentials to check.

Audit trail

Detected, diagnosed, decided, executed. Live.

Detected: $20.00 refunded twice on the same capture, 2s apart
Detector
Refunds 49H200786E503940C and 9LY672056T313191W both returned $20.00 from capture 0YT371803K206344D 2 seconds apart. That pattern usually means a retry without an idempotency key, not two decisions.
Agent started triage
Agent
Agent read ledger_lookup
Agent
ledger_lookupNightshift ledgerok
args { "order_id": "8G9687840C628481K" }
Result
{"order":{"id":"8G9687840C628481K","intent":"CAPTURE","status":"COMPLETED","amountCents":8000,"currency":"USD","payer":"night-owl-mvr2kt73482@example.com","cartRef":"cart-45166","description":"Espresso sampler, 4 x 250g","fulfillment":"unfulfilled","shippedAt":null,"createdAt":"2026-10-27T19:19:57.000Z","updatedAt":"2026-10-27T19:20:03.999Z","source":"webhook"},"buyer_note_untrusted":null,"authorizations":[],"captures":[{"id":"0YT371803K206344D","orderId":"8G9687840C628481K","authorizationId":null,"status":"PARTIALLY_REFUNDED","statusReason":null,"amountCents":8000,"currency":"USD","finalCapture":true,"createdAt":"2026-10-27T19:19:57.000Z","updatedAt":"2026-10-27T19:20:04.002Z"}],"refunds":[{"id":"9LY672056T313191W","captureId":"0YT371803K206344D","orderId":"8G9687840C628481K","status":"COMPLETED","amountCents":2000,"currency":"USD","createdAt":"2026-10-27T19:20:02.000Z","updatedAt":"2026-10-27T19:20:04.005Z"},{"id":"49H200786E503940C","captureId":"0YT371803K206344D","orderId":"8G9687840C628481K","status":"COMPLETED","amountCents":2000,"currency":"USD","createdAt":"2026-10-27T19:20:00.000Z","updatedAt":"2026-10-27T19:20:04.008Z"}],"failed_capture_attempts":[]}
Agent read get_refund
Agent
get_refundvia PayPal Agent Toolkitok
args { "refund_id": "9LY672056T313191W" }
Result
{"id":"9LY672056T313191W","amount":{"currency_code":"USD","value":"20.00"},"note_to_payer":"Sorry about the crushed bag","seller_payable_breakdown":{"gross_amount":{"currency_code":"USD","value":"20.00"},"paypal_fee":{"currency_code":"USD","value":"0.00"},"net_amount":{"currency_code":"USD","value":"20.00"},"total_refunded_amount":{"currency_code":"USD","value":"40.00"}},"custom_id":"cart-45166","status":"COMPLETED","create_time":"2026-10-27T12:20:02-07:00","update_time":"2026-10-27T12:20:02-07:00","payer":{"email_address":"sb-djk8i53501233@business.example.com","merchant_id":"D8M8MT98DPNNG"},"links":[{"href":"https://api.sandbox.paypal.com/v2/payments/refunds/9LY672056T313191W","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/payments/captures/0YT371803K206344D","rel":"up","method":"GET"}]}
Agent read get_refund
Agent
get_refundvia PayPal Agent Toolkitok
args { "refund_id": "49H200786E503940C" }
Result
{"id":"49H200786E503940C","amount":{"currency_code":"USD","value":"20.00"},"note_to_payer":"Sorry about the crushed bag","seller_payable_breakdown":{"gross_amount":{"currency_code":"USD","value":"20.00"},"paypal_fee":{"currency_code":"USD","value":"0.00"},"net_amount":{"currency_code":"USD","value":"20.00"},"total_refunded_amount":{"currency_code":"USD","value":"40.00"}},"custom_id":"cart-45166","status":"COMPLETED","create_time":"2026-10-27T12:20:00-07:00","update_time":"2026-10-27T12:20:00-07:00","payer":{"email_address":"sb-djk8i53501233@business.example.com","merchant_id":"D8M8MT98DPNNG"},"links":[{"href":"https://api.sandbox.paypal.com/v2/payments/refunds/49H200786E503940C","rel":"self","method":"GET"},{"href":"https://api.sandbox.paypal.com/v2/payments/captures/0YT371803K206344D","rel":"up","method":"GET"}]}
Agent diagnosis
Agent
The shop refunded $20.00 twice on the same $80.00 payment for the espresso sampler order, two seconds apart, so $40.00 has gone back to the buyer. The two refunds are 49H200786E503940C and 9LY672056T313191W; the second looks like an accidental repeat, not a second decision. Nothing can be undone automatically: the extra $20.00 is already gone from the shop's PayPal balance, and the order is still marked unshipped, so the shop needs to decide what the buyer should keep.
Agent proposed: Ask the owner
Agent
Only the owner knows whether the buyer should keep the extra $20 or whether the order will ship, and refunds cannot be reversed by Nightshift.
Policy said: needs the owner's approval
Policy gate
  • The agent asked for a human decision.