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

# List Refunds

> List all refunds with pagination — track refund status, amounts, and associated collections. GET /refunds.

## Overview

Retrieve a paginated list of refunds for your application.

## Query Parameters

| Parameter      | Type    | Description                                   |
| -------------- | ------- | --------------------------------------------- |
| `page`         | integer | Page number (default: 1)                      |
| `limit`        | integer | Items per page (default: 20, max: 100)        |
| `status`       | string  | Filter by status (PENDING, COMPLETED, FAILED) |
| `collectionId` | string  | Filter by original collection ID              |
| `dateFrom`     | string  | Filter from date (YYYY-MM-DD)                 |
| `dateTo`       | string  | Filter to date (YYYY-MM-DD)                   |

## Response

| Field        | Type   | Description            |
| ------------ | ------ | ---------------------- |
| `refunds`    | array  | List of refund objects |
| `pagination` | object | Pagination info        |

### Refund Object

| Field               | Type   | Description                            |
| ------------------- | ------ | -------------------------------------- |
| `refundId`          | string | Unique refund identifier               |
| `collectionId`      | string | Original collection ID                 |
| `amount`            | number | Refunded amount                        |
| `currency`          | string | Currency code                          |
| `reason`            | string | Reason code (e.g., `CUSTOMER_REQUEST`) |
| `reasonDescription` | string | Human-readable reason description      |
| `status`            | string | Refund status                          |
| `completedAt`       | string | Completion timestamp                   |
| `createdAt`         | string | Creation timestamp                     |

## Example Usage

<CodeGroup>
  ```php PHP theme={null}
  <?php
  // Get all refunds from the last 30 days
  $params = http_build_query([
      'dateFrom' => date('Y-m-d', strtotime('-30 days')),
      'dateTo' => date('Y-m-d'),
      'limit' => 50
  ]);

  $response = file_get_contents(
      "https://api.fyatu.com/api/v3/refunds?{$params}",
      false,
      stream_context_create([
          'http' => [
              'method' => 'GET',
              'header' => 'Authorization: Bearer ' . $accessToken
          ]
      ])
  );

  $result = json_decode($response, true);

  $totalRefunded = 0;
  foreach ($result['data']['refunds'] as $refund) {
      if ($refund['status'] === 'COMPLETED') {
          $totalRefunded += $refund['amount'];
      }
      echo "{$refund['refundId']}: {$refund['amount']} {$refund['currency']} - {$refund['status']}\n";
  }

  echo "Total refunded: $totalRefunded USD\n";
  ```

  ```javascript Node.js theme={null}
  // Get all refunds from the last 30 days
  const params = new URLSearchParams({
    dateFrom: new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString().split('T')[0],
    dateTo: new Date().toISOString().split('T')[0],
    limit: '50'
  });

  const response = await fetch(
    `https://api.fyatu.com/api/v3/refunds?${params}`,
    {
      headers: {
        'Authorization': `Bearer ${accessToken}`
      }
    }
  );

  const result = await response.json();

  let totalRefunded = 0;
  for (const refund of result.data.refunds) {
    if (refund.status === 'COMPLETED') {
      totalRefunded += refund.amount;
    }
    console.log(`${refund.refundId}: ${refund.amount} ${refund.currency} - ${refund.status}`);
  }

  console.log(`Total refunded: ${totalRefunded} USD`);
  ```
</CodeGroup>

## Example Response

```json theme={null}
{
  "success": true,
  "status": 200,
  "message": "Refunds retrieved successfully",
  "data": {
    "refunds": [
      {
        "refundId": "ref_a1b2c3d4e5f6",
        "collectionId": "col_a1b2c3d4e5f6",
        "amount": 25.00,
        "currency": "USD",
        "reason": "CUSTOMER_REQUEST",
        "reasonDescription": "Customer requested refund",
        "status": "COMPLETED",
        "completedAt": "2026-01-08T14:00:00+00:00",
        "createdAt": "2026-01-08T13:45:00+00:00"
      }
    ],
    "pagination": {
      "currentPage": 1,
      "itemsPerPage": 20,
      "totalItems": 12,
      "totalPages": 1
    }
  },
  "meta": {
    "requestId": "req_reflist123",
    "timestamp": "2026-01-08T15:00:00+00:00"
  }
}
```

## Filtering Examples

### Refunds for a Specific Collection

```
GET /refunds?collectionId=col_a1b2c3d4e5f6
```

### Completed Refunds Only

```
GET /refunds?status=COMPLETED
```

### This Month's Refunds

```
GET /refunds?dateFrom=2026-01-01&dateTo=2026-01-31
```

<Tip>
  Use refund reports for accounting reconciliation and to track refund rates over time.
</Tip>


## OpenAPI

````yaml v3/openapi.json GET /refunds
openapi: 3.1.0
info:
  title: FYATU API v3
  description: >-
    FYATU API v3 with JWT authentication for Collections, Payouts, and Card
    Issuing.
  version: 3.0.0
  contact:
    name: FYATU Support
    url: https://fyatu.com
    email: support@fyatu.com
servers:
  - url: https://api.fyatu.com/api/v3
    description: Production
security: []
tags:
  - name: Authentication
    description: JWT token management endpoints
  - name: Account
    description: Business account, wallet, and address management
  - name: Collections
    description: Accept payments from customers via checkout sessions
  - name: Refunds
    description: Issue refunds for completed collections
  - name: Payouts
    description: Send money to Fyatu account holders
  - name: Cardholders
    description: Cardholder management for card issuing programs
  - name: Cards
    description: Issue, fund, freeze, and manage virtual cards
  - name: Webhooks
    description: Webhook configuration and management
paths:
  /refunds:
    get:
      tags:
        - Refunds
      summary: List Refunds
      description: Retrieve a paginated list of refunds with optional filtering.
      operationId: listRefunds
      parameters:
        - name: page
          in: query
          schema:
            type: integer
            default: 1
        - name: limit
          in: query
          schema:
            type: integer
            default: 20
            maximum: 100
        - name: status
          in: query
          schema:
            type: string
            enum:
              - PENDING
              - COMPLETED
              - FAILED
        - name: collectionId
          in: query
          schema:
            type: string
        - name: dateFrom
          in: query
          schema:
            type: string
            format: date
        - name: dateTo
          in: query
          schema:
            type: string
            format: date
      responses:
        '200':
          description: Refunds retrieved successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RefundsListResponse'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - BearerAuth: []
components:
  schemas:
    RefundsListResponse:
      type: object
      properties:
        success:
          type: boolean
          example: true
        status:
          type: integer
          example: 200
        message:
          type: string
        data:
          type: object
          properties:
            refunds:
              type: array
              items:
                $ref: '#/components/schemas/RefundSummary'
            pagination:
              $ref: '#/components/schemas/PaginationAlt'
        meta:
          $ref: '#/components/schemas/Meta'
    RefundSummary:
      type: object
      properties:
        refundId:
          type: string
        collectionId:
          type: string
        amount:
          type: number
        currency:
          type: string
        reason:
          type: string
          description: Reason code
        reasonDescription:
          type: string
          description: Human-readable reason
        status:
          type: string
        completedAt:
          type: string
          format: date-time
        createdAt:
          type: string
          format: date-time
    PaginationAlt:
      type: object
      properties:
        currentPage:
          type: integer
        itemsPerPage:
          type: integer
        totalItems:
          type: integer
        totalPages:
          type: integer
    Meta:
      type: object
      properties:
        requestId:
          type: string
          description: Unique request ID for tracking
          example: req_abc123def456
        timestamp:
          type: string
          format: date-time
          description: ISO 8601 timestamp of the response
    ErrorResponse:
      type: object
      properties:
        success:
          type: boolean
          example: false
        status:
          type: integer
          example: 401
        message:
          type: string
          example: Invalid credentials
        error:
          $ref: '#/components/schemas/Error'
        meta:
          $ref: '#/components/schemas/Meta'
    Error:
      type: object
      properties:
        code:
          type: string
          description: Error code for programmatic handling
          example: AUTH_INVALID_CREDENTIALS
        details:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
          description: Validation error details (for VALIDATION_ERROR)
    ValidationError:
      type: object
      properties:
        field:
          type: string
          description: Field that failed validation
          example: appId
        message:
          type: string
          description: Validation error message
          example: AppId is required
  responses:
    Unauthorized:
      description: Authentication required or token invalid
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            status: 401
            message: Unable to identify business
            error:
              code: AUTH_TOKEN_INVALID
            meta:
              requestId: req_abc123
              timestamp: '2026-01-05T10:30:00+00:00'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from /auth/token

````