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

> 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 (`8040`/`8041`) and define the date range (inclusive) by document date. `EndDate` cannot be before `StartDate` (`8042`).
* `CurrencyCode` 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 the customer has ever moved in, with the grand total (sum of Debit minus sum of Credit) for that currency across **all** activity up to `EndDate` (including anything before `StartDate`) — this equals that currency's running balance as of `EndDate`. **It is not affected by `StartDate`**: `StartDate` only controls which movements appear in `Lines`. Because of this, a currency can appear in `Totals` with no matching rows in `Lines` at all, if every movement in that currency happened before `StartDate`. Each row also carries the currency's short code and whether it is the company's default currency.
* `Lines[].TransactionTypeName` is the name of the document behind the line (e.g. sales invoice, incoming transfer).
* `Lines[].TransactionAmount`/`TransactionCurrencyId` hold the original document amount and currency when it can differ from `Debit`/`Credit`/`CurrencyCode` (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.

## Error codes

Codes this endpoint can return. The [general errors](/en/v1/guides/result-codes) that apply to every endpoint (authentication, permissions, request headers, daily limit) are not repeated here.

| Code   | HTTP | Meaning                                                                              |
| ------ | ---- | ------------------------------------------------------------------------------------ |
| `1000` | 404  | Customer not found or not visible to the user. Also returned by sub-record endpoints |
| `8040` | 400  | `StartDate` is required                                                              |
| `8041` | 400  | `EndDate` is required                                                                |
| `8042` | 400  | `EndDate` cannot be before `StartDate`                                               |
| `8043` | 400  | The currency given in `currencyCode` was not found                                   |


## OpenAPI

````yaml api-reference/openapi.json GET /api/v1/finance/customers/{customerId}/transactions
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://dev.noyax.com/services/noyax_api
security:
  - Bearer: []
tags:
  - name: Product Stock Status
  - name: Sections
  - name: Warehouses
  - name: Quotes
  - name: Product Critical Stock
  - name: Product groups
  - name: Product Parameter Definitions
  - name: Product Parameters
  - name: Product Prices
  - name: Products
  - name: Orders
  - name: Bank Accounts
  - name: Bank Internal Transfers
  - name: Bank Openings
  - name: Banks
  - name: Bank Transfers
  - name: Credit Card Collections
  - name: Customer Balances
  - name: Customer Transactions
  - name: Repayment Plans
  - name: Despatches
  - name: Cities
  - name: Countries
  - name: Currencies
  - name: Districts
  - name: Line Groups
  - 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 Telephones
paths:
  /api/v1/finance/customers/{customerId}/transactions:
    get:
      tags:
        - Customer Transactions
      summary: Get customer transactions
      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: currencyCode
          in: query
          description: >-
            Only include lines in this currency (currency code from GET
            /api/v1/definitions/currencies, for example TRY). When empty, all
            currencies are included.
          schema:
            type: string
        - 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/DataResultOfCustomerTransactionsDto'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResult'
              example:
                Success: false
                ResultCode: '8042'
                Message: EndDate cannot be before StartDate.
                Errors:
                  - Code: '8042'
                    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:
    DataResultOfCustomerTransactionsDto:
      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/CustomerTransactionsDto'
    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.
    CustomerTransactionsDto:
      type: object
      properties:
        Lines:
          type: array
          items:
            $ref: '#/components/schemas/CustomerTransactionDto'
          description: Ledger lines, ordered by document date.
        Totals:
          type: array
          items:
            $ref: '#/components/schemas/CustomerTransactionTotalDto'
          description: >-
            Grand total (sum of Debit minus sum of Credit) per currency, up to
            EndDate.
      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.
    CustomerTransactionDto:
      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
        TransactionTypeName:
          type:
            - 'null'
            - string
          description: Document type name.
          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
    CustomerTransactionTotalDto:
      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, up to EndDate.
          format: double
  securitySchemes:
    Bearer:
      type: http
      description: Access token obtained from the Noyax auth service with your API key.
      scheme: bearer
      bearerFormat: JWT

````