create_refund
Request a refund for a paid order, returning money to the customer. Verify the amount does not exceed the original payment; refunds are reviewed and can be cancelled until approved.
Instructions
Request a refund against a paid order. This sends real money back to a customer.
The order must already be paid and linked to a customer, and `amount` may not exceed
what the buyer actually paid — run `check_order_paid` first if you are unsure the
order settled.
Wayl reviews the request, so the refund starts in status 'Requested' rather than being
applied immediately; while it sits there you can still withdraw it with `cancel_refund`.
Once Wayl moves it to 'Refunded' there is no undo, so confirm the amount with the user
before calling.
This POST is never retried automatically and Wayl offers no idempotency key: call it
twice and you have two refunds. Save the returned `id` — `get_refund` and `cancel_refund`
need it, and `list_refunds` is the only other place to recover it.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | Amount to return in whole IQD. Minimum 1000, and no more than what the buyer actually paid. | |
| reason | Yes | Why the refund is warranted. Wayl requires 100-1500 characters — state what was bought, what went wrong, and what the customer asked for. | |
| reference_id | Yes | Reference ID of the paid order to refund. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||