---
title: "Calculate a commission upfront"
url: "https://real-estate-agency.apim.eu/apis/commission-settlement/versions/6ae2ea20-d101-452a-9066-4c9c4d7d5fdc/operations/calculateCommission"
---

> Full API specification: https://real-estate-agency.apim.eu/apis/commission-settlement/versions/6ae2ea20-d101-452a-9066-4c9c4d7d5fdc.md

# Calculate a commission upfront

`POST` `/commission/calculator`

Operation ID: `calculateCommission`

Runs a commission calculation without creating a settlement - useful for sales conversations and for the figure shown in the listing.

## Request body (required)

Content types: `application/json`

## Responses

- `200` - Calculation
- `400` - The request doesn't match the schema

## OpenAPI definition

```yaml
openapi: 3.0.3
info:
  title: Commission Settlement
  version: 1.0.0
servers:
  - url: https://api.realestateagency.example/v1
    description: Production
  - url: https://sandbox.api.realestateagency.example/v1
    description: Sandbox
paths:
  /commission/calculator:
    post:
      tags:
        - Commission
      summary: Calculate a commission upfront
      description: |
        Runs a commission calculation without creating a settlement - useful for
        sales conversations and for the figure shown in the listing.
      operationId: calculateCommission
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - assessment_basis_eur
                - buyer_percent
              properties:
                assessment_basis_eur:
                  type: integer
                  example: 645000
                buyer_percent:
                  type: number
                  format: float
                  example: 3.57
                seller_percent:
                  type: number
                  format: float
                  example: 3.57
                tax_percent:
                  type: number
                  format: float
                  default: 19
      responses:
        "200":
          description: Calculation
          content:
            application/json:
              schema:
                type: object
                properties:
                  line_items:
                    type: array
                    items:
                      $ref: "#/components/schemas/LineItem"
                  gross_total_eur:
                    type: number
                    format: float
                    example: 46061
        "400":
          $ref: "#/components/responses/ValidationError"
security:
  - apiKey: []
components:
  schemas:
    LineItem:
      type: object
      properties:
        party:
          type: string
          enum:
            - buyer
            - seller
            - tenant
            - landlord
        rate_percent:
          type: number
          format: float
          example: 3.57
        net_eur:
          type: number
          format: float
          example: 19353.36
        tax_eur:
          type: number
          format: float
          example: 3677.14
        gross_eur:
          type: number
          format: float
          example: 23030.5
    Error:
      type: object
      description: Uniform error format across all Real Estate Agency APIs.
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: validation_failed
        message:
          type: string
          example: The assessment basis is required to calculate the commission.
        details:
          type: array
          items:
            $ref: "#/components/schemas/ErrorDetail"
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          example: buyer_percent
        reason:
          type: string
          example: missing
  responses:
    ValidationError:
      description: The request doesn't match the schema
      content:
        application/json:
          schema:
            $ref: "#/components/schemas/Error"
  securitySchemes:
    apiKey:
      type: apiKey
      in: header
      name: apikey
      description: |
        Every call carries an API key in the `apikey` header. You generate the
        key in the Real Estate portal under "My Apps"; it's shown exactly once.

        Each key has the scopes it's allowed to use attached to it. If one is
        missing, the API responds with `403` and `code: "scope_missing"`; the
        missing scope is in `details[].field`.
```
