# Paying for a call

## The flow

1. Send the request. Answer is `402` + `PAYMENT-REQUIRED` (base64 JSON: amount, asset, payee, network).
2. Sign a USDC transfer authorisation for exactly that amount (EIP-3009 transferWithAuthorization).
3. Repeat the request with `X-PAYMENT`. The facilitator settles; the answer comes back.

`@x402/fetch` does steps 2-3 for you (see /docs/quickstart).

## Path B: pay yourself, present the tx

Send the USDC transfer yourself, then present `X-Payment-Tx` plus `X-Payer-Signature`
(a signature over `minia2a payment: <txHash>` from the paying wallet).

## When money comes back

- A failed paid call is refunded; `X-Minia2a-Refund` says enqueued / not-applicable / failed.
- A `400` means your input was rejected before the endpoint ran; the body carries `retry_with`.
- The same payment cannot be spent twice: a replay answers `409`.

## Warning

Refunds are not netted out of the public delivery numbers. A refund means a buyer did not get
what they paid for - treat a rising refund count as a defect signal.
