Account Statements

How to generate an account Statement on the Lync Dashboard

Overview

The Account Statements API allows you to generate, retrieve, and download financial statements for accounts within your institution. Statements provide a comprehensive view of all transactions during a specified period, including opening and closing balances, transaction details, and summary information.

Key features of the Account Statements API:

  • Generate statements for specific date ranges
  • Download statements in various formats (PDF, CSV)
  • Access detailed transaction data within statements
  • Retrieve structured statement data in JSON format
  • View summary information such as total credits, debits, and balance changes

Statements serve as official records of account activity for reconciliation, reporting, tax purposes, and providing financial information to your customers.


The Statement Object

PropertyTypeRequiredDescription
idstring (UUID)Unique identifier of the statement.
created_atstring (datetime)The date the statement was created.
stateenumCurrent state of the statement (PENDING, PROCESSING, COMPLETE, FAILED).
formatenumThe format of the statement (pdf, csv).
fromstring (date)The start date of the statement period.
tostring (date)The end date of the statement period.
account_idstring (UUID)The unique identifier of the account.

The Statement Details Object (JSON format)

When retrieving statement data in JSON format, you'll receive a more detailed object:

PropertyTypeRequiredDescription
idstring (UUID)Unique identifier of the statement.
created_atstring (datetime)The date the statement was created.
periodobjectStatement period details.
period.from_datestring (date)The start date of the statement period.
period.to_datestring (date)The end date of the statement period.
accountobjectAccount details.
account.idstring (UUID)The unique identifier of the account.
account.namestringThe name of the account.
account.currencystringThe currency of the account (ISO 4217).
account.client_referencestringInstitution generated client reference of the account.
balancesobjectBalance information.
balances.opening_ledger_balanceobjectOpening ledger balance.
balances.closing_ledger_balanceobjectClosing ledger balance.
balances.opening_available_balanceobjectOpening available balance.
balances.closing_available_balanceobjectClosing available balance.
summaryobjectTransaction summary information.
summary.total_entriesobjectSummary of all entries.
summary.total_entries.countnumberTotal number of transactions.
summary.total_entries.net_entry_amountobjectNet amount of all transactions.
summary.total_entries.indicatorenumOverall indicator ('credit' or 'debit').
summary.total_credit_entriesobjectSummary of credit entries.
summary.total_credit_entries.countnumberNumber of credit transactions.
summary.total_credit_entries.sumobjectTotal amount of credit transactions.
summary.total_debit_entriesobjectSummary of debit entries.
summary.total_debit_entries.countnumberNumber of debit transactions.
summary.total_debit_entries.sumobjectTotal amount of debit transactions.
entriesarrayList of transaction entries.


Understanding Statement Entry Items

When working with the Account Statements API, it's important to understand that the entries array in the statement JSON doesn't contain a completely new data structure. Instead, each entry item is fundamentally a Transaction object that you're already familiar with from the Transactions API, but with one significant enhancement:

Each entry in the statement is a standard Transaction object with the related_entity field expanded to include detailed information about the originating operation:


The Key Enhancement: Expanded Related Entity

In the regular Transactions API, the related_entity field only contains basic reference information:

// Regular Transaction object from Transactions API
{
  "id": "12345678-1234-1234-1234-123456789012",
  "account_id": "fedcba98-7654-3210-fedc-ba9876543210",
  "state": "COMPLETED",
  "created_date": "2023-05-05T14:30:00Z",
  "completion_date": "2023-05-05T14:35:22Z",
  "amount": {
    "value": 100000,
    "currency": "USD"
  },
  "type": "credit",
  "related_entity": {
    "type": "deposit",
    "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee"
  },
  // Other transaction fields...
}

However, in statement entries, the related_entity is expanded to include a data field containing the complete associated object:

// Entry item in Statement
{
  "id": "12345678-1234-1234-1234-123456789012",
  "account_id": "fedcba98-7654-3210-fedc-ba9876543210",
  "state": "COMPLETED",
  "created_date": "2023-05-05T14:30:00Z",
  "completion_date": "2023-05-05T14:35:22Z",
  "amount": {
    "value": 100000,
    "currency": "USD"
  },
  "type": "credit",
  "related_entity": {
    "type": "deposit",
    "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
    "data": {
      // Complete Deposit object
      "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
      "state": "COMPLETED",
      "created_date": "2023-05-05T14:30:00Z",
      "type": "BANK_TRANSFER",
      "narration": "Customer payment",
      // All other deposit fields...
    }
  },
  // Other transaction fields...
}

The data field inside related_entity contains a complete object that corresponds to the type of the related entity:

  1. For type: "deposit", the data field contains a complete Deposit object
  2. For type: "transfer", the data field contains a complete Transfer object
  3. For type: "conversion", the data field contains a complete Conversion object

This means that while using the standard Transactions API, you would need to make separate API calls to retrieve detailed information about deposits, transfers, or conversions. Still, with statement entries, this information is already included.

This design allows for efficient and comprehensive processing of financial data in one integrated structure, combining the simplicity of the Transaction model with the rich detail of the specific operation types.


Endpoints

List Statements

Retrieve a paginated list of statements for your institution.

GET /v2/statements

Query Parameters

ParameterTypeRequiredDescription
account_idstring (UUID)Filter statements by account ID.
formatenumFilter statements by format (pdf, csv).
stateenumFilter statements by state (PENDING, PROCESSING, COMPLETE, FAILED).
pagenumberPage number for pagination. Default: 1.
limitnumberNumber of items per page. Default: 20.

Example Request

curl -X GET "https://api.sandbox.waza.co/lync/banking/v2/statements?account_id=abcdef12-3456-7890-abcd-ef1234567890" \
  -H "x-waza-api-key: your_api_key_here"

Example Response

{
  "data": {
    "items": [
      {
        "id": "abcdef12-3456-7890-abcd-ef1234567890",
        "created_at": "2023-06-01T12:00:00Z",
        "updated_at": "2023-06-01T12:05:22Z",
        "state": "COMPLETE",
        "format": "pdf",
        "from": "2023-05-01",
        "to": "2023-05-31",
        "account_id": "fedcba98-7654-3210-fedc-ba9876543210"
      }
    ],
    "page": 1,
    "limit": 20,
    "totalItems": 1
  }
}

Create Statement

Generate a new statement for a specific account and date range.

POST /v2/statements

Request Body

ParameterTypeRequiredDescription
account_idstring (UUID)The unique identifier of the account.
fromstring (date)The start date of the statement period (YYYY-MM-DD).
tostring (date)The end date of the statement period (YYYY-MM-DD).
formatenumThe format of the statement (pdf, csv).

Example Request

curl -X POST "https://api.sandbox.waza.co/lync/banking/v2/statements" \
  -H "x-waza-api-key: your_api_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "account_id": "fedcba98-7654-3210-fedc-ba9876543210",
    "from": "2023-05-01",
    "to": "2023-05-31",
    "format": "pdf"
  }'

Example Response

{
  "data": {
    "id": "abcdef12-3456-7890-abcd-ef1234567890",
    "created_at": "2023-06-01T12:00:00Z",
    "updated_at": "2023-06-01T12:00:00Z",
    "state": "PENDING",
    "format": "pdf",
    "from": "2023-05-01",
    "to": "2023-05-31",
    "account_id": "fedcba98-7654-3210-fedc-ba9876543210"
  }
}

Get Statement by ID

Retrieve details for a specific statement.

GET /v2/statements/{id}

Path Parameters

ParameterTypeRequiredDescription
idstring (UUID)Unique identifier of the statement.

Example Request

curl -X GET "https://api.sandbox.waza.co/lync/banking/v2/statements/abcdef12-3456-7890-abcd-ef1234567890" \
  -H "x-waza-api-key: your_api_key_here"

Example Response

{
  "data": {
    "id": "abcdef12-3456-7890-abcd-ef1234567890",
    "created_at": "2023-06-01T12:00:00Z",
    "updated_at": "2023-06-01T12:05:22Z",
    "state": "COMPLETE",
    "format": "pdf",
    "from": "2023-05-01",
    "to": "2023-05-31",
    "account_id": "fedcba98-7654-3210-fedc-ba9876543210"
  }
}

Download Statement

Download a statement file in the format it was generated in.

GET /v2/statements/{id}/download

Path Parameters

ParameterTypeRequiredDescription
idstring (UUID)Unique identifier of the statement.

Example Request

curl -X GET "https://api.sandbox.waza.co/lync/banking/v2/statements/abcdef12-3456-7890-abcd-ef1234567890/download" \
  -H "x-waza-api-key: your_api_key_here" \
  --output statement.pdf

Response

Binary file stream with the appropriate Content-Type header (application/pdf or text/csv).


Get Statement JSON Data

Retrieve the statement data in JSON format for more detailed processing.

GET /v2/statements/{id}/data

Path Parameters

ParameterTypeRequiredDescription
idstring (UUID)Unique identifier of the statement.

Example Request

curl -X GET "https://api.sandbox.waza.co/lync/banking/v2/statements/abcdef12-3456-7890-abcd-ef1234567890/data" \
  -H "x-waza-api-key: your_api_key_here"

Example Response

{
  "data": {
    "id": "abcdef12-3456-7890-abcd-ef1234567890",
    "created_at": "2023-06-01T12:00:00Z",
    "period": {
      "from_date": "2023-05-01",
      "to_date": "2023-05-31"
    },
    "account": {
      "id": "fedcba98-7654-3210-fedc-ba9876543210",
      "name": "Main Operating Account",
      "currency": "USD",
      "client_reference": "ops-account-001"
    },
    "balances": {
      "opening_ledger_balance": {
        "value": 500000,
        "currency": "USD"
      },
      "closing_ledger_balance": {
        "value": 750000,
        "currency": "USD"
      },
      "opening_available_balance": {
        "value": 500000,
        "currency": "USD"
      },
      "closing_available_balance": {
        "value": 750000,
        "currency": "USD"
      }
    },
    "summary": {
      "total_entries": {
        "count": 15,
        "net_entry_amount": {
          "value": 250000,
          "currency": "USD"
        },
        "indicator": "credit"
      },
      "total_credit_entries": {
        "count": 10,
        "sum": {
          "value": 500000,
          "currency": "USD"
        }
      },
      "total_debit_entries": {
        "count": 5,
        "sum": {
          "value": 250000,
          "currency": "USD"
        }
      }
    },
    "entries": [
      {
        "id": "12345678-1234-1234-1234-123456789012",
        "account_id": "fedcba98-7654-3210-fedc-ba9876543210",
        "state": "COMPLETED",
        "created_date": "2023-05-05T14:30:00Z",
        "completion_date": "2023-05-05T14:35:22Z",
        "amount": {
          "value": 100000,
          "currency": "USD"
        },
        "type": "credit",
        "balance_before": {
          "value": 500000,
          "currency": "USD"
        },
        "balance_after": {
          "value": 600000,
          "currency": "USD"
        },
        "action": "inbound_funds",
        "related_entity": {
          "type": "deposit",
          "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
          "data": {
            "id": "aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
            "state": "COMPLETED",
            "created_date": "2023-05-05T14:30:00Z",
            "type": "BANK_TRANSFER",
            "narration": "Customer payment",
            "sender": {
              "name": "Acme Inc.",
              "bank_account": {
                "bank_name": "Chase Bank",
                "account_number": "****5678"
              }
            }
          }
        }
      }
      // Additional entries...
    ]
  }
}

Statement States

StateDescription
PENDINGStatement generation has been requested but not yet started.
PROCESSINGStatement is currently being generated.
COMPLETEStatement has been successfully generated and is available for download.
FAILEDStatement generation failed.

Statement Formats

FormatDescriptionContent-Type
pdfPortable Document Format suitable for printing and archiving.application/pdf
csvComma-Separated Values format for data analysis and import into spreadsheets.text/csv