Skip to content
campaiDeveloper
campai.com

Finance · Accounting

POST/{organizationId}/{mandateId}/finance/accounting/balance-segments/listReads only

List balance segments

Lists account balances grouped by dimension combination and restriction for an organization and mandate. It accepts optional filters, sorting, pagination and an opening-balances option, and returns a count and balance segments.

Permissions

Send an API key of the organization in the path, using the X-API-Key header.

Who may call it

  • The caller must have organization access.
  • The caller needs both mandate.read and posting.read permissions.

Request

Path parameters

  • organizationIdidrequired
  • mandateIdidrequired

Body

Content-Type: application/json

  • rangeobject
    2 properties
    • fromobjectrequired
      2 properties
      • yearintegerrequired

        2000–3000

      • monthIndexintegerrequired

        1–12

    • toobjectrequired
      2 properties
      • yearintegerrequired

        2000–3000

      • monthIndexintegerrequired

        1–12

  • accountFilterobject
    5 properties
    • groupsstring[]
      capitalAsset liquidAsset cash equityCapital debtCapital revenue expense static staticDebit staticCredit debtor creditor
    • typesstring[]
      asset liability revenue expense debtor creditor misc
    • classesstring[]
      permanent temporary person misc
    • accounts(integer[] | integer)[]
    • accountNamestring
  • dimensionsobject[]
    2 properties
    • dimensionIdidrequired
    • optionKeystringrequired

      1–64 characters

  • combinationKeystring
  • restrictionstringnullable
    donor
  • includeOpeningBalancesboolean
  • sortobject of string

    default {"account":"asc"}

    asc desc
    Keys: one of 5 values
    account debit credit openingDebit openingCredit
  • limitinteger

    0–100 · default 50

  • offsetinteger

    at least 0 · default 0

  • returnCountboolean

    default false

Request
curl --fail-with-body --silent --show-error --max-time 30 --globoff \
  --request POST 'https://cloud.campai.com/api/YOUR_ORGANIZATION_ID/YOUR_MANDATE_ID/finance/accounting/balance-segments/list' \
  --header 'X-API-Key: YOUR_API_KEY'

No request that worked has been recorded yet, so the body is not shown.

Response

200 Successful response

Content-Type: application/json

  • countinteger

    at least 0

  • accountBalanceSegmentsobject[]
    15 properties
    • accountinteger

      1–999999999

    • accountNamestring
    • dimensionsobject[]
      2 properties
      • dimensionIdid
      • optionKeystring

        1–64 characters

    • combinationKeystring
    • restrictionstringnullable
      donor
    • debitinteger

      at most 9999999999

    • creditinteger

      at most 9999999999

    • openingDebitinteger

      at most 9999999999

    • openingCreditinteger

      at most 9999999999

    • balanceinteger

      0–9999999999

    • balanceTypestring
      none debit credit
    • balanceAmountinteger

      at most 9999999999

    • openingBalanceinteger

      0–9999999999

    • openingBalanceTypestring
      none debit credit
    • openingBalanceAmountinteger

      at most 9999999999

Response200
{
  "count": 0,
  "accountBalanceSegments": [
    {
      "account": 1,
      "dimensions": [
        {
          "dimensionId": "000000000000000000000001",
          "optionKey": "string"
        }
      ],
      "combinationKey": "string",
      "restriction": "donor",
      "debit": 1,
      "credit": 1,
      "balance": 0,
      "balanceType": "none",
      "balanceAmount": 1
    }
  ]
}

Errors

Other errors

StatusErrorWhen
404Accounting plan is missing. Please make sure you have setup your finances app properly.If the organization's accounting plan is missing, the endpoint returns HTTP 404 with message key finance.accounting.getAccountingPlan.notFound.

Errors nearly every request can meet are listed under Errors.