> ## 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.

# Download Card Statement

> Download a PDF statement for a card with transaction history, business branding, and card details. GET /cards/{id}/statement.

## Overview

Generate a bank-grade PDF statement for a card. The statement includes your business branding
(logo, colors, company details), a Card Information panel, a balance Summary, and a full,
day-grouped transaction history.

The PDF is white-labeled with the branding configured in your Business Settings and is uploaded
to storage — the endpoint responds with a **302 redirect** to a `cdn.fyatu.com` download link.
Following the redirect (browsers and most HTTP clients do this automatically) downloads the PDF.

<Note>
  The download link is valid for **24 hours**, after which the file is automatically deleted. Store
  the PDF on your side if you need it longer.
</Note>

## Endpoint

```
GET /api/v3/cards/{cardId}/statement
```

**Scope required:** `cards:read`

## Path Parameters

| Parameter | Type   | Required | Description            |
| --------- | ------ | -------- | ---------------------- |
| `cardId`  | string | Yes      | Unique card identifier |

## Query Parameters

| Parameter | Type   | Required | Description                                                |
| --------- | ------ | -------- | ---------------------------------------------------------- |
| `from`    | string | No       | Start date (`YYYY-MM-DD`). Defaults to card creation date. |
| `to`      | string | No       | End date (`YYYY-MM-DD`). Defaults to today.                |

## Response

Responds with a **302 redirect** whose `Location` header is the download link, e.g.:

```
Location: https://cdn.fyatu.com/statements/3f2a9c7e1b6d4085a1c2e3f4b5a69788c0d1e2f3a4b5c6d7e8f9011223344556.pdf
```

Following the redirect returns the PDF (`application/pdf`). The link is valid for 24 hours.

## Statement Contents

The generated PDF includes:

* **Header** — business logo, name, and "CARD STATEMENT" on a branded band, plus address & website
* **Card Information** — cardholder, masked card number, expiry, scheme, status
* **Summary** — Available Balance, Total Money In, Total Money Out, Pending Value (shown only when there is a discrepancy), Currency
* **Transaction Table** — transactions grouped by day, with Time, Type (e.g. `DEBIT · Cross-border Fee`, `CREDIT · Funding`), Description, Money Out and Money In columns, plus a totals row
* **Footer** — your own support contact and a disclaimer (white-label)

## Example Usage

<CodeGroup>
  ```php PHP theme={null}
  <?php
  $cardId = 'CRD678A3B4C5D6E7';

  // Download statement for a specific date range
  $url = "https://api.fyatu.com/api/v3/cards/{$cardId}/statement?from=2026-03-01&to=2026-03-31";

  $response = file_get_contents($url, false, stream_context_create([
      'http' => [
          'method' => 'GET',
          'header' => 'Authorization: Bearer ' . $accessToken,
      ]
  ]));

  // Save to file
  file_put_contents("card_statement_{$cardId}.pdf", $response);
  ```

  ```javascript Node.js theme={null}
  const cardId = 'CRD678A3B4C5D6E7';

  const response = await fetch(
    `https://api.fyatu.com/api/v3/cards/${cardId}/statement?from=2026-03-01&to=2026-03-31`,
    {
      headers: {
        'Authorization': `Bearer ${accessToken}`,
      }
    }
  );

  const buffer = await response.arrayBuffer();
  fs.writeFileSync(`card_statement_${cardId}.pdf`, Buffer.from(buffer));
  ```
</CodeGroup>

## Error Responses

### Card Not Found (404)

```json theme={null}
{
  "success": false,
  "status": 404,
  "message": "Card not found",
  "error": { "code": "NOT_FOUND" }
}
```

### Card Still Provisioning (202)

```json theme={null}
{
  "success": false,
  "status": 202,
  "message": "Card is still being provisioned",
  "error": { "code": "CARD_PROVISIONING" }
}
```

<Tip>
  The statement uses your business branding from Business Settings (logo, colors, company name and address). Make sure to configure your branding for a professional white-labeled statement.
</Tip>

<Note>
  If no date range is specified, the statement covers the entire card lifetime from creation date to today.
</Note>


## OpenAPI

````yaml v3/openapi.json GET /cards/{cardId}/statement
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:
  /cards/{cardId}/statement:
    get:
      tags:
        - Cards
      summary: Download Card Statement
      description: >-
        Download a white-labeled PDF statement for a card. Includes business
        branding, cardholder info, and full transaction history for the
        requested period.
      operationId: getCardStatement
      parameters:
        - name: cardId
          in: path
          required: true
          description: Card ID
          schema:
            type: string
        - name: from
          in: query
          required: false
          description: Start date (YYYY-MM-DD). Defaults to card creation date.
          schema:
            type: string
            format: date
            example: '2026-03-01'
        - name: to
          in: query
          required: false
          description: End date (YYYY-MM-DD). Defaults to today.
          schema:
            type: string
            format: date
            example: '2026-03-31'
      responses:
        '200':
          description: PDF statement file
          content:
            application/pdf:
              schema:
                type: string
                format: binary
          headers:
            Content-Disposition:
              description: >-
                Filename in format:
                statement_{scheme}_{cardholder_name}_{id}.pdf
              schema:
                type: string
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - BearerAuth: []
components:
  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'
    NotFound:
      description: Resource not found
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorResponse'
          example:
            success: false
            status: 404
            message: Wallet not found
            error:
              code: RESOURCE_NOT_FOUND
            meta:
              requestId: req_abc123
              timestamp: '2026-01-05T10:30:00+00:00'
  schemas:
    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)
    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
    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
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: JWT access token obtained from /auth/token

````