AddRequest

[POST] .../v1/reportbuilder/addrequest

Queues a validated report builder draft. Use this method to run a builder report; it is the only supported public entry point for builder report creation. The API validates report-builder permission 759, account tariff, disk-space quota, firm_id and stock_ids against the current user's available warehouses; if stock_ids is omitted and the user is warehouse-restricted, the request is limited to the user's available warehouses in the selected firm. The method validates the draft, stops without creating a task when result.valid=false, creates a queued report request for a valid draft, schedules preparation and returns Insert_uuid_Result with new_uuid. The queued request status is read through Report/GetRequest and the prepared builder result is read through ReportBuilder/GetPrepared. Missing body, denied access, unavailable tariff, invalid firm or stock filters, invalid builder drafts, builder service errors, queue limits, quota errors and persistence failures are returned as HTTP 200 ErrorResult business errors.

Request Parameters

Name Type Required Description
domain String Required Report builder domain code, for example Nomenclature.
filters Object Optional Report business filters. Values may be numbers, strings, booleans, arrays or objects.
name String Optional User-visible report name.
options Object Optional Report rendering and calculation options keyed by codes returned in schema.options.
structure ReportBuilderStructure Required Selected report table structure.

Request Example

{
  "domain": "Nomenclature",
  "name": "Stock by warehouse",
  "structure": {
    "row_groups": [
      "item_group.name",
      "item.name"
    ],
    "row_columns": [
      "item.code",
      "unit.name"
    ],
    "column_groups": [
      "stock.name"
    ],
    "metrics": [
      "stock_balance.current_quantity",
      "stock_balance.stock_cost_amount"
    ]
  },
  "filters": {
    "firm_id": 1,
    "stock_ids": [
      1,
      2
    ],
    "date": 1798732800,
    "currency_id": 1
  },
  "options": {
    "include_totals": true
  }
}

Response Parameters

Name Type Description
ok Boolean Indicates whether the request completed successfully.
result Insert_uuid Created UUID record result.

Response Example

{
  "ok": true,
  "result": {
    "new_uuid": "f20c8f37-8bcb-4f7c-8dc5-8b0b2f4f0c11"
  }
}