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

# Generate Card Statement

> Generate a white-label PDF statement for a card. POST /cards/{id}/statement. Requires cards:read scope.

## Overview

Generates a **bank-grade PDF statement** for a card and returns a download link. The statement
lists every settled card transaction grouped by day (funding, charges, fees, reversals,
termination refunds …) with a summary of Total Money In / Out, Available Balance, and — when the
provider ledger and available balance differ — a Pending Value line so the summary always balances.

Because CaaS businesses have no stored branding, you supply your own **white-label** branding in
the request body. Every field is optional; anything omitted falls back to a sensible default
(`brandName` defaults to your account display name, and the contact line is dropped entirely when
you provide no `contactEmail`/`phone`).

<Note>
  The returned `url` points to `cdn.fyatu.com` and is valid for **24 hours**, after which the file is
  automatically deleted. Fetch and store the PDF on your side if you need it longer.
</Note>

## Path Parameters

| Parameter | Type   | Description                 |
| --------- | ------ | --------------------------- |
| `id`      | string | The card ID (prefix `crd_`) |

## Body Parameters (all optional)

| Field          | Type   | Description                                                                               |
| -------------- | ------ | ----------------------------------------------------------------------------------------- |
| `brandColor`   | string | Hex color for the header, accents and totals row (e.g. `#2563eb`)                         |
| `brandName`    | string | Business/brand name shown in the header and footer. Defaults to your account display name |
| `brandLogo`    | string | Publicly reachable **PNG or JPG** logo URL, rendered in the header                        |
| `contactEmail` | string | Support email printed in the footer                                                       |
| `address`      | string | Business address printed under the header                                                 |
| `phone`        | string | Support phone printed in the footer                                                       |
| `website`      | string | Website printed in the header strip                                                       |

## Example

<CodeGroup>
  ```bash cURL theme={null}
  curl -X POST https://api.fyatu.com/api/v3.20/cards/crd_01HXYZ5555ABCDEF1111/statement \
    -H "Authorization: Bearer $FYATU_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "brandColor": "#2563eb",
      "brandName": "Acme Cards Ltd",
      "brandLogo": "https://acmecards.com/logo.png",
      "contactEmail": "support@acmecards.com",
      "address": "128 City Road, London EC1V 2NX, United Kingdom",
      "phone": "+44 20 7946 0958",
      "website": "https://acmecards.com"
    }'
  ```

  ```javascript Node.js theme={null}
  const resp = await fetch(
    'https://api.fyatu.com/api/v3.20/cards/crd_01HXYZ5555ABCDEF1111/statement',
    {
      method: 'POST',
      headers: {
        'Authorization': `Bearer ${process.env.FYATU_API_KEY}`,
        'Content-Type': 'application/json',
      },
      body: JSON.stringify({
        brandColor: '#2563eb',
        brandName: 'Acme Cards Ltd',
        brandLogo: 'https://acmecards.com/logo.png',
        contactEmail: 'support@acmecards.com',
      }),
    }
  );
  const { data } = await resp.json();
  console.log('Statement:', data.url);
  ```

  ```python Python theme={null}
  import os, requests

  resp = requests.post(
      'https://api.fyatu.com/api/v3.20/cards/crd_01HXYZ5555ABCDEF1111/statement',
      headers={'Authorization': f'Bearer {os.environ["FYATU_API_KEY"]}'},
      json={
          'brandColor': '#2563eb',
          'brandName': 'Acme Cards Ltd',
          'brandLogo': 'https://acmecards.com/logo.png',
          'contactEmail': 'support@acmecards.com',
      },
  )
  print('Statement:', resp.json()['data']['url'])
  ```
</CodeGroup>

## Success Response (200)

```json theme={null}
{
  "success": true,
  "status": 200,
  "message": "Statement generated",
  "data": {
    "url": "https://cdn.fyatu.com/statements/3f2a9c7e1b6d4085a1c2e3f4b5a69788c0d1e2f3a4b5c6d7e8f9011223344556.pdf",
    "expiresInHours": 24
  },
  "meta": {
    "requestId": "req_01HXY123456ABCDEF",
    "platform": "Fyatu CaaS",
    "timestamp": "2026-07-08T10:00:00Z"
  }
}
```

## Error Codes

| Code                  | HTTP | Cause                                                          |
| --------------------- | ---- | -------------------------------------------------------------- |
| `CARD_NOT_FOUND`      | 404  | Card does not exist or belongs to another business/environment |
| `CARD_PROVISIONING`   | 409  | Card is still being provisioned by the card network            |
| `PROVIDER_ERROR`      | 502  | Card network unavailable — retry with exponential back-off     |
| `SERVICE_UNAVAILABLE` | 503  | Statement generation is temporarily unavailable                |
| `INSUFFICIENT_SCOPE`  | 403  | Key lacks `cards:read` scope                                   |


## OpenAPI

````yaml v3.20/openapi.json POST /cards/{id}/statement
openapi: 3.1.0
info:
  title: FYATU CaaS API v3.20
  description: >-
    FYATU Cards-as-a-Service API â€” API key authentication, Cardholder
    lifecycle, Card issuance, Transactions, Webhooks, and Programs.
  version: 3.20.0
  contact:
    name: FYATU Support
    url: https://fyatu.com
    email: support@fyatu.com
servers:
  - url: https://api.fyatu.com/api/v3.20
    description: >-
      FYATU CaaS API â€” the environment (LIVE or SANDBOX) is determined by the
      API key, not the URL
security:
  - BearerAuth: []
tags:
  - name: Meta
    description: Liveness, account info, and supported event types
  - name: Account
    description: Account-level balance and funding status
  - name: Programs
    description: Read card program configuration
  - name: Cardholders
    description: Create and manage cardholder profiles
  - name: Cards
    description: Issue, fund, freeze, and terminate virtual cards
  - name: Transactions
    description: Read-only card transaction history
  - name: Webhooks
    description: Manage webhook endpoints for real-time event delivery
  - name: Products
    description: Read card product configurations
paths:
  /cards/{id}/statement:
    post:
      tags:
        - Cards
      summary: Generate card statement
      description: >-
        Generates a bank-grade PDF statement for a card using your own
        white-label branding (all fields optional), uploads it to storage, and
        returns a download link valid for 24 hours. Re-generating replaces the
        previous file. Requires the cards:read scope.
      operationId: generateCardStatement
      parameters:
        - name: id
          in: path
          required: true
          schema:
            type: string
          example: crd_01HXYZ5555ABCDEF1111
      requestBody:
        required: false
        content:
          application/json:
            schema:
              type: object
              properties:
                brandColor:
                  type: string
                  description: Hex brand color used for the header, accents and totals row.
                  example: '#2563eb'
                brandName:
                  type: string
                  description: >-
                    Business / brand name. Defaults to your account display name
                    when omitted.
                  example: Acme Cards Ltd
                brandLogo:
                  type: string
                  description: >-
                    Publicly reachable PNG or JPG logo URL shown in the
                    statement header.
                  example: https://acmecards.com/logo.png
                contactEmail:
                  type: string
                  example: support@acmecards.com
                address:
                  type: string
                  example: 128 City Road, London EC1V 2NX, United Kingdom
                phone:
                  type: string
                  example: +44 20 7946 0958
                website:
                  type: string
                  example: https://acmecards.com
            example:
              brandColor: '#2563eb'
              brandName: Acme Cards Ltd
              brandLogo: https://acmecards.com/logo.png
              contactEmail: support@acmecards.com
              address: 128 City Road, London EC1V 2NX, United Kingdom
              phone: +44 20 7946 0958
              website: https://acmecards.com
      responses:
        '200':
          description: Statement generated
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  status:
                    type: integer
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      url:
                        type: string
                        description: >-
                          Download link to the generated PDF. Expires after 24
                          hours.
                      expiresInHours:
                        type: integer
                  meta:
                    $ref: '#/components/schemas/Meta'
              example:
                success: true
                status: 200
                message: Statement generated
                data:
                  url: >-
                    https://cdn.fyatu.com/statements/3f2a9c7e1b6d4085a1c2e3f4b5a69788c0d1e2f3a4b5c6d7e8f9011223344556.pdf
                  expiresInHours: 24
                meta:
                  requestId: req_01HXY123456ABCDEF
                  platform: Fyatu CaaS
                  timestamp: '2026-07-08T10:00:00Z'
components:
  schemas:
    Meta:
      type: object
      properties:
        requestId:
          type: string
          example: req_a1b2c3d4e5f6a7b8c9d0e1f2
        platform:
          type: string
          example: Fyatu CaaS
        timestamp:
          type: string
          format: date-time
          example: '2026-05-22T15:00:00Z'
  securitySchemes:
    BearerAuth:
      type: http
      scheme: bearer
      description: >-
        API key from the FYATU CaaS portal. Pass as `Authorization: Bearer
        <key>`.

````