Skip to main content

Refund selected order lines

The agent gathers the affected lines, amounts, and reasons progressively, then presents one exact summary before creating the refund.

Prompt

Help me refund order <ORDER_ID>. Show the refundable lines, let me choose the affected items and amount for each, invite an optional reason and detail per line, and require an overall reason. Give me one exact summary before creating anything.

The agent calls get_refund_options and leads a short conversation:

  1. It shows numbered line items with original, reserved or refunded, and remaining refundable amounts in familiar major currency units.
  2. You select one or more affected lines.
  3. For each selected line, you specify a decimal major-unit amount such as 25.00. The agent may offer the full remaining amount, but never assumes it or asks you to calculate minor units.
  4. You can add a supported reason and detail for each line. A custom line reason requires detail.
  5. You provide the required overall refund reason. An overall custom reason also requires detail.
  6. create_refund refreshes the snapshot and presents the exact per-line amounts, total, reasons, and consequence for confirmation.

Sample response

Refund ready for confirmation

The preview shows exactly which paid lines will be affected before the refund is created.

Confirmation table
Order
ord_example_1042
Refund total
GHS 75.00
Overall reason
Item returned

Selected order lines

LineOriginal paidAlready reserved or refundedThis refund
Utility tote × 1GHS 50.00GHS 0.00GHS 50.00
Event pass × 1GHS 100.00GHS 25.00GHS 25.00

Nothing has been refunded yet. Creating the refund requires confirmation and begins an asynchronous process.

Illustrative values. The exact presentation depends on the MCP client.

Refund creation is asynchronous. A returned pending or processing refund means work has started, not that money has reached the customer. The agent uses get_refund to reconcile and says the refund completed only at succeeded.

A still-pending refund can be passed to cancel_refund, which has its own exact confirmation.