---
title: "Refunds"
description: "6 operations, with parameters and examples."
url: https://docs.fluveo.com/api/refunds/
---

> Index of every page: https://docs.fluveo.com/llms.txt. Integrating Fluveo? Read https://docs.fluveo.com/agents/integrate.md first.

> Too long? This page with code in one language only: https://docs.fluveo.com/api/refunds.curl.md (cURL), https://docs.fluveo.com/api/refunds.node.md (Node.js), https://docs.fluveo.com/api/refunds.python.md (Python), https://docs.fluveo.com/api/refunds.php.md (PHP).

# Refunds

6 operations, with parameters and examples.

A Refund returns all or part of a captured payment to the buyer. Fluveo reserves the amount in the store's books before it sends the refund, so a refund the store cannot cover is refused before any money moves.

Send every request to `https://api.fluveo.com/v1` with your secret key as a Bearer token. This page lists only what Fluveo serves; [the OpenAPI file](https://docs.fluveo.com/openapi.json) holds the same operations.

An operation or a parameter marked **Preview** works, but it is not locked yet and may change: [what Preview means](https://docs.fluveo.com/api.md#preview).

> **For AI agents:**
>
> Use plain HTTP; install no payments SDK. Send `Authorization: Bearer sk_test_...` and a fresh `Idempotency-Key` on every POST; reuse the same key only when you retry that same POST. Send only the documented parameters. An operation or a parameter marked Preview may change: prefer the ones without the mark.

## Creates a refund

`POST /v1/refunds`

Permission: [`rak_charge_write`](https://docs.fluveo.com/permissions.md#charge).

**Headers**

- `Idempotency-Key` (string, optional): Send a unique key, 1 to 255 characters, on every POST. A retry with the same key and the same body returns the first answer instead of acting twice (with Idempotent-Replayed: true); the same key with another body is refused. Keys are kept 7 days, except on POST /v1/checkout/sessions, POST /v1/checkout/sessions/{session} and POST /v1/webhook_endpoints, where a key holds 24 hours; webhook endpoint keys are also capped at the newest 32 per store and mode. Do not rely on a replay after that window. GET and DELETE ignore it.
- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

**Body parameters**

- `amount` (integer, optional): How much to refund, in the smallest unit. Leave it out to refund what is left.
- `charge` (string, optional): The charge to refund (ch_...). Send charge or payment_intent.
- `metadata` (object, optional): Up to 50 key-value pairs of your own, sent as metadata[key]=value: keys of 1 to 40 characters, values up to 500. Keys starting with fluveo_ are reserved. On an update, an empty value removes a key.
- `payment_intent` (string, optional): The PaymentIntent to refund (pi_...). Send payment_intent or charge.
- `reason` (enum, optional): Why you refund.

  One of: `duplicate`, `fraudulent`, `requested_by_customer`.

Use only the documented body parameters. Send a new `Idempotency-Key` with each new request, and the same key again only to retry that request.

Returns a [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) object.

**Request**

cURL:

```bash
curl https://api.fluveo.com/v1/refunds \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  --data-urlencode "amount=500" \
  --data-urlencode "payment_intent=pi_123" \
  --data-urlencode "reason=requested_by_customer"
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/refunds", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_test_...",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: new URLSearchParams([["amount","500"],["payment_intent","pi_123"],["reason","requested_by_customer"]]),
});
console.log(await response.json());
```

Python:

```python
import uuid

import requests

response = requests.post(
    "https://api.fluveo.com/v1/refunds",
    headers={"Authorization": "Bearer sk_test_...", "Idempotency-Key": str(uuid.uuid4())},
    data=[("amount", "500"), ("payment_intent", "pi_123"), ("reason", "requested_by_customer")],
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/refunds");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
    ],
    CURLOPT_POSTFIELDS => "amount=500&payment_intent=pi_123&reason=requested_by_customer",
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "amount": 500,
  "charge": "ch_123",
  "created": 1767225600,
  "currency": "usd",
  "id": "re_123",
  "metadata": {},
  "object": "refund",
  "payment_intent": "pi_123",
  "reason": "requested_by_customer",
  "status": "succeeded"
}
```

## Lists refund objects, newest first

`GET /v1/refunds`

Permission: [`rak_charge_read`](https://docs.fluveo.com/permissions.md#charge).

**Query parameters**

- `charge` (string, optional): Only the refunds of this charge.
- `created` (object, optional): Filter on the creation time, a Unix timestamp: created=<t> for an exact match, or created[gt], created[gte], created[lt], created[lte].
- `ending_before` (string, optional): Cursor: the id of the first object of the current page, to get the previous page. Do not send it with starting_after.
- `limit` (integer, optional): How many objects to return, from 1 to 100. Default 10.
- `payment_intent` (string, optional): Only the refunds of this PaymentIntent.
- `starting_after` (string, optional): Cursor: the id of the last object of the previous page, to get the next page. Do not send it with ending_before.

**Headers**

- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

Returns a list of [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) objects.

**Request**

cURL:

```bash
curl -G https://api.fluveo.com/v1/refunds \
  -H "Authorization: Bearer sk_test_..." \
  --data-urlencode "payment_intent=pi_123"
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/refunds" + "?" + new URLSearchParams([["payment_intent","pi_123"]]), {
  method: "GET",
  headers: {
    "Authorization": "Bearer sk_test_...",
  },
});
console.log(await response.json());
```

Python:

```python
import requests

response = requests.get(
    "https://api.fluveo.com/v1/refunds",
    headers={"Authorization": "Bearer sk_test_..."},
    params=[("payment_intent", "pi_123")],
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/refunds?payment_intent=pi_123");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
    ],
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "count": 1,
  "data": [
    {
      "amount": 500,
      "charge": "ch_123",
      "created": 1767225600,
      "currency": "usd",
      "id": "re_123",
      "metadata": {},
      "object": "refund",
      "payment_intent": "pi_123",
      "reason": "requested_by_customer",
      "status": "succeeded"
    }
  ],
  "has_more": false,
  "object": "list",
  "url": "/v1/refunds"
}
```

## Updates a refund

`POST /v1/refunds/{refund}`

Permission: [`rak_charge_write`](https://docs.fluveo.com/permissions.md#charge).

**Path parameters**

- `refund` (string, required): The Refund's id.

**Headers**

- `Idempotency-Key` (string, optional): Send a unique key, 1 to 255 characters, on every POST. A retry with the same key and the same body returns the first answer instead of acting twice (with Idempotent-Replayed: true); the same key with another body is refused. Keys are kept 7 days, except on POST /v1/checkout/sessions, POST /v1/checkout/sessions/{session} and POST /v1/webhook_endpoints, where a key holds 24 hours; webhook endpoint keys are also capped at the newest 32 per store and mode. Do not rely on a replay after that window. GET and DELETE ignore it.
- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

**Body parameters**

- `metadata` (object, optional): Up to 50 key-value pairs of your own, sent as metadata[key]=value: keys of 1 to 40 characters, values up to 500. Keys starting with fluveo_ are reserved. On an update, an empty value removes a key.

Use only the documented body parameters. Send a new `Idempotency-Key` with each new request, and the same key again only to retry that request.

Returns a [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) object.

**Request**

cURL:

```bash
curl https://api.fluveo.com/v1/refunds/re_123 \
  -H "Authorization: Bearer sk_test_..." \
  -H "Idempotency-Key: $(uuidgen)" \
  --data-urlencode "metadata[ticket]=4411"
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/refunds/re_123", {
  method: "POST",
  headers: {
    "Authorization": "Bearer sk_test_...",
    "Idempotency-Key": crypto.randomUUID(),
  },
  body: new URLSearchParams([["metadata[ticket]","4411"]]),
});
console.log(await response.json());
```

Python:

```python
import uuid

import requests

response = requests.post(
    "https://api.fluveo.com/v1/refunds/re_123",
    headers={"Authorization": "Bearer sk_test_...", "Idempotency-Key": str(uuid.uuid4())},
    data=[("metadata[ticket]", "4411")],
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/refunds/re_123");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "POST",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
        "Idempotency-Key: " . bin2hex(random_bytes(16)),
    ],
    CURLOPT_POSTFIELDS => "metadata%5Bticket%5D=4411",
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "amount": 500,
  "charge": "ch_123",
  "created": 1767225600,
  "currency": "usd",
  "id": "re_123",
  "metadata": {},
  "object": "refund",
  "payment_intent": "pi_123",
  "reason": "requested_by_customer",
  "status": "succeeded"
}
```

## Retrieves a refund

`GET /v1/refunds/{refund}`

Permission: [`rak_charge_read`](https://docs.fluveo.com/permissions.md#charge).

**Path parameters**

- `refund` (string, required): The Refund's id.

**Headers**

- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

Returns a [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) object.

**Request**

cURL:

```bash
curl https://api.fluveo.com/v1/refunds/re_123 \
  -H "Authorization: Bearer sk_test_..."
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/refunds/re_123", {
  method: "GET",
  headers: {
    "Authorization": "Bearer sk_test_...",
  },
});
console.log(await response.json());
```

Python:

```python
import requests

response = requests.get(
    "https://api.fluveo.com/v1/refunds/re_123",
    headers={"Authorization": "Bearer sk_test_..."},
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/refunds/re_123");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
    ],
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "amount": 500,
  "charge": "ch_123",
  "created": 1767225600,
  "currency": "usd",
  "id": "re_123",
  "metadata": {},
  "object": "refund",
  "payment_intent": "pi_123",
  "reason": "requested_by_customer",
  "status": "succeeded"
}
```

## Lists refund objects of the parent object

`GET /v1/charges/{charge}/refunds`

Permission: [`rak_charge_read`](https://docs.fluveo.com/permissions.md#charge).

**Path parameters**

- `charge` (string, required): The Charge's id.

**Query parameters**

- `ending_before` (string, optional, preview): Cursor: the id of the first object of the current page, to get the previous page. Do not send it with starting_after.
- `limit` (integer, optional): How many objects to return, from 1 to 100. Default 10.
- `starting_after` (string, optional, preview): Cursor: the id of the last object of the previous page, to get the next page. Do not send it with ending_before.

**Headers**

- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

Returns a list of [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) objects.

**Request**

cURL:

```bash
curl https://api.fluveo.com/v1/charges/ch_123/refunds \
  -H "Authorization: Bearer sk_test_..."
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/charges/ch_123/refunds", {
  method: "GET",
  headers: {
    "Authorization": "Bearer sk_test_...",
  },
});
console.log(await response.json());
```

Python:

```python
import requests

response = requests.get(
    "https://api.fluveo.com/v1/charges/ch_123/refunds",
    headers={"Authorization": "Bearer sk_test_..."},
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/charges/ch_123/refunds");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
    ],
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "data": [
    {
      "amount": 500,
      "charge": "ch_123",
      "created": 1767225600,
      "currency": "usd",
      "id": "re_123",
      "metadata": {},
      "object": "refund",
      "payment_intent": "pi_123",
      "reason": "requested_by_customer",
      "status": "succeeded"
    }
  ],
  "has_more": false,
  "object": "list",
  "url": "/v1/charges/{charge}/refunds"
}
```

## Retrieves a refund

`GET /v1/charges/{charge}/refunds/{refund}`

Permission: [`rak_charge_read`](https://docs.fluveo.com/permissions.md#charge).

**Path parameters**

- `charge` (string, required): The Charge's id.
- `refund` (string, required): The Refund's id.

**Headers**

- `Fluveo-Version` (enum, optional): Optional. The only version Fluveo serves is 2026-05-27.dahlia; any other value is refused with a 400. Every answer names that version in its own Fluveo-Version header, except the refusals Fluveo gives before it reads the request (no key, an unknown key, an unknown URL, a body that is not a form) and a file's bytes, which name no version and no Request-Id.

  One of: `2026-05-27.dahlia`.

Returns a [`refund`](https://docs.fluveo.com/api/refunds.md#object-refund) object.

**Request**

cURL:

```bash
curl https://api.fluveo.com/v1/charges/ch_123/refunds/re_123 \
  -H "Authorization: Bearer sk_test_..."
```

Node.js:

```javascript
const response = await fetch("https://api.fluveo.com/v1/charges/ch_123/refunds/re_123", {
  method: "GET",
  headers: {
    "Authorization": "Bearer sk_test_...",
  },
});
console.log(await response.json());
```

Python:

```python
import requests

response = requests.get(
    "https://api.fluveo.com/v1/charges/ch_123/refunds/re_123",
    headers={"Authorization": "Bearer sk_test_..."},
)
print(response.json())
```

PHP:

```php
<?php
$ch = curl_init("https://api.fluveo.com/v1/charges/ch_123/refunds/re_123");
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => "GET",
    CURLOPT_HTTPHEADER => [
        "Authorization: Bearer sk_test_...",
    ],
]);
echo curl_exec($ch);
```

*Response (abridged example)*

```json
{
  "amount": 500,
  "charge": "ch_123",
  "created": 1767225600,
  "currency": "usd",
  "id": "re_123",
  "metadata": {},
  "object": "refund",
  "payment_intent": "pi_123",
  "reason": "requested_by_customer",
  "status": "succeeded"
}
```

## The refund object

Ids start with `re_`.

**Attributes**

- `amount` (integer)
- `application` (enum, nullable): One of: `null`.
- `balance_transaction` (string, nullable, expandable): An id by default; send `expand[]=balance_transaction` to get the full balance_transaction object.
- `charge` (string, nullable, expandable): An id by default; send `expand[]=charge` to get the full charge object.
- `created` (integer)
- `currency` (string)
- `customer` (string, nullable, expandable): An id by default; send `expand[]=customer` to get the full customer or deleted_customer object.
- `customer_account` (enum, nullable): One of: `null`.
- `description` (string)
- `destination_details` (object)
- `failure_balance_transaction` (string, expandable): An id by default; send `expand[]=failure_balance_transaction` to get the full balance_transaction object.
- `failure_reason` (string)
- `id` (string)
- `instructions_email` (string)
- `metadata` (object, nullable)
- `next_action` (object)
- `object` (enum): One of: `refund`.
- `payment_intent` (string, nullable, expandable): An id by default; send `expand[]=payment_intent` to get the full payment_intent object.
- `payment_method` (string, nullable, expandable): An id by default; send `expand[]=payment_method` to get the full payment_method object.
- `pending_reason` (enum): One of: `charge_pending`, `insufficient_funds`, `processing`.
- `presentment_details` (object)
- `reason` (enum, nullable): One of: `duplicate`, `expired_uncaptured_charge`, `fraudulent`, `requested_by_customer`.
- `receipt_number` (string, nullable)
- `source_transfer_reversal` (string, nullable)
- `status` (string, nullable)
- `transfer_reversal` (string, nullable)
