---
title: "Create tool cost settings."
method: POST
path: "/tool_cost_setting/upsert"
tags: ["Cost control|Tool cost setting"]
---

# Create tool cost settings.

`POST /tool_cost_setting/upsert`

This endpoint enables you to create new tool cost settings.

## Request body

- StandardToolCostHistoryUpsertRequest
  - `records` object[] — The tool cost setting data.
    - `keyField` string — This parameter specifies the name of the unique key used to distinctly assign each dataset in the API. | Value | Description | |----------------|-----------------------------| | id | The internal tool cost setting ID |
    - `data` ToolCostHistoryUpsertRequestRecordData
      - `id` integer — The internal id of the tool cost setting.
      - `toolId` integer — The internal id of the tool if the setting is meant to be for a tool.
      - `toolCategoryId` integer — The internal id of the tool category if the setting is meant to be for a tool category.
      - `from` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `costTypeSource` string — The source for the cost type. | Value | Description | |------|-------------| | TOOL | cost type is defined at this entry | | TOOL_CATEGORY | cost type is defined at the tool category | The value "TOOL_CATEGORY" can only be set if a toolId is given. This will link the settings cost type to the one of the tools category. If a toolId is given the value can also be set to "TOOL". This will set the cost type for this specific tool. In that case a costTypeId/costTypeReference also has to be given. For a tool category this value is obsolete.
      - `costTypeId` integer — The internal cost type id for this setting. Value is needed for settings if a toolCategoryId is given or the costTypeSource is set to "TOOL". Either costTypeId or costTypeReference can be supplied.
      - `costTypeReference` integer — The cost type reference for this setting. Value is needed for settings if a toolCategoryId is given or the costTypeSource is set to "TOOL". Either costTypeId or costTypeReference can be supplied.
      - `dailyRateSource` string — The source for the daily rate. | Value | Description | |------|-------------| | TOOL | daily rate is defined at this entry | | TOOL_CATEGORY | daily rate is defined at the tool category | The value "TOOL_CATEGORY" can only be set if a toolId is given. This will link the settings daily rate to the one of the tools category. If a toolId is given the value can also be set to "TOOL". This will set the daily rate for this specific tool. In that case a daily rate also has to be given. For a tool category this value is obsolete.
      - `dailyRate` number — The daily rate for this setting. Value is can be set for settings if a toolCategoryId is given or the dailyRateSource is set to "TOOL".
      - `hourlyRate` number — The hourly rate for this setting. Value is can be set for settings if a toolCategoryId is given or the dailyRateSource is set to "TOOL". This value is only used for form data bookings.
      - `fallbackProjectId` integer — This project will be used for cost bookings that have no assigned project.
      - `automaticBooking` boolean — This value indicates whether this setting should be used to create automatic bookings. Can be set to false if this setting is supposed to be used for form data bookings.
  - `startCostCalculation` boolean — If true a cost calculation will be started from the start date of this setting on.
  - `dryRun` boolean — Simulate the operation. (No records will be created or changed) This Parameter is optional.

## Response `200`

Success Response:

- StandardToolCostHistoryUpsertResponse
  - `createdToolCostSettings` object[] — The created tool cost settings.
    - `id` integer — The internal id of the tool cost setting.
    - `tool` StandardToolBaseToolListItem
      - `id` integer — The internal id of the tool.
      - `name` string — The name of the tool.
      - `category` string — The name of the tool's category.
      - `serialNumber` string — The serial number of the tool.
      - `inventoryNumber` string — The inventory number of the tool.
      - `externalId` string — The external ID of the tool.
      - `status` string — The status of the tool.
      - `manufacturer` string — The name of the manufacturer of the tool.
      - `vehicleId` string — The id of the assigned locating device if it is a vehicle.
      - `beaconId` string — The id of the assigned locating device if it is a beacon.
      - `currentProject` StandardToolBaseProjectItem
        - `id` integer — The internal project ID.
        - `reference` string — The project number.
        - `importSource` string — External data source from which this project originated.
        - `importKey` string — External ID from the respective data source.
        - `name` string — The project name.
      - `multipleProjectsPossible` boolean — Indicates if multiple current projects were possible.
      - `currentProjectChangedAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
      - `licenseNumber` string — The license plate of the tool.
    - `toolCategory` StandardToolCategoryBaseToolCategoryListItem
      - `id` integer — The internal id of the tool category.
      - `name` string — The name of the tool category.
      - `description` string — The description of the tool category.
      - `externalId` string — The external id of the tool category.
      - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
    - `costTypeSource` string — The source of the cost type for this setting.
    - `costType` string — The cost type for this setting.
    - `dailyRateSource` string — The Source of the daily rate for this setting.
    - `dailyRate` number — The daily rate for the tool for this setting.
    - `hourlyRate` number — The hourly rate for the tool for this setting.
    - `fallbackProject` number — The fallback project for this setting.
    - `automaticBooking` number — This indicates whether this setting should be used to create cost bookings automatically.
    - `from` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
    - `to` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd

---

[API](https://skmtc.net/geocapture/apis/geocapture-api.md) · [All operations](https://skmtc.net/geocapture/apis/geocapture-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/geocapture/geocapture-api/versions/869b05603541/schema)
