---
title: "Calculate a chargeback upfront"
url: "https://real-estate-agency.apim.eu/apis/chargeback-settlement/versions/109ed889-6e58-4a7d-be59-d2717eab4852/operations/calculateChargeback"
---

> Full API specification: https://real-estate-agency.apim.eu/apis/chargeback-settlement/versions/109ed889-6e58-4a7d-be59-d2717eab4852.md

# Calculate a chargeback upfront

`POST` `/chargeback/calculator`

Operation ID: `calculateChargeback`

Runs a chargeback calculation without creating a settlement - useful for budget conversations and for the figure shown in the catalog entry.

## 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: Usage Chargeback & Settlement
  version: 1.0.0
servers:
  - url: https://api.nexora.example/v1
    description: Production
  - url: https://sandbox.api.nexora.example/v1
    description: Sandbox
paths:
  /chargeback/calculator:
    post:
      tags:
        - Chargeback
      summary: Calculate a chargeback upfront
      description: |
        Runs a chargeback calculation without creating a settlement - useful
        for budget conversations and for the figure shown in the catalog
        entry.
      operationId: calculateChargeback
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - billing_basis_usd
                - chargeback_rate_percent
              properties:
                billing_basis_usd:
                  type: number
                  format: float
                  example: 6380
                chargeback_rate_percent:
                  type: number
                  format: float
                  example: 12
                overhead_percent:
                  type: number
                  format: float
                  default: 8
      responses:
        "200":
          description: Calculation
          content:
            application/json:
              schema:
                type: object
                properties:
                  line_items:
                    type: array
                    items:
                      $ref: "#/components/schemas/LineItem"
                  total_usd:
                    type: number
                    format: float
                    example: 826.85
        "400":
          $ref: "#/components/responses/ValidationError"
security:
  - apiKey: []
components:
  schemas:
    LineItem:
      type: object
      properties:
        payer:
          type: string
          enum:
            - consuming_team
            - platform_subsidy
            - partner_cost_center
            - shared_services
        rate_percent:
          type: number
          format: float
          example: 12
        net_usd:
          type: number
          format: float
          example: 765.6
        overhead_usd:
          type: number
          format: float
          example: 61.25
        total_usd:
          type: number
          format: float
          example: 826.85
    Error:
      type: object
      description: Uniform error format across all Nexora AI APIs.
      required:
        - code
        - message
      properties:
        code:
          type: string
          example: validation_failed
        message:
          type: string
          example: The billing basis is required to calculate the chargeback.
        details:
          type: array
          items:
            $ref: "#/components/schemas/ErrorDetail"
    ErrorDetail:
      type: object
      properties:
        field:
          type: string
          example: chargeback_rate_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 Nexora AI 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`.
```
