> ## Documentation Index
> Fetch the complete documentation index at: https://wpay-feat-edp-guide.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Refund transaction

> Trigger a refund for a previously captured transaction.

A captured transaction can be refunded by calling the
[`POST /transactions/{transaction_id}/refunds`](/reference/transactions/refund-transaction)
API. Refunds can be full or partial.

If the transaction was not yet successfully captured, the operation will fail.
Authorized transactions can be [voided](/guides/api/resources/transactions/void-a-transaction) instead.

<CodeGroup>
  ```bash cURL
  curl -i -X POST "https://api.example.gr4vy.app/transactions/fe26475d-ec3e-4884-9553-f7356683f7f9/refunds" \
      -H "Authorization: Bearer [JWT_TOKEN]"
      -H "Content-Type: application/json" \
      -d '{
            "amount": 1299
          }'
  ```

  ```js Node
  var fetch = require("node-fetch");

  fetch(
    "https://api.example.gr4vy.app/transactions/fe26475d-ec3e-4884-9553-f7356683f7f9/refunds",
    {
      method: "POST",
      headers: {
        Authorization: "Bearer [JWT_TOKEN]",
        "Content-Type": "application/json",
      },
      body: JSON.stringify({
        amount: 1299,
      }),
    }
  );
  ```
</CodeGroup>
