> Lydian Developer Documentation
> Page: https://developer.lydian.com/api/refund
> Documentation index: https://developer.lydian.com/llms.txt

# Refunds

Refund a succeeded transaction. Lydian recalculates the amount of the underlying asset to return using the current exchange rate and reduces it by the current gas fee (unless `gasFeePayer` overrides who pays). A transaction must have succeeded (`status` `1`) to be refunded.

For the end-to-end refund workflow, see [Refund a Payment](https://developer.lydian.com/guides/refund-a-payment.md).

## Create A Refund

**Endpoint:** `POST /account/{accountID}/transaction/{transactionID}/refund`

```bash
curl --location '{API_BASE_URL}/account/{ACCOUNT_ID}/transaction/{TRANSACTION_ID}/refund' \
--header 'X-Api-Key: {API_KEY}' \
--header 'X-MID: {MERCHANT_UUID_OR_EXTERNAL_MERCHANT_ID}' \
--header 'Content-Type: application/json' \
--data '{
"amount": {AMOUNT_IN_FLOAT},
"reason": "{REASON}", // OPTIONAL
"gasFeePayer": "{GAS_FEE_PAYER}", // OPTIONAL
"receiverAddress": "{WALLET_ADDRESS}" // OPTIONAL
}'
```

`gasFeePayer` must be one of: `merchant` or `customer`. It determines who absorbs the network gas fee for the refund. When omitted, the refund amount is reduced by the current gas fee.

`receiverAddress` is an optional destination wallet address for the refund.
When provided, it must not be blank.

### Create Refund Response

The response is an array of refund objects — one per refund leg created for the request.

- `refundID` (string): Unique identifier for the refund.
- `assetAmount` (string): Asset amount for the refund.

**example response**

```json
[
    {
        "refundID": "acd09ac7-612f-4011-ac74-a5e1f4753648",
        "assetAmount": "9.34"
    }
]
```
