Register a refund you paid
shop.merchant.refundRegister a refund for an order by sending USDC back to the payer on the order’s rail and passing the transaction hash; the server verifies it before updating the order to refunded or partially refunded.
Instructions
Register a refund (needs refunds:write). The refund is YOUR transaction: send USDC back to the payer's wallet on the order's rail, then pass its tx_hash. APIbase only reads the chain and verifies: the transaction is confirmed, pays the payer, value >= amount. Verified: the order goes REFUND_PENDING -> REFUNDED (the refunds reach the order total) or PARTIALLY_REFUNDED (send further refunds until the total); otherwise 422 refund_rejected with the reason and the order is unchanged. More than the order total is 400. The platform fee is not returned. A transaction settles one refund only.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | ||
| tx_hash | Yes | ||
| order_id | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| state | Yes | ||
| status | Yes | ||
| order_id | Yes | ||
| refund_id | Yes | ||
| refunded_usd | Yes | ||
| order_total_usd | Yes | ||
| verified_amount_usd | Yes |