---
title: "Generate new expense reference"
method: POST
path: "/expenses/generate"
tags: ["Expenses"]
---

# Generate new expense reference

`POST /expenses/generate`

Creates a reference for the new expense to be imported into the system
Returns a pre-signed url that allows you to send the expense file directly to the system's storage.

In order to finish the job you need to use the pre-signed link from response (`data.uploadURL`) in another PUT command, attaching the file in question.

Note: The response now returns `invoiceId` instead of `fileId` to align with the expense creation workflow.

## Request body

- object
  - `name` string, required — The filename (including extension)
  - `mime` string, required — Mime type of the file we wish to upload
  - `md5` string, required — MD5 checksum of the file we wish to upload
  - `override` boolean — Override if a duplicate was found?
  - `private` boolean — Whether the file should be marked as private

## Response `200`

OK

- object
  - `result` string
  - `data` object
    - `uploadURL` string
    - `invoiceId` integer

## Changes

> 4 revisions in range; 1 could not be searched.

- **2025-09-26** `110fa3fb56d4` — 2 breaking, 2 warning, 2 info
  - the `name` request property's minLength was increased from `0` to `3`
  - added the pattern `^[a-f0-9]{32}$` to the request property `md5`
  - the `name` request property's maxLength was set to `255`
  - removed the optional property `data/fileId` from the response with the `200` status
  - …2 more
- **2024-08-26** `64c683372c45` — 1 info
  - endpoint added
- **2024-08-26** `a2d864f3a8db` — 1 breaking
  - api path removed without deprecation

[Change history](https://skmtc.dev/altera-co/apis/openapi/changes/expenses/generate/post.md)

---

[API](https://skmtc.dev/altera-co/apis/openapi.md) · [All operations](https://skmtc.dev/altera-co/apis/openapi/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/altera-co/openapi/revisions/39a4dd6ca527/schema)
