> ## Documentation Index
> Fetch the complete documentation index at: https://docs.ach.netevia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund a Transaction

> An API endpoint for issuing refunds on transactions.

Once a transaction has been completed, this API can be used to issue a refund, thereby clawing back funds from the payee
and transferring them back to the payor. An optional amount can be specified to either issue a partial refund or add
additional fees to the original amount. If the amount is not specified, the total transaction amount is refunded.

The refund requests are only accepted when the transaction has been processed or completed. If the transaction is in the
CAPTURE\_PENDING or CAPTURE\_ACH\_FAILED status, the refund will not be accepted.

A refund will be processed only after an individual or batch payout has been initiated. For transactions within a batch
payout, we will collect all refund requests from the day and create a credit ACH from the processor’s bank account
for the total amount of refunds processed that day.

### Endpoint

POST   **/3p/api/v1/transactions/\{transaction\_uuid}/refund**

### Body Payload

<CodeGroup>
  ```json Example theme={"system"}
  {
      "amount": 12000,
      "client_reference_id": "refund_capture_25478"
  }
  ```
</CodeGroup>

| Fields                    | Type   | Is Required | Description    |
| ------------------------- | ------ | ----------- | -------------- |
| **amount**                | int    | Yes         | Refund amount. |
| **client\_reference\_id** | string | No          |                |

### Response Object

> *Note: Amounts and fees are expressed in cents.*

<CodeGroup>
  ```json Success (201) theme={"system"}
  {
      "status": true,
      "message": "",
      "data": {
          "uuid": "9be03fa2-bf19-415c-9fb6-eb903f7a0618",
          "transaction_uuid": "9bdeaf2e-3b14-4e39-bbb0-ade2077e9439",
          "amount": 12000,
          "status": "REFUND_PENDING",
          "created_at": "2024-04-23 12:13:46"
      },
      "errors": null,
      "error_code": null
  }
  ```
</CodeGroup>

### Errors and Warnings

| Code | Message |
| ---- | ------- |
| 401  |         |
| 403  |         |
| 422  |         |

## Refund Statuses

| Status                            | Description                                                                                                                      |
| --------------------------------- | -------------------------------------------------------------------------------------------------------------------------------- |
| **REFUND\_PENDING**               | The initial status, indicating that the refund request has not yet been processed.                                               |
| **REFUND\_CAPTURE\_ACH\_PENDING** | The refund has been processed and a debit ACH transaction has been initiated from the payee or processor (reverse of payout).    |
| **REFUND\_ACH\_PENDING**          | The debit ACH transaction is complete and a credit ACH transaction has been initiated to the payer (reverse of the transaction). |
| **REFUND\_COMPLETE**              | The refund process is complete and the payer has received the money.                                                             |
| **REFUND\_FAILED**                | The refund has failed due to some reason.                                                                                        |
