Get

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

Returns a partner reconciliation statement in original currencies. Retrieve performed movements for a partner and period using filters. Requires reconciliation select permission. When grouping is true, the same top-level result array becomes a flat tree of firms, currencies and operations linked by id and parent_id; service rows have negative IDs. Currency groups carry totals; firms do not sum different currencies. When include_balance_rows is true, grouping must also be true; opening/closing rows are added. stock_id Equal filters movements and balances: positive selects a stock, zero selects unassigned; omitted includes all stocks. Business errors return 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.
stock_id int

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
    }
  ]
}