---
title: "Create an export for cost bookings."
method: POST
path: "/cost_booking/createExport"
tags: ["Cost control|Cost Booking"]
---

# Create an export for cost bookings.

`POST /cost_booking/createExport`

This endpoint allows you to create an export for cost booking data. You will receive a job id which will be used
to collect the exported data after the job has finished.

## Request body

- StandardCostBookingCreateExportRequest
  - `filter` CostBookingCreateExportRequestCostBookingExportLogFilter
    - `byCostTypeIds` integer[] — Filters the cost bookings based on the cost type IDs.
    - `byProjectIds` integer[] — Filters the cost bookings based on the project IDs.
    - `byDepartmentIds` integer[] — Filters the cost bookings based on the department IDs.
    - `byVehicleCategoryIds` integer[] — Filters the cost bookings based on the vehicle category IDs.
    - `byToolCategoryIds` integer[] — Filters the cost bookings based on the tool category IDs.
    - `byCostSources` string[] — Filters the cost bookings based on the cost sources. | MATERIAL | | MACHINE | | EMPLOYEE | | TOOL |
    - `from` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
    - `to` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
  - `groupBy` CostBookingCreateExportRequestCostBookingExportLogGroupBy
    - `groupByField1` string — Group by for certain exports (CATEGORY_GROUPED_CSV, PDF). | Value | | ----- | | POSITION | | POSITION_GROUP | | DATE | | MONTH | | YEAR | | WEEK | | PROJECT | | PROJECT_COST_CENTER | | PROJECT_CATEGORY |
    - `groupByField2` string — Group by for certain exports (CATEGORY_GROUPED_CSV, PDF). | Value | | ----- | | POSITION | | POSITION_GROUP | | DATE | | MONTH | | YEAR | | WEEK | | PROJECT | | PROJECT_COST_CENTER | | PROJECT_CATEGORY |
    - `groupByField3` string — Group by for certain exports (CATEGORY_GROUPED_CSV, PDF). | Value | | ----- | | POSITION | | POSITION_GROUP | | DATE | | MONTH | | YEAR | | WEEK | | PROJECT | | PROJECT_COST_CENTER | | PROJECT_CATEGORY |
  - `format` string — The export format. | Value | Description | | ----- | ----------- | | CSV | Simple csv file | | DATAFLOR | Dataflor xml format | | CATEGORY_GROUPED_CSV | Grouped csv file | | PDF | Grouped pdf file | | BRZ_TIME_SHEETS | BRZ csv file | | SBS | SBS xml file |
  - `mark_as_exported` boolean — Whether the exported cost booking should be marked as exported or not. Default value is true.

## Response `200`

Success Response:

- StandardCostBookingCreateExportResponse
  - `data` CostBookingCreateExportResponseCostBookingExportLogItem
    - `id` integer — The internal id of the cost export.
    - `format` string — The format of the cost export.
    - `filter` StandardCostBookingBaseCostBookingExportLogFilterItem
      - `from` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `to` string — Represents a date. (ISO 8601) ICU-Format: yyyy-MM-dd
      - `projectIds` integer[] — The filtered projects.
      - `costSources` string[] — The filtered cost sources.
      - `costTypeIds` integer[] — The filtered cost type IDs.
      - `trackerCategoryIds` integer[] — The filtered tracker category IDs.
      - `departmentIds` integer[] — The filtered department IDs.
      - `toolCategoryIds` integer[] — The filtered tool category IDs.
    - `createdAt` string — Represents a date and a time. (ISO 8601) ICU-Format: yyyy-MM-dd'T'HH:mm:ssxxx
  - `jobId` integer — The id of the cost export job. (The status of the job can be queried via the job API)

---

[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)
