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

# Post account balances

> Report account balances for a given payer.



## OpenAPI

````yaml post /api/v1/balances
openapi: 3.0.1
info:
  description: >
    # General info

    ## Base API URL for environments:

    * TEST: https://api.plais-sandbox.finventi.com

    * PROD: https://api.plais.finventi.com


    # Authentication

    <b>NOTE:</b> IP whitelisting is mandatory to gain access to our APIs in both
    TEST and PROD environments. To register your IPs, please contact
    `connectors-support@inventi.lt`.


    Our API uses OAuth 2.0 for authentication. To access the API, you need to
    obtain a bearer token from the authorization server.


    ### Obtain a Bearer Token

    To get a bearer token, use the following cURL command:


    ```

    curl -X POST \

    --location
    '<auth-server-url>/realms/<client-name>/protocol/openid-connect/token' \

    --header 'Content-Type: application/x-www-form-urlencoded' \

    --data-urlencode 'grant_type=client_credentials' \

    --data-urlencode 'client_id=api-plais-client' \

    --data-urlencode 'client_secret=<client-secret>'

    ```


    where:


    `<auth-server-url>` is either `https://auth.sandbox.finventi.com/` (TEST) or
    `https://auth.finventi.com/` (PROD).


    `<client-ID>` is a value of TenantID that was assigned by INVENTI team
    during initial configuration and could be found in Configuration Matrix that
    was shared to your representative.


    `<client-name>` is a value that can be obtained by logging into SEPA
    Dashboard UI and going to <i>User Management</i> -> <i>Clients</i> ->
    `api-plais-client` -> <i>Credentials</i> -> <i>Client Secret</i>.


    <b>NOTE:</b> The token is valid for 45 minutes.


    ### Include the Bearer Token in Requests

    Include the obtained token in the `Authorization` header of your API
    requests with the `Bearer` prefix:


    ```

    Authorization: Bearer <bearer-token>

    ```


    ### Example Request:

    ```

    curl --location --request POST
    'https://api.plais-sandbox.finventi.com/api/v1/orders' \

    --header 'Authorization: Bearer <bearer-token>' \

    ```
  title: PLAIS API
  version: 0.1.0
servers:
  - description: TEST environment
    url: https://api.plais-sandbox.finventi.com
security: []
paths:
  /api/v1/balances:
    post:
      tags:
        - Account Balances
      summary: Post Account Balances
      description: Report account balances for a given payer
      operationId: postAccountBalances
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AccountBalancesCollectionDto'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AccountBalanceResponseDto'
          description: Successfully posted account balances
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Bad request
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Tenant does not have an access to the resource
components:
  schemas:
    AccountBalancesCollectionDto:
      properties:
        balances:
          description: Account balances of the payers
          items:
            $ref: '#/components/schemas/AccountBalanceDto'
          minItems: 1
          type: array
      required:
        - balances
      type: object
    AccountBalanceResponseDto:
      properties:
        result:
          $ref: '#/components/schemas/AccountBalanceAcceptedResponseDto'
      required:
        - result
      type: object
    ErrorResponse:
      description: Error response
      properties:
        code:
          description: Code of error
          type: string
        data:
          $ref: '#/components/schemas/ErrorResponseData'
        message:
          description: Error message
          type: string
      required:
        - code
      type: object
    AccountBalanceDto:
      description: Account balances of the payers
      properties:
        amount:
          description: The balance amount in minor currency units (cents), 10.50 EUR = 1050
          example: 10000
          type: integer
        currency:
          description: The currency of the balance amount
          example: EUR
          type: string
        payer:
          $ref: '#/components/schemas/AccountPayerBalanceDto'
      required:
        - amount
        - currency
        - payer
      type: object
    AccountBalanceAcceptedResponseDto:
      description: Result of the account balances posting
      properties:
        accepted:
          description: Number of accepted account balances
          format: int32
          type: integer
      required:
        - accepted
      type: object
    ErrorResponseData:
      description: Error wrapper containing all occurred errors
      properties:
        errors:
          description: All occurred errors
          items:
            $ref: '#/components/schemas/ErrorResponseViolation'
          type: array
        message:
          description: Generic message for occurred errors
          type: string
      required:
        - errors
      type: object
    AccountPayerBalanceDto:
      description: The payer of the account balance
      properties:
        account:
          description: The payer's account number
          example: DE12345678901234567890
          type: string
        bic:
          description: BIC code
          example: HABALT22TIP
          type: string
        member_code:
          description: PLAIS code
          type: string
        name:
          description: Entity name
          example: John Doe
          type: string
      required:
        - account
      type: object
    ErrorResponseViolation:
      description: Single error wrapper
      properties:
        code:
          description: Error code
          type: string
        field_name:
          description: Field name which failed
          type: string
        message:
          description: Error message
          type: string
        value:
          description: Value which was invalid
          type: string
      type: object

````