Data Processor

Cache

Depending on the volume of data you will be processing, it is highly recommended to have some sort of cache or similar, which you feed new data to when needed. Refer to the commonly used method RecentlyModified for details on how you can check if the data on your end needs updating.

Most fields in Office and Chain regarding values and stats can be found through journals, e.g:

GET
/flow/api/Offices/{officeId}/CaseJournals (requires OfficeAdministration, Read)
/flow/api/Offices/{officeId}/DepotJournals (requires OfficeAdministration, Read)
/flow/api/Offices/{officeId}/RevenueJournals?query-params
/flow/api/Offices/{officeId}/SettlementJournals

PUT
/flow/api/Offices/{officeId}/RevenueJournals/Sum (request-body)

Swap /Offices with /BrokerCompanies, or /Chain and officeid with chainId, or brokerCompanyId for journals from brokerCompany or the entire chain.

Feed data from your cache as necessary by using above-mentioned endpoints (broker on case, actual case)

Do keep in mind that journal retrieval might be heavy on the system, and most likely requires pagination.

Some mappings of case-related data in regards to the above-mentioned endpoints:

Most can be found using AdvancedPropertySearch, and most are the same name, as provided, but in english. Oftentimes it provides an Id, e.g. BrokerId, which you then can query further in another endpoint. For example AdvancedPropertySearch on a caseId, followed by AdvancedContactSearch on BrokerId, or possibly /flow/api/Employees/{id}.

Getting Commission for employees

Commissionsum is set whenever a case is sold. The calculations for shared provisions must be calculated by the integrator.

GET /flow/api/Conditions/Cases/{caseId}/EstimatedCosts/{recalculate}

Recalculate: Recalculate values instead of getting old ones

Response

{
  "CommissionAmount": 10000,
  "RecompenseAmount": 0,
  "OtherCostsAmount": 0,
  "ShowingsAmount": 0,
  "MarketingPackageAmount": 0,
  "MarketingPackageChosen": false
}

There are two types of commission-sharing. Amount and Percent. There can in theory be both on the same case, so make sure you retrieve sharing for both by doing the following:

GET /flow/api/Salaries/Cases/{caseId}/CommissionSharing/Type/{type}

Response

[
  {
    "Id": 12345,
    "EmployeeId": 100,
    "CaseBaseId": 1,
    "Percentage": 50.0,
    "Type": "Percent"
  },
  {
    "Id": 12346,
    "EmployeeId": 101,
    "CaseBaseId": 1,
    "ExtraPayment": 0.0,
    "Percentage": 50.0,
    "Type": "Percent"
  }
]

Use the CommissionAmount combined with commissionsharing to find out how much each employee gets in commission.

Total cost of a Case

Start out by getting the required costs

GET /flow/api/Conditions/Cases/{caseId}/Costs/Buyer?$filter=Selected eq true

Response

List<PropertyConditionsCostsModel>

Sum each Amount

Follow up by adding documentcost:

GET /flow/api/Properties/{caseId}/PublicTaxes/DocumentCost

Response
Decimal

Add Debt from

GET /flow/api/Properties/{caseId}/CommonConditions

And finally by adding AskingPrice from

GET /flow/api/Properties/{caseId}/Conditions

Response

CommonConditionModel

Retrieving number of signed cases

To see how many cases has been signed, for example for a given office, you can do the following:

POST /flow/api/Search/AdvancedPropertySearch?$filter=CaseActivatedDate ge datetime'2023-12-31T23:00:00.000Z' and CaseActivatedDate le datetime'2024-01-31T22:59:59.999Z' and OfficeId eq 1 and AssignmentType ne 'Valuation'&$orderby=CreatedDate desc

This will return all cases that have been signed in the month of January, 2024. OfficeId is an optional example where we retrieve signed cases for a specific office. AssignmentType ne ‘Valuation’ is mandatory for what we’d like to retrieve, as Valuation (Verdivurdering) should not be included when listing the number of signed cases. Additional filters can be added as you need, but the endpoint provided is the ‘basic’ format.