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

# Customer statement

> The customer's ledger with a running balance.

Read-only report: nothing on this page can be created, updated or deleted through the API.

The response has two lists: `Lines` (the ledger) and `Totals` (grand total per currency).

* `StartDate` and `EndDate` are required (`1023`/`1024`) and define the date range (inclusive) by document date. `EndDate` cannot be before `StartDate` (`1025`).
* `CurrencyId` narrows both `Lines` and `Totals` to one currency; omit it to get every currency.
* `Lines` are ordered by document date, then by internal document order.
* `Lines[].Balance` is a **running balance per currency**: it is the cumulative Debit − Credit for that specific currency up to and including this line, not a single consolidated total across currencies. When the customer has movements in more than one currency, each currency has its own running sequence.
* `Totals` has one row per currency that appears in `Lines`, with the grand total (sum of Debit minus sum of Credit) for that currency over the whole date range — this equals the last line's `Balance` for that currency. Each row also carries the currency's short code and whether it is the company's default currency.
* `Lines[].TransactionType` is the raw document type code; `TransactionTypeName` is its resolved English name, from the table below.
* `Lines[].TransactionAmount`/`TransactionCurrencyId` hold the original document amount and currency when it can differ from `Debit`/`Credit`/`CurrencyId` (e.g. a bank transfer booked in the account's currency but posted to the customer in another). They are `null` when the line's own currency already matches the document's currency, since `Debit`/`Credit` already represent it in that case — this is expected for most invoice/order lines, not a missing value.
* `Lines[].InstallmentCount` is the number of payment installments linked to this transaction; `0` when there are none.

## Transaction types

`TransactionType` identifies the kind of document behind the line.

| Code | Meaning                                    |
| ---- | ------------------------------------------ |
| 101  | Customer opening balance                   |
| 102  | Debit note                                 |
| 103  | Credit note                                |
| 104  | Customer transfer                          |
| 111  | Purchase order                             |
| 112  | Sales order                                |
| 121  | Purchase invoice                           |
| 122  | Sales invoice                              |
| 123  | Purchase return invoice                    |
| 124  | Sales return invoice                       |
| 131  | Producer receipt                           |
| 141  | Purchase self-employment receipt           |
| 201  | Customer collection (cash)                 |
| 202  | Customer payment (cash)                    |
| 203  | Customer collection and payment (cash)     |
| 211  | Bank deposit (from cash)                   |
| 212  | Bank withdrawal (to cash)                  |
| 213  | Bank deposit and withdrawal (from/to cash) |
| 221  | Cash opening balance                       |
| 222  | Cash transfer                              |
| 231  | Expense (cash)                             |
| 241  | Check/note collection (cash)               |
| 242  | Note payment (cash)                        |
| 250  | Salary payment (cash)                      |
| 251  | Overtime payment (cash)                    |
| 255  | Advance payment (cash)                     |
| 256  | Travel allowance payment (cash)            |
| 260  | Refund from employee (cash)                |
| 301  | Incoming transfer                          |
| 302  | Outgoing transfer                          |
| 303  | Incoming and outgoing transfer             |
| 311  | Bank account opening balance               |
| 312  | Bank transfer                              |
| 321  | Credit card                                |
| 322  | Bank repayment                             |
| 331  | Expense (bank account)                     |
| 341  | Check/note collection (bank)               |
| 342  | Check/note payment (bank)                  |
| 343  | Check/note returned to portfolio           |
| 350  | Salary payment (bank)                      |
| 351  | Overtime payment (bank)                    |
| 355  | Advance payment (bank)                     |
| 356  | Travel allowance payment (bank)            |
| 400  | Check movement                             |
| 450  | Note movement                              |
| 500  | Journal entry                              |
| 610  | Payroll accrual                            |
| 620  | Payroll deduction                          |


## OpenAPI

````yaml api-reference/openapi.json GET /api/v1/customers/{customerId}/statement
openapi: 3.1.1
info:
  title: Noyax API
  description: Server-to-server API for integrations to access Noyax data.
  version: '1.0'
servers:
  - url: https://api.noyax.com
security:
  - Bearer: []
tags:
  - name: Sections
  - name: Warehouses
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Shipment Definitions
  - name: Units
  - name: VAT rates
  - name: Customer Addresses
  - name: Customer Bank Accounts
  - name: Customer Definitions
  - name: Customer Group Members
  - name: Customer Links
  - name: Customer Parameters
  - name: Customer Representatives
  - name: Customers
  - name: Customer Statement
  - name: Customer Telephones
paths:
  /api/v1/customers/{customerId}/statement:
    get:
      tags:
        - Customer Statement
      summary: Get customer statement
      description: >-
        Returns the customer's ledger lines between StartDate and EndDate
        (inclusive), ordered by document date, with a running balance per line.
        Read-only report; nothing here can be created, updated or deleted
        through the API.
      parameters:
        - name: customerId
          in: path
          description: Customer ID.
          required: true
          schema:
            type: string
            format: uuid
        - name: startDate
          in: query
          description: Required. Start of the date range (inclusive).
          schema:
            type: string
            format: date-time
        - name: endDate
          in: query
          description: >-
            Required. End of the date range (inclusive). Cannot be before
            StartDate.
          schema:
            type: string
            format: date-time
        - name: currencyId
          in: query
          description: >-
            Only include lines in this currency, from GET
            /api/v1/definitions/currencies. When empty, all currencies are
            included.
          schema:
            type: string
            format: uuid
        - name: X-UserID
          in: header
          description: >-
            ID of the Noyax user the request is made on behalf of. Written to
            the audit fields of created, updated and deleted records.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-CompanyID
          in: header
          description: >-
            ID of the company. The user must be assigned to this company. All
            reads and writes are limited to this company.
          required: true
          schema:
            minimum: 1
            type: integer
            format: int32
        - name: X-PeriodID
          in: header
          description: >-
            ID of the accounting period. Optional for customer endpoints; if
            sent, it is written to created records.
          schema:
            minimum: 1
            type: integer
            format: int32
      responses:
        '200':
          description: OK
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DataResultOfCustomerStatementDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '1025'
                Message: EndDate cannot be before StartDate.
                Errors:
                  - Code: '1025'
                    Message: EndDate cannot be before StartDate.
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0102'
                Message: Token has expired. Obtain a new token using the refresh token.
                Errors:
                  - Code: '0102'
                    Message: >-
                      Token has expired. Obtain a new token using the refresh
                      token.
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0110'
                Message: You do not have permission for this operation.
                Errors:
                  - Code: '0110'
                    Message: You do not have permission for this operation.
        '429':
          description: Too Many Requests
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '0120'
                Message: Daily request limit (10000) exceeded.
                Errors:
                  - Code: '0120'
                    Message: Daily request limit (10000) exceeded.
components:
  schemas:
    DataResultOfCustomerStatementDto:
      required:
        - Success
        - ResultCode
        - Data
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: true
        ResultCode:
          type: string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
          example: '0000'
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Data:
          $ref: '#/components/schemas/CustomerStatementDto'
    ErrorResult:
      type: object
      properties:
        Success:
          type: boolean
          description: Whether the operation succeeded.
          example: false
        ResultCode:
          type:
            - 'null'
            - string
          description: >-
            "0000" on success. On failure, the code of the first error; all
            errors are listed in Errors.
        Message:
          type:
            - 'null'
            - string
          description: >-
            Error message when Success is false. Messages of all errors are
            joined into a single text.
        Errors:
          type:
            - 'null'
            - array
          items:
            $ref: '#/components/schemas/ResultError'
          description: All errors with their codes. Only present when Success is false.
    CustomerStatementDto:
      type: object
      properties:
        Lines:
          type: array
          items:
            $ref: '#/components/schemas/CustomerStatementLineDto'
          description: Ledger lines, ordered by document date.
        Totals:
          type: array
          items:
            $ref: '#/components/schemas/CustomerStatementTotalDto'
          description: >-
            Grand total (sum of Debit minus sum of Credit) per currency, for the
            same date range and filters as Lines.
      description: Response data. Null when Success is false.
    ResultError:
      required:
        - Code
        - Message
      type: object
      properties:
        Code:
          type: string
          description: Error code. See the result codes page for the full list.
        Message:
          type: string
          description: Error description.
    CustomerStatementLineDto:
      type: object
      properties:
        Id:
          type: string
          description: Transaction ID.
          format: uuid
        Date:
          type:
            - 'null'
            - string
          description: Document date.
          format: date-time
        Debit:
          type: number
          description: Debit amount, in Balance's currency.
          format: double
        Credit:
          type: number
          description: Credit amount, in Balance's currency.
          format: double
        Balance:
          type: number
          description: Running balance up to and including this line, in CurrencyId.
          format: double
        TransactionType:
          type: integer
          description: >-
            Document type code. See the [customer
            statement](/en/v1/customers/statement) page for the full list.
          format: int32
          example: 122
        TransactionTypeName:
          type:
            - 'null'
            - string
          description: Document type name, resolved from TransactionType.
          example: Sales invoice
        CurrencyId:
          type:
            - 'null'
            - string
          description: >-
            ID of the currency this line's Debit/Credit/Balance are in, from GET
            /api/v1/definitions/currencies.
          format: uuid
        Description:
          type:
            - 'null'
            - string
          description: Description.
        DocumentNumber:
          type:
            - 'null'
            - string
          description: Document number.
        ExchangeRate:
          type:
            - 'null'
            - number
          description: Exchange rate applied to this line.
          format: double
        DueDate:
          type:
            - 'null'
            - string
          description: Due date.
          format: date-time
        TransactionAmount:
          type:
            - 'null'
            - number
          description: >-
            Original transaction amount, in TransactionCurrencyId. Null when the
            document's own currency already matches CurrencyId, since
            Debit/Credit already represent it in that case.
          format: double
        TransactionCurrencyId:
          type:
            - 'null'
            - string
          description: Currency of TransactionAmount.
          format: uuid
        InstallmentCount:
          type: integer
          description: >-
            Number of installments linked to this transaction. 0 when there are
            none.
          format: int32
        DocumentUrl:
          type:
            - 'null'
            - string
          description: URL of the attached document, when one exists.
        CreateDate:
          type:
            - 'null'
            - string
          description: Creation date.
          format: date-time
        ModifyDate:
          type:
            - 'null'
            - string
          description: Last modification date.
          format: date-time
    CustomerStatementTotalDto:
      type: object
      properties:
        CurrencyId:
          type: string
          description: Currency ID.
          format: uuid
        CurrencyCode:
          type:
            - 'null'
            - string
          description: Currency short code.
          example: TRY
        IsDefault:
          type: boolean
          description: Whether this is the company's default currency.
        Balance:
          type: number
          description: Sum of Debit minus sum of Credit, in this currency.
          format: double
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````