Get

[POST] .../v1/partnerbalance/get

Returns a partner reconciliation statement in original currencies. Build a partner reconciliation statement in original movement currencies for a selected period. When grouping is false or omitted, the response returns performed partner balance rows ordered by date, including opening amount, debit, credit, firm, document type, currency, exchange rate and currency_amount. When grouping is true, the same top-level result array becomes a flat tree: firm rows are roots, currency rows are firm children and operation rows are currency children linked by id and parent_id. Group and balance service rows use negative synthetic id values, while operation rows keep their positive partner balance row IDs. Currency group rows contain per-currency start_amount, debit, credit and end_amount totals; firm rows are structural and do not aggregate amounts across different currencies. When include_balance_rows is true, grouping must also be true and the response includes opening and closing balance service rows for each currency group that has period movements or a non-zero opening or closing balance. The request body is required and start_date, end_date and partner_id are mandatory; date, partner_id, firm_id and currency_id can be supplied through filters. The current request user must have partner reconciliation select permission. Missing body, invalid dates, invalid partner_id, invalid grouping options, denied access, translation lookup failures, storage errors and balance are returned as HTTP 200 ErrorResult.

Request Parameters

Name Type Required Description
filters Array of Filter Optional Optional filters by fields available for this API method.
grouping Boolean Optional Return rows as a flat tree grouped by firm and currency using id and parent_id.
include_balance_rows Boolean Optional Include opening and closing balance service rows. This option requires grouping to be true.

Filterable Fields

Field Type Description
currency_id int Currency ID.
date int
end_date int Period end date as Unix time in seconds.
firm_id int Firm ID.
partner_id int Partner ID.
start_date int Period start date as Unix time in seconds.

Request Example

{
  "filters": [
    {
      "Field": "date",
      "Operator": "GreaterOrEqual",
      "Value": "1711929600"
    },
    {
      "Field": "date",
      "Operator": "LessOrEqual",
      "Value": "1714521600"
    },
    {
      "Field": "partner_id",
      "Operator": "Equal",
      "Value": "15"
    },
    {
      "Field": "firm_id",
      "Operator": "Equal",
      "Value": "2"
    },
    {
      "Field": "currency_id",
      "Operator": "Equal",
      "Value": "1"
    }
  ],
  "grouping": true,
  "include_balance_rows": true
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Array of PartnerBalance Result array.

Response Example

{
  "ok": true,
  "result": [
    {
      "id": -1,
      "parent_id": 0,
      "entity_type": "Firm",
      "entity_id": 2,
      "date": 0,
      "document_code": "",
      "document_id": 0,
      "start_amount": 0.000,
      "debit": 0.000,
      "credit": 0.000,
      "end_amount": null,
      "firm": {
        "id": 2,
        "name": "REGOS Retail"
      },
      "document_type": null,
      "exchange_rate": 0.00000000,
      "currency": null,
      "currency_amount": 0.000
    },
    {
      "id": -2,
      "parent_id": -1,
      "entity_type": "Currency",
      "entity_id": 1,
      "date": 0,
      "document_code": "",
      "document_id": 0,
      "start_amount": 100000.000,
      "debit": 2500000.000,
      "credit": 0.000,
      "end_amount": 2600000.000,
      "firm": {
        "id": 2,
        "name": "REGOS Retail"
      },
      "document_type": null,
      "exchange_rate": 0.00000000,
      "currency": {
        "id": 1,
        "name": "UZS",
        "code_chr": "UZS"
      },
      "currency_amount": 0.000
    },
    {
      "id": -3,
      "parent_id": -2,
      "entity_type": "PartnerBalance",
      "entity_id": 0,
      "date": 1711929600,
      "document_code": "",
      "document_id": 0,
      "start_amount": 100000.000,
      "debit": 0.000,
      "credit": 0.000,
      "end_amount": 100000.000,
      "firm": {
        "id": 2,
        "name": "REGOS Retail"
      },
      "document_type": {
        "id": 0,
        "name": "Balance at the beginning of period",
        "name_var": "app_balance_at_the_begin_of_period",
        "last_update": 0
      },
      "exchange_rate": 0.00000000,
      "currency": {
        "id": 1,
        "name": "UZS",
        "code_chr": "UZS"
      },
      "currency_amount": 0.000
    },
    {
      "id": 3001,
      "parent_id": -2,
      "entity_type": "PartnerBalance",
      "entity_id": 3001,
      "date": 1714521600,
      "document_code": "PMT-000042",
      "document_id": 42,
      "start_amount": 100000.000,
      "debit": 2500000.000,
      "credit": 0.000,
      "end_amount": 2600000.000,
      "firm": {
        "id": 2,
        "name": "REGOS Retail"
      },
      "document_type": {
        "id": 5,
        "name": "Payment",
        "last_update": 1714550400
      },
      "exchange_rate": 1.00000000,
      "currency": {
        "id": 1,
        "name": "UZS",
        "code_chr": "UZS"
      },
      "currency_amount": 2500000.000
    },
    {
      "id": -4,
      "parent_id": -2,
      "entity_type": "PartnerBalance",
      "entity_id": 0,
      "date": 1714521600,
      "document_code": "",
      "document_id": 0,
      "start_amount": 2600000.000,
      "debit": 0.000,
      "credit": 0.000,
      "end_amount": 2600000.000,
      "firm": {
        "id": 2,
        "name": "REGOS Retail"
      },
      "document_type": {
        "id": 0,
        "name": "Balance at the end of period",
        "name_var": "app_balance_at_the_end_of_period",
        "last_update": 0
      },
      "exchange_rate": 0.00000000,
      "currency": {
        "id": 1,
        "name": "UZS",
        "code_chr": "UZS"
      },
      "currency_amount": 0.000
    }
  ]
}