# Spesenfuchs API 1.0.8 > REST API of Spesenfuchs. This file is the whole documentation as Markdown for AI assistants; the machine-readable specification is [openapi.json](https://api.spesenfuchs.de/openapi.json), the reference for people is [Redoc](https://api.spesenfuchs.de/redoc.html). All paths below are relative to `https://api.spesenfuchs.de`. German names in the user interface: unassigned receipts = Belegeingang, master data = Stammdaten, receipt kind = Belegart, payment method = Zahlungsart, cost center = Kostenstelle, cost unit = Kostenträger, company = Firma. # General information ## Overview With the **Spesenfuchs API**, apps and other systems upload receipts to the unassigned receipts area of Spesenfuchs ("Belegeingang"), retrieve them, edit them and delete them. It also provides the master data needed for capturing, such as receipt kinds, payment methods and cost centers. This first stage aims to be stable, secure and easy to integrate; more areas will follow (see [Roadmap](https://api.spesenfuchs.de/redoc.html#tag/Overview/Roadmap)). **Base URL:** `https://api.spesenfuchs.de/v1/` The whole interface is also available as an [OpenAPI file](openapi.json) to download. Use it to generate clients or to set up tools such as Postman or Insomnia. > **Tip:** The token (`IdToken`) is valid for one hour. Do not get a new one for every request; reuse it and renew it with `POST /auth/refresh`. ### What the API does today - Upload receipt images and PDFs from external systems or mobile apps to the unassigned receipts and query the processing status - List unassigned receipts, retrieve them including their document (receipt image), edit them (with a preview before saving) or delete them - Read the master data of the company: receipt kinds, payment methods, cost centers or cost units, countries, currencies and company settings - Retrieve the profile of the logged-in user - Build an app for expense capture or digital inbox processing with it **Access:** Every Spesenfuchs user can use the API; you log in with the login of that user. The API works with the rights of this user: in the unassigned receipts they see, edit and delete only their own receipts, master data as their role shows it in Spesenfuchs. ### Conventions | Topic | Rule | |-------|------| | **Base URL** | `https://api.spesenfuchs.de/v1/` | | **Data format** | JSON in UTF-8; receipts are uploaded as `multipart/form-data` | | **IDs** | Strings; store and send them back unchanged, do not split them | | **Date and time** | ISO 8601, e.g. `2025-11-18T10:32:12+01:00`; date fields of receipts always have the offset `+01:00`, the calendar day is what counts | | **Amounts** | String with a dot and two decimals, e.g. `"42.91"`; with `?expand=money` an object with `amount` and `currency` (see [Expand](https://api.spesenfuchs.de/redoc.html#tag/Expand)) | | **Authentication** | JWT as Bearer token | | **Security** | Transport over HTTPS; tokens are signed with RS256 | | **Versioning** | All endpoints are under `/v1`; within v1 there are only backward compatible changes (see [Versioning](https://api.spesenfuchs.de/redoc.html#tag/Overview/Versioning)) | | **Rate limits** | 100 requests per minute per user, 10,000 per day per company; details under [Rate limits](https://api.spesenfuchs.de/redoc.html#tag/Rate-limit) | | **Errors** | standard HTTP status codes (see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors)) | ### Versioning **What can change within v1:** new endpoints, new fields in responses and new optional fields or parameters in requests. Your client should therefore ignore unknown fields in responses. Changes that break existing clients only come with a new version (`/v2`). All changes are listed under [Changes](https://api.spesenfuchs.de/redoc.html#tag/Change-Log). ### Support If something does not work as described, open a ticket via our [support](https://support.spesenfuchs.de/en/support/tickets/new) form. **Please include:** - Time of the request - Method and endpoint, e.g. `POST /jobs/unassigned-receipts` - HTTP status and the response - If applicable, the email address of the user and your customer number **Please do not send:** tokens, passwords or other credentials. ### Roadmap **Coming soon:** **Accounting export integrations**. Build your own export pipeline: retrieve posting records from receipts and trips via the API, push them into any accounting system or custom solution, and mark them as exported. **Planned based on customer demand:** - **Trips and travel expenses**: create, read and manage business trips via the API - **Employee management**: access to user and approval structures - **Advanced reporting endpoints**: analytics and cost overviews Interested in one of these areas, or do you need data or endpoints that are not available yet? Your feedback directly influences our priorities. Write to us via our [support](https://support.spesenfuchs.de/en/support/tickets/new) form. ## Authentication The API uses tokens following the JWT standard. You log in with the email address and password of a Spesenfuchs user and send the token with every further request. ### Flow 1. **Log in:** [`POST /auth/login`](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/loginUser) with email address and password. The response contains, among others, `IdToken` and `RefreshToken`. 2. **Send the token:** with every request in the header, "Bearer" with a capital B and one space: ``` Authorization: Bearer ``` 3. **Renew:** The token expires after one hour, the API answers with 401. With [`POST /auth/refresh`](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/refreshToken) and the refresh token you get a new one without the password. 4. **Log out:** [`POST /auth/logoff`](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/logoutUser) invalidates the token. ### Tokens | Token | Valid | Used for | |---|---|---| | ID token | 1 hour | as Bearer token for all requests | | Refresh token | 30 days | getting new ID tokens; it stays the same, after that log in again | ### Keep tokens safe - Store the refresh token only in secure storage (Keychain or Keystore, encrypted); in web applications do not keep tokens in localStorage. - Send the Bearer token only in the header Authorization and the refresh token only in the JSON body of refresh and logoff; never in the URL and never in logs. - Delete the tokens on the device when logging out. Responses 401 and 403 are explained in the chapter [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors). Login attempts are limited per email address and IP address, see [Rate limits](https://api.spesenfuchs.de/redoc.html#tag/Rate-limit/Overview). For questions, our [support](https://api.spesenfuchs.de/redoc.html#tag/Overview/Support) helps. ## Errors Whether a request succeeded is shown by the **HTTP status**. Every error response of the public endpoints has the same form: `"success": false`, a fixed `code` and a `message` for humans; the answer with the code `validation_failed` (422) adds the list `errors` with one entry per field. ```json { "success": false, "code": "not_found", "message": "Receipt not found" } ``` **Language of the message:** the language of the user as set in Spesenfuchs. As long as no user is known (sign-in, refresh, missing or invalid token), the parameter `lang` decides: `?lang=eng` for English, otherwise German. > **Important:** Base program logic on `code`, never on the text of a message. Some older endpoints also send the field `error` with the same text as `message`, and 429 with the same value as `code`; it is deprecated, use `code`. Messages from systems used by Spesenfuchs (e.g. identity providers or OCR engines) are always in English. | HTTP Code | Meaning | Example Trigger | |----------|---------|-----------------| | **400 Bad Request** | Invalid or missing input | malformed JSON, missing fields | | **401 Unauthorized** | Authentication failed | invalid or expired token, or no person for the token any more | | **403 Forbidden** | Authenticated but not allowed | receipt of another person, person locked or archived, no active contract | | **404 Not Found** | Resource does not exist | wrong receipt ID | | **409 Conflict** | State conflict | version conflict, receipt still being read | | **422 Unprocessable Entity** | Content cannot be processed | empty, damaged or too large file on upload | | **429 Too Many Requests** | Rate limit exceeded | API throttling | | **500 Internal Server Error** | Unexpected server condition | unknown system error | | **503 Service Unavailable** | Not possible just now | receipt could not be saved safely | **Recommended client behavior** - Validate client input before sending - Use exponential backoff for 429 rate limits - Detect third-party English-only errors - Log the HTTP status, the code and, for 500, the timestamp **Error codes** Error answers have a fixed `code`, a message for humans in `message` and `"success": false`. Base program logic on `code`; a code never changes its meaning. The answer with the code `validation_failed` (422) adds the list `errors` with one entry per field. ```json { "success": false, "code": "invalid_cursor", "message": "The cursor is invalid. Please request the first page without a cursor." } ``` | Code | HTTP status | Meaning | |------|-------------|---------| | `invalid_request` | 400 | The request contains an invalid parameter, for example a limit that is not a positive number. | | `invalid_cursor` | 400 | The cursor is damaged or unknown. Request the first page again without a cursor. | | `idempotency_key_reused` | 422 | The key of the header Idempotency-Key was already used for another file of this user. Send a key of its own for every receipt; do not repeat the upload. | | `not_found` | 404 | The receipt or the upload job does not exist (any more), for example because the receipt was deleted or assigned to a trip. For an upload job the message names the job. | | `endpoint_not_found` | 404 | There is no endpoint with this path. Check the path and the version (v1). | | `method_not_allowed` | 405 | The endpoint does not take this HTTP method. The header Allow lists the methods it takes. | | `not_owner` | 403 | The receipt belongs to another person. A user can only work with the own receipts. | | `recognition_running` | 409 | The receipt recognition is still running. Try again in a few seconds. | | `validation_failed` | 422 | Some fields of the request cannot be taken over. The list errors names each field with a code of its own. | | `version_conflict` | 409 | The receipt was changed since the client loaded it: the version does not fit. The answer has the current receipt under receipt; ask the user and send the own changes again with the new version if wanted. | | `save_not_possible` | 503 | The receipt could not be saved safely just now. Nothing was saved; try again later. | | `invalid_credentials` | 401 | Email address or password is wrong. | | `token_missing` | 401 | No Bearer token (IdToken) was sent. Sign in and send the IdToken in the header Authorization. | | `token_invalid` | 401 | The Bearer token (IdToken) has expired or is invalid. Renew it with the refresh token or sign in again. | | `refresh_token_invalid` | 401 | The refresh token has expired or is invalid. Sign in again. | | `person_not_found` | 401 | There is no person for this token or these credentials in Spesenfuchs (any more). | | `person_archived` | 403 | The person is archived and cannot use Spesenfuchs. | | `person_locked` | 403 | The person is locked by the company. | | `person_passive` | 403 | The person may not enter own expenses (passive user). | | `subscription_inactive` | 403 | The company has no active contract any more: contract or test ended, or dunning level 3; the message tells which. Do not renew the token. | | `app_update_required` | 404 | This version of the app (header X-Rka-Version) is blocked. Update the app. | | `file_missing` | 422 | The upload contains no file part. | | `file_damaged` | 422 | The file is empty or its content does not fit its type. | | `file_type_not_allowed` | 422 | The file type is not allowed; allowed are PDF, PNG, JPG and GIF. | | `file_too_large` | 422 | The file is larger than allowed. | | `internal_error` | 500 | An unexpected error occurred. Try again later; give the support the timestamp of the answer. | **Answers of the web server** Two answers come from the web server in front of the API, not from the API itself, and can come with every endpoint. They have the same format, but their `message` is always German, because the web server knows neither the user nor `lang`. | Code | HTTP status | Meaning | |------|-------------|---------| | `request_too_large` | 413 | The request is larger than 10 MB. A single receipt file may have at most 5 MB (`file_too_large`). | | `backend_unavailable` | 502, 503 | Spesenfuchs cannot be reached just now. Try again later. | **Field codes** In the list `errors` of an answer with `validation_failed` every entry has `code`, `field` and `message`. Besides the codes of the checks of a receipt, for example `required`, `too_long` or `guest_missing`, these codes tell why a field of the request cannot be read: | Code | Meaning | |------|---------| | `unknown_field` | The field does not exist. Check the spelling. | | `read_only` | The field can only be read, not changed. | | `invalid_format` | The value has the wrong type or format, for example a date that is not YYYY-MM-DD. | | `unknown_value` | There is no entry with this key. Load the list again. | | `inactive` | The entry is switched off and cannot be chosen any more. | | `multiple_rates_abroad` | A receipt abroad has one amount without German VAT, not several VAT rates. | | `multiple_rates_not_allowed` | This amount takes one VAT rate only. | | `out_of_range` | The value is outside the allowed range, for example a negative amount. | | `receipt_incomplete` | The receipt cannot be marked as checked while data is missing. The missing fields follow in errors, in the form of missingFields. | | `currency_not_of_country` | The currency does not belong to the country. Send country and currency as one of the pairs in currencies of GET /v1/countries. | | `cost_objects_disabled` | The company uses no cost centers and cost objectives (costObjectsEnabled in GET /v1/company-settings). Leave the field out or send null. | | `version_mismatch` | A PATCH sends version and versionString with different values. Send only the field you received. | | `exchange_rate_not_allowed` | A receipt in EUR has no exchange rate of its own. Leave exchangeRate out or send null. | ## Rate limit The API limits requests so that it stays fast for everyone. Short bursts are allowed: the limits refill continuously. ### Overview | Limit | Value | Counted per | |---|---|---| | User | 100 requests per minute | authenticated user | | Company | 10,000 requests per day | company, shared by all its users | | Login | 5 logins in 5 minutes | email address and IP address | | Logins per address | 30 logins in 5 minutes | IP address | | Refresh and health | 20 requests per minute together | IP address | | Failed attempts | 60 requests with a missing or invalid token per minute, then 429 also for valid tokens | IP address | | Running uploads | 5 at the same time | user | Requests with a token count for the user and the company, also when they end with an error. Logins count per email address and IP address and, more generously, per IP address; refresh and health count per IP address only. Requests are spread over several servers; the limits per IP address can therefore apply slightly earlier or later. ### Limit exceeded (HTTP 429) ```json { "success": false, "code": "rate_limit_exceeded", "message": "User rate limit exceeded. Too many requests are being sent in a short time.", "error": "rate_limit_exceeded", "limitType": "user", "retryAfter": 45, "userRemaining": 0, "orgRemaining": 8543 } ``` - **`limitType`** names the limit: `user`, `organization`, `ip` (then also `endpointType`: `login` (logins per address), `loginUser` (logins per email address and IP address), `public` or `failedAuth`) or `uploads`. - **`Retry-After`** (header) and `retryAfter` give the seconds until the limit is full again: at most 60 for the user, up to 86,400 for the company. Single requests are often possible earlier. - **Headers** `X-RateLimit-User-Limit`, `-Remaining`, `-Reset` and the same with `Org` show the state of both limits; for limits per IP address they are `X-RateLimit-Limit`, `-Remaining`, `-Reset`, `-Type`. Successful responses do not include these headers at the moment. - **`code`** is always `rate_limit_exceeded`, as in every [error response](https://api.spesenfuchs.de/redoc.html#tag/Errors); the deprecated field `error` has the same value. Programs should evaluate `code` and `limitType`. - **`message`** comes in the language of the parameter `lang` (`?lang=eng` for English, otherwise German), for uploads in the language of the user. ### Recommendations - On 429, wait as long as `Retry-After` says, then with growing intervals. - Cache master data with `ETag`, see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). - Renew expired tokens instead of repeating requests with an old token. - Upload receipts one after another or two to three at a time. - Test with a separate test user. Higher limits are not available at the moment. If you reach them regularly, write to us via our [support](https://api.spesenfuchs.de/redoc.html#tag/Overview/Support). ## Expand ### Expand Parameter Several endpoints support an optional `expand` query parameter that allows clients to request additional detail for referenced fields inline, instead of receiving only a compact identifier or string. One value, `fields`, replaces nothing but adds the form of a receipt: its fields with label, required flag and VAT rates, more in [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt). **Usage** ``` GET /unassigned-receipts/{id}?expand=person,currency,receipt_kind,payment_method,country,vat,money,cost_object,fields GET /unassigned-receipts/recent?expand=person,currency,receipt_kind,payment_method,country,vat,money,cost_object,fields GET /jobs/unassigned-receipts/{id}?expand=person,unassigned_receipt,currency,receipt_kind,payment_method,country,vat,money,cost_object,fields ``` **How it works** By default, fields like `currency` or `receiptKind` return a compact value — typically the name or ISO code as a plain string. When you include the field name in `expand`, the response replaces that value with a typed object containing the full metadata. **Example: `currency` without and with expand** ```json "currency": "ISK" "currency": { "type": "Currency", "iso4217": "ISK", "currencyName": "Icelandic Króna" } ``` **Available expand values** | Value | Default (without expand) | Expanded object type | |---|---|---| | `person` | ID string | `Person` with id, name, email etc.| | `receipt_kind` | Localized name string | `ReceiptKind` with receiptKindName, receiptKindKey etc.| | `payment_method` | Localized name string | `PaymentMethod` with paymentMethodName, disburse etc.| | `currency` | ISO 4217 code | `Currency` with iso4217, currencyName etc.| | `country` | ISO 3166 code | `Country` with iso3166, countryName etc.| | `cost_object` | Cost object number | `CostCenter` or `CostObjective` with id, name, number, status etc.| | `vat` | VAT name as text (field vat of a VAT layer) | `Vat` with type and vatName | | `money` | Amount as plain string | `Money` with type, currency, amount etc.| | `fields` | Field missing | Field `fields` with the fields of the receipt form (`ReceiptField`), only for unassigned receipts | `fields` is the one value that does not replace a compact value: it adds the field `fields` to an unassigned receipt, which is left out by default. Only a client that edits a receipt needs it, e.g. `GET /unassigned-receipts/{id}?expand=fields`. **Multiple values** are combined as a comma-separated list without spaces: `?expand=person,currency,receipt_kind` **Unknown or unsupported expand values** are silently ignored — the response remains valid. --- The `unassigned_receipt` expand value is only available on the job endpoint `GET /jobs/unassigned-receipts/{id}` and returns the full receipt object inline instead of just the receipt ID. ## Change Log All notable changes to the **Spesenfuchs API** will be documented in this section. The format follows common API versioning conventions and semantic versioning principles. --- ### v1.0.8 — November 2026 ##### New - **Edit receipts:** [`POST /v1/unassigned-receipts/preview/{id}`](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) (preview) and [`PATCH /v1/unassigned-receipts/{id}`](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt); for the flow see [Receipt Editing in Apps](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps), for the input rules see the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt), for the field codes see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors). - [`GET /v1/unassigned-receipts`](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/listUnassignedReceipts): the unassigned receipts page by page with `limit` and `cursor`. - New optional fields of the receipt: `fields` (with `expand=fields`), `isComplete`, `missingFields`, `checkStatus`, `versionString`. - [Upload](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/uploadReceipt): optional header `Idempotency-Key`. - [Countries](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getCountries): new optional fields `displayName` and `currencies`. ##### Changed - All error responses consistently have `"success": false`, `code` and `message`, also 401, 404, 405, 413, 429, 500 and 502/503, see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors). Messages come in the language of the user or of the parameter `lang`. - Without an active contract, all endpoints and the login answer with **403** `subscription_inactive` instead of 401; do not renew the token in this case. - [`DELETE /v1/unassigned-receipts/{id}`](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/deleteReceipt) answers with **409** `recognition_running` while the receipt is still being processed. ##### Deprecated - The field `error` with text; use `code` instead. --- ### v1.0.7 — November 2026 #### Master Data Lists a client needs to edit receipts and to match the keys in receipts. ##### New - `GET /v1/receipt-kinds`: the receipt kinds the user may choose, with their fixed `receiptKindKey`. - `GET /v1/payment-methods`: the payment methods of the company, active and inactive, with their fixed `id`. - `GET /v1/cost-objects?type=costCenter|costObjective`: the cost centers or cost objectives of the company, active and inactive. - `GET /v1/countries`: all countries with ISO 3166-1 alpha-3 code, translated name and currency. - `GET /v1/currencies`: all currencies with ISO 4217 code and translated name. - `GET /v1/company-settings`: whether the company uses cost centers and cost objectives. - All six answer an `ETag`. Send it in `If-None-Match`: when nothing changed, the answer is `304 Not Modified` without body. - Unassigned receipts: added `receiptKindKey` (integer, nullable) and `paymentMethodId` (string, nullable), the fixed keys of [`GET /v1/receipt-kinds`](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getReceiptKinds) and [`GET /v1/payment-methods`](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getPaymentMethods). - `PaymentMethod`: added `id` (string, nullable). `Country`: added `currency` (string, nullable). ##### Changed - `PaymentMethod`: `account`, `isUsed` and `isExportToFibu` are no longer required. `CostObject`: `isCostObjectUsed` is no longer required. They were wrongly documented as required, although in the master data lists only user admins and owners get them. No answer changes; a client generated from the specification now gets these fields as optional. ##### Notes - In the payment methods list, `account`, `isUsed` and `isExportToFibu` are only answered to user admins and owners; in the cost objects list, `isCostObjectUsed` likewise. - All other responses are unchanged; existing integrations are unaffected. --- ### v1.0.6 — November 2026 #### VAT Rates, Health Check and Specification Corrections ##### New - Added `ratePercent` (number, nullable) to each VAT layer (`ReceiptVat`): the VAT rate in percent the amounts were computed with, taken for the document date of the receipt (e.g. 5 for reduced VAT in the second half of 2020). 0 under the small business rule. - `GET /v1/health` without authentication: answers `{"status":"ok","version":…,"timestamp":…}` when the API is reachable. Use it before the login and for monitoring. Not logged; public rate limit. ##### Changed - The VAT layer fields (`receiptVats`, `additionalReceiptVats`, `thirdReceiptVats`, `cityTaxReceiptVats`, `parkingReceiptVats`) are now described as objects with the optional properties `full`, `reduced` and `zero`. They were wrongly documented as strings. - `originalFilenames` is now described as an array of strings. - `date`, `documentDate` and `endDate` are documented as `date-time`, always with the fixed offset +01:00. - `persons` is documented as free text with the participants as entered. - `Country.iso3166` is documented as ISO 3166-1 alpha-3 (e.g. `DEU`). - `costCenter`, `costObjective` and the `unassignedReceipt` of a job are documented as nullable; they are null when not set. - Login (`POST /v1/auth/login`): an unknown email now gets the same answer as a wrong password, `401` with the message "E-Mail-Adresse oder Passwort ist falsch." (before: `404`). The state of the person (archived, locked, passive, contract ended) is only answered after the password is right. - A wrong HTTP method on a known path answers `405`. - Requests after the end of the contract are refused with `401` without asking the payment provider on every request. - Uploads (`POST /v1/jobs/unassigned-receipts`) are checked before a job is created: a missing file, an empty or damaged file, a type other than PDF, PNG, JPG, JPEG or GIF, more than 5 MB, or content that does not match the declared type are refused with `422` and a message (before: `202` and a broken job). - Upload jobs (`GET /v1/jobs/unassigned-receipts/{id}`) never stay `running` for ever: a job whose processing fails answers `error` with a message in `jobError`, and a job still running 10 minutes after its start is answered and kept as `error` (its receipt stays in the incoming receipts). - A PDF with more than 15 pages is refused like in the web upload: its upload job answers `error` with a message in `jobError`, and no receipt is created. - Uploads (`POST /v1/jobs/unassigned-receipts`) answer with the job id right away, also when several are sent at the same time (before: sometimes `202` with the id `nil`). At most 5 upload jobs of a user run at the same time; a further upload is refused with `429`, `Retry-After` and `limitType` `uploads`, and no job is created. - Hotel receipts: `cityTaxReceiptVats` and `parkingReceiptVats` now contain every layer with an amount, also when the receipt was filled by the receipt recognition (before: empty `{}`). VAT layer fields a receipt kind does not have are always empty: city tax and parking only for hotel, `additionalReceiptVats` only for hotel and business entertainment, `thirdReceiptVats` only where the receipt kind and document date have it. ##### Notes - Apart from the new optional field `ratePercent`, the new endpoint `GET /v1/health` and the [login](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/loginUser) answers, the responses are unchanged; existing integrations are unaffected. --- ### v1.0.5 — June 2026 #### Manual Exchange Rates Receipts in foreign currencies can now distinguish between the system reference rate and a rate entered manually by the user. ##### New - Added `isManualExchangeRate` (boolean): indicates whether `exchangeRate` was entered manually instead of taken from the system rate. - Added `systemExchangeRate` (number, nullable): the system reference rate for the currency and date, against which a manual rate is compared. Equals `exchangeRate` when no override applies; null for EUR receipts. ##### Changed - Clarified `exchangeRate`: it is always the rate actually used to convert the foreign amount to EUR (foreign units per 1 EUR; EUR = amount / exchangeRate). - Clarified `exchangeRateDate`: null when the rate was entered manually. ##### Notes - All three fields are additive and optional; existing integrations are unaffected. --- ### v1.0.4 — March 2026 #### Initial Release The first official version of the Spesenfuchs API introduces the foundational features required to integrate receipt upload workflows into external applications. ##### New - Added endpoints for managing **unassigned receipts** (“Belegeingang”) - Upload receipt images - Retrieve unassigned receipts - Delete unassigned receipts - Fetch recent uploads - Implemented **JWT-based authentication** with RSA Keys - Introduced API versioning with `/v1` namespace - Published complete **OpenAPI 3.0 specification** - Added interactive API documentation via Swagger UI and Redoc ##### Notes - This version focuses on building stable integrations for digital receipt handover. - Additional modules (trips, exports, users, accounting) will be added in future releases. --- What is planned next is described in the [Roadmap](https://api.spesenfuchs.de/redoc.html#tag/Overview/Roadmap). # API reference ## Auth Sign in with the email address and password of a Spesenfuchs user, renew the IdToken with the refresh token, read the profile of the signed-in user and log out. How the tokens work is explained in [Authentication](https://api.spesenfuchs.de/redoc.html#tag/CredentialsAuthentication). ### POST /v1/auth/login **Authenticate a user** Authenticates a user and returns access credentials for subsequent API requests. **Request Body** ```json { "username": "afriendlyuser@gmail.com", "password": "pa$$word" } ``` **Success Response (200 OK)** Returns authentication tokens AND user profile. **Profile in the Response** The response also contains the profile of the user, so an app can start in the language of the user at once; it is the state at login, current data come from [`GET /auth/profile`](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/getProfile). **Refused sign-in** A wrong email or password answers 401 `invalid_credentials`. With the right password the sign-in can still be refused with 403, for example `subscription_inactive` when the company has no active contract (contract or test ended, or open payments); the message tells why, see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors). How to use the tokens and keep them safe is described in the chapter [Authentication](https://api.spesenfuchs.de/redoc.html#tag/CredentialsAuthentication). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`application/json`) ```json { "username" : "afriendlyuser@gmail.com", "password" : "pa$$word" } ``` Responses: - `200`: Successful authentication with AWS Cognito tokens and user profile - `400`: Invalid request. The field code tells the reason. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. Example response `200`: ```json { "ChallengeParameters" : { }, "AuthenticationResult" : { "AccessToken" : "eyJraWQiOiJCNDN0d0lxRUZoMCtheWxybHFNTXdNUHlqdEo3Rnl...", "IdToken" : "eyJraWQiOiI2b1ExWGhqMWpCSHJ3OTd6UVI4RXF2WVZXan0...", "RefreshToken" : "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNBLU9BRVAifQ...", "ExpiresIn" : 3600, "TokenType" : "Bearer" }, "person" : { "id" : "202601011200-1-1", "type" : "Person", "version" : -792631127459870717, "versionString" : "-792631127459870717", "name" : "Erika Mustermann", "email" : "erika.mustermann@example.invalid", "customerNumber" : "K0000001", "language" : "German", "isTrialExpired" : false } } ``` ```bash curl -X POST \ 'https://api.spesenfuchs.de/v1/auth/login' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{ "password": "pa$$word", "username": "afriendlyuser@gmail.com" }' ``` ### GET /v1/auth/profile **Profile information** Returns the profile information of the currently authenticated user. **Success Response (200 OK)** Returns: User ID, type, version, versionString, name, email, customerNumber, language, isTrialExpired **Email Format** The email address is returned in lowercase, normalized form. **Use Cases** - Verify token validity before making other API calls - Display current user's email in UI - Check if user session is still active - Obtain normalized email address for user identification - Detect whether trial-based restrictions apply to the current user **Token Validation** This endpoint validates: 1. Token signature (RS256) 2. User existence in database 3. User account status (active, not locked, not archived) Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: User profile retrieved successfully - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. Example response `200`: ```json { "id" : "202601011200-1-1", "type" : "Person", "version" : -792631127459870717, "versionString" : "-792631127459870717", "name" : "Erika Mustermann", "email" : "erika.mustermann@example.invalid", "customerNumber" : "K0000001", "language" : "German", "isTrialExpired" : false } ``` ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/auth/profile?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### POST /v1/auth/refresh **Refresh token** Refreshes an expired or expiring idToken using a valid refreshToken. No Bearer token required; send the refreshToken in the request body. **Use Case** When your idToken expires (typically after 1 hour), use this endpoint to obtain a new one without requiring the user to log in again. **Request Body** ```json { "refreshToken": "eyJjdHkiOiJ..." } ``` **Success Response (200 OK)** Returns a new idToken with fresh expiration. Note the spelling: the refresh answers `idToken`, the [login](https://api.spesenfuchs.de/redoc.html#tag/Auth/operation/loginUser) answers `AuthenticationResult.IdToken`, as AWS Cognito names it. Both are the same kind of token. **Important Notes** - The refreshToken itself is NOT returned again - The original refreshToken remains valid and should be stored securely - The refreshToken is typically valid for **30 days** after initial login - Each refresh extends your session without requiring password re-entry **Token Lifecycle** 1. User logs in → receives idToken (1h) + refreshToken (30d) 2. After ~50 minutes → app refreshes idToken using refreshToken 3. New idToken obtained → valid for another hour 4. Repeat step 2-3 until refreshToken expires (30 days) 5. After 30 days → user must log in again via `/auth/login` **Security Considerations** - Store refreshTokens securely (encrypted storage, secure keychain) - Never expose refreshTokens in URLs or logs - Implement automatic refresh logic 5-10 minutes before idToken expiration - Revoke refreshTokens on logout or security events Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`application/json`) ```json { "refreshToken" : "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ..." } ``` Responses: - `200`: Successfully refreshed authentication tokens - `400`: Invalid request. The field code tells the reason. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. Example response `200`: ```json { "idToken" : "eyJraWQiOiI2b1ExWGhqMWpCSHJ3OTd6UVI4RXF2WVZXaHl1b3ZSSTFlMjZCaVNyeUNjPSIsImFsZyI6IlJTMjU2In0...", "expiresIn" : 3600 } ``` ```bash curl -X POST \ 'https://api.spesenfuchs.de/v1/auth/refresh?lang=eng' \ -H 'accept: */*' \ -H 'Content-Type: application/json' \ -d '{"refreshToken": ""}' ``` ### POST /v1/auth/logoff **Log out: block the Bearer token, revoke the refresh token** Blocks the user's Bearer token (the IdToken) and revokes the refresh token sent in the body on the authentication server. After the logout the API refuses the blocked token; in rare cases it is still accepted until it expires (at most one hour). **Request Body** ```json { "refreshToken": "eyJjdHk..." } ``` **Request Fields** - **refreshToken** (optional): The refresh token to invalidate. If it or the whole body is missing, only the Bearer token is blocked. **Success Response (200 OK)** Returns a confirmation with `message` and `timestamp`. **Logout with Refresh Token** When a refresh token is provided, the authentication server revokes it: nobody can get a new IdToken with it any more. This ends only the session of this refresh token; other devices that signed in on their own keep their refresh tokens and stay signed in. **Logout without Refresh Token** If no refresh token is provided, only the Bearer token is blocked. With the refresh token a new IdToken can still be obtained. **Best Practices** - Always clear tokens from client storage after logout - Send the refresh token, so that this session cannot be renewed - Redirect user to login page after successful logout - Handle network errors gracefully (consider logout successful even if request fails) Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`application/json`) ```json { "refreshToken" : "eyJjdHkiOiJKV1QiLCJlbmMiOiJBMjU2R0NNIiwiYWxnIjoiUlNBLU9BRVAifQ..." } ``` Responses: - `200`: Successfully logged out and tokens invalidated - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. Example response `200`: ```json { "timestamp" : "2026-02-05T09:42:43.416+01:00", "message" : "Successfully logged out" } ``` ```bash curl -X POST \ 'https://api.spesenfuchs.de/v1/auth/logoff?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ## Unassigned Receipts The unassigned receipts collect the receipts of a user that are not yet part of an expense report, such as photos from an app or PDFs from another system. In Spesenfuchs the user later adds them to expense reports. **Typical flow** 1. Upload a receipt file ([upload](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/uploadReceipt)). The `202` response comes at once with a **job ID**; the receipt recognition runs in the background. 2. Query the state of the job ([upload job](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getUploadJob)) until it reports `finished` or `error`; this usually takes 3–30 seconds. 3. With the receipt ID of the finished job, retrieve the receipt ([receipt](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt)) and, if needed, its document ([document](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceiptDocument)). ### POST /v1/jobs/unassigned-receipts **Upload an unassigned receipt picture** Uploads a receipt file for asynchronous OCR processing. Returns a job ID for status tracking. The receipt belongs to the authenticated user. **Query Parameters** - **ocr** (optional, boolean, default: true): Enable or disable OCR processing - `true`: Perform full OCR text extraction (recommended) - `false`: Skip OCR processing (faster upload, no text extraction, use this for testing) - The server also accepts `1` and `yes` like `true`, `0` and `no` like `false`; any other value counts as `true`. - **takenByCamera** (optional, boolean, default: false): Indicates the file origin. - `true`: File was captured directly via device camera → E-invoice check is skipped (document is never an E-invoice) - `false` (default): File was received via share sheet / action extension → E-invoice check is performed (document could be an E-invoice) **Response (202 Accepted)** Returns immediately with a *job* ID for tracking. Do not mess with the ID of the receipt. **Response Fields** - **id**: Job identifier for status polling via GET /jobs/unassigned-receipts/{id} **Supported Formats** - PDF (recommended for multi-page) - PNG, JPG, JPEG (photos/scans) - GIF (scans) - Maximum file size: 5 MB **File Check** The file is checked before a job is created. A missing file (no multipart part), an empty or damaged file, another type, more than 5 MB, or content that does not match the declared type (e.g. a PNG sent as PDF) is refused with **422 Unprocessable Entity** and a message; no job is created. **Running Uploads** At most 5 uploads per user run at the same time, a further one gets 429, see [Rate limits](https://api.spesenfuchs.de/redoc.html#tag/Rate-limit/Overview). **Processing** The receipt recognition runs in the background, usually 3–30 seconds; query the state via [upload job](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getUploadJob). **Repeating an Upload** Send the optional header `Idempotency-Key` with a key of your own for every receipt, e.g. a UUID (1 to 255 printable ASCII characters without blanks). If the answer gets lost, for example on a weak connection, send the same upload again with the same key: the answer is the job of the first upload with the same `id`, and no second receipt is created. This also helps own scripts that repeat uploads. Create the key once per receipt, not per attempt. A key is valid for 24 hours per user. The same key with another file is refused with **422** and `code: idempotency_key_reused`, an invalid key with **400** and `code: invalid_request`. If the first upload failed, a repeat creates the receipt anew. Without the header everything works as before. **Best Practices** - Check the file size (at most 5 MB) before uploading - The receipt should be completely visible and sharp Parameters: - `ocr` (query, optional): Switches the receipt recognition (OCR) on or off: true (default) or false. When on, the system extracts text, amounts, dates and merchant information from the receipt image. The server also accepts 1 and yes like true, 0 and no like false; any other value counts as true. - `takenByCamera` (query, optional): Indicates whether the file was captured directly via the device camera (true) or shared via the system share sheet / action extension (false). When true, E-invoice (ZUGFeRD/XRechnung) detection is skipped, since camera photos cannot contain embedded XML. In this case it is clear, that the invoice can not be an e-invoice. Default: false. - `Idempotency-Key` (header, optional): Optional key of this upload of your own, e.g. a UUID: 1 to 255 printable ASCII characters without blanks. Send the same key again when you repeat the upload; the answer is then the job of the first upload and no second receipt is created. Valid for 24 hours per user. - `X-Rka-Creator` (header, optional): Optional source of the upload, stored in the field creator of the receipt: spesenfuchs-app-ios, spesenfuchs-app-android or spesenfuchs-api. Without the header, and with any other value, the receipt gets spesenfuchs-api. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`multipart/form-data`) Responses: - `202`: Upload accepted and job created successfully. - `400`: Invalid request. The field code tells the reason. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `422`: The content cannot be processed. The field code tells why. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X POST \ 'https://api.spesenfuchs.de/v1/jobs/unassigned-receipts?ocr=false&takenByCamera=false&lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' \ -H 'X-Rka-Creator: spesenfuchs-api' \ -H 'Content-Type: multipart/form-data' \ -F 'file=@beleg.pdf;type=application/pdf' ``` ### GET /v1/jobs/unassigned-receipts/{id} **Get one unassigned receipt upload job** Retrieves the status and result of an unassigned receipt processing job. **Use Case** After uploading a receipt via `POST /jobs/unassigned-receipts`, use this endpoint to: - Check processing status - Retrieve extracted metadata (OCR results) - With `?expand=unassigned_receipt`, get the receipt with `urlForFile`, the signed URL of the uploaded file - Detect processing errors **Path Parameter** - **id**: The job ID returned from the upload endpoint (format: `YYYYMMDDHHmm-nnnnnnnnn-nnnnnnn`). > **Important:** The job ID and the receipt ID look the same but are different. See [flow of unassigned receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts). **Response (200 OK)** Returns job details and processing status. **Job Status Values** - **running**: Job created, OCR and AI classification in progress - **finished**: Processing complete, data available - **error**: Processing failed, the message is in the field `jobError` **Processing Time** - Typical: 3-30 seconds for standard receipts - Complex documents (multi-page PDFs): up to 60 seconds **Polling Strategy** Use exponential backoff when checking job status: - Start with 2-second delay, double after each attempt - Cap maximum delay at 16 seconds - Stop after 2 minutes or when job reaches `finished`/`error` status Example delays: 2s → 4s → 8s → 16s → 16s... Parameters: - `id` (path, required): ID of the upload job from the answer of the upload; it looks like a receipt ID but is another one. - `expand` (query, optional): Comma-separated list of fields to expand inline. Supported values: person, unassigned_receipt, currency, receipt_kind, payment_method, country, vat, money, cost_object, fields - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: Successful response - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/jobs/unassigned-receipts/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/unassigned-receipts/{id} **Get one unassigned receipt** Retrieves a specific unassigned receipt by ID. **Use Case** - Display receipt details in UI - Verify receipt metadata before creating expense - Check if receipt still exists before attaching to trip **Path Parameter** - **id**: Unique receipt identifier (format: `YYYYMMDDHHmm-nnnnnnnnn-nnnnnnn`). > **Important:** The job ID and the receipt ID look the same but are different. See [flow of unassigned receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts). **Response (200 OK)** Returns complete receipt information. **Field Descriptions** **Identity & Status:** - `id`: Unique receipt identifier (format: `YYYYMMDDHHmm-nnnnnnnnn-nnnnnnn`) - `type`: Resource type (always "UnassignedReceipt") - `version`: version of the receipt, a 64-bit whole number (no counter); send it back with the PATCH - `versionString`: the same version as a string, for JavaScript clients, which round `version` - `isUploadFinished`: Processing completion status - `lastChange`: Last modification timestamp **Dates (ISO 8601 with timezone):** - `date`: Service/booking date - `endDate`: End date for multi-day expenses (e.g., hotel checkout) - `documentDate`: Date printed on original document **Financial Breakdown:** - `receiptVats`: Primary VAT layers (net, gross, VAT amount per category) - `additionalReceiptVats`, `thirdReceiptVats`, `cityTaxReceiptVats`, `parkingReceiptVats`: Additional tax layers - `currency`: Original currency (ISO 4217) - `exchangeRate`: Rate actually used to convert FC to EUR (foreign units per 1 EUR; EUR = amount / exchangeRate). 1.0 for EUR. Informational only — the Money amounts are authoritative, do not recompute. - `isManualExchangeRate`: True if the rate was entered manually instead of the system rate. Authoritative override marker. - `systemExchangeRate`: System daily rate for the currency at exchangeRateDate, against which a manual rate is compared. Equals exchangeRate when isManualExchangeRate is false; null for EUR receipts. - `exchangeRateDate`: Reference date of systemExchangeRate (ISO 8601), also with a manual rate. Null for EUR receipts. **Amount Format:** Without `expand=money` every amount is a string with a point and two decimals, e.g. `"9.15"`. With `?expand=money` every amount is an object of this format (see [Expand](https://api.spesenfuchs.de/redoc.html#tag/Expand)): ```json {"type": "Money", "currency": "EUR", "amount": 123.45} ``` **Metadata:** - `receiptDescription`: User-provided description - `receiptKind`: Type classification (Hotel, Meal, etc.) - `paymentMethod`: Payment details including reimbursement flag - `country`: Expense location (ISO 3166) - `originalFilenames`: Original file name(s) from upload **Cost Allocation:** - `costCenter`, `costObjective`: Assigned cost objects (nullable) - `useCostObjectsOfTrip`: Inherit from parent trip if true **Special Fields:** - `isEinvoice`: Electronic invoice format (ZUGFeRD/XRechnung) - `creator`: Source of the receipt, the header `X-Rka-Creator` of the upload: `spesenfuchs-api` without the header, `spesenfuchs-app-ios` or `spesenfuchs-app-android` from the Spesenfuchs apps **Completeness and Form:** A receipt tells whether something is missing and, on request, describes what its form looks like in Spesenfuchs. Your client does not have to rebuild the rules of Spesenfuchs, such as which fields a hotel receipt has or which VAT rate is preset. - `isComplete`: `true` when nothing is missing or wrong. - `missingFields`: otherwise every missing or wrong point with `code`, `field` and `message`, in the same form as the field errors (see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors)). `field` is `null` when an error belongs to no single field. Use them, for example, to mark a receipt as incomplete in a list or to show the message next to the field. - `checkStatus`: the check status of the receipt inbox on the web: `mandatory_data_missing`, `unchecked` or `checked`. How your client sets it is described with the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt). - `fields`: only with `?expand=fields` (see [Expand](https://api.spesenfuchs.de/redoc.html#tag/Expand)), e.g. when the user opens the receipt to edit it. The list names the fields of the form for the receipt kind, country and date of this receipt as it is stored: - in the order of the form; - with the label in the language of the user; - with `required` for mandatory fields; - for amounts with `rates`, the VAT rates in percent to choose from. The first rate is the preset one; an empty list means no choice (receipts abroad). Ignore field names in `fields` you do not know: fields may be added later, and a client that shows only the fields it knows keeps working. How the form changes when the user, for example, changes the receipt kind is described in [Receipt Editing in Apps](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps). **S3 URL Expiration** All document URLs are pre-signed and valid for **24 hours**. After expiration: - Re-fetch the receipt to get fresh URLs - URLs automatically regenerated on each GET request **Security** - Users can only access their own receipts - Receipt ownership validated via token claims - S3 URLs are signed and expire after 24 hours; until then anybody who has such a URL can open the file, so keep them confidential (do not log or pass them on) Parameters: - `id` (path, required): ID of the receipt. - `expand` (query, optional): Comma-separated list of fields to expand inline. Supported values: person, currency, receipt_kind, payment_method, country, vat, money, cost_object, fields - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: Successful response - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### DELETE /v1/unassigned-receipts/{id} **Delete an unassigned receipt** Permanently deletes an unassigned receipt. **Path Parameter** - **id**: Unique receipt identifier to delete. > **Important:** The job ID and the receipt ID look the same but are different. See [flow of unassigned receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts). **Success Response (204 No Content)** Receipt successfully deleted. No response body. **Deletion Scope** The following are permanently deleted: - Original uploaded file - All preview images - Receipt metadata and OCR data - Database record **Irreversible** Deleting cannot be undone; a second call for the same receipt returns 404. **While the receipt is processed** Right after an upload the receipt is still processed (upload job `running`); a delete in this time answers 409 `recognition_running` and deletes nothing. Try again once the upload job is `finished` or `error`. **Attached Receipts** Receipts that have been attached to expenses or trips cannot be deleted via this endpoint **Recommendation** Let the user confirm the deletion. Parameters: - `id` (path, required): ID of the receipt. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `204`: Resource deleted successfully. No content is returned. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `409`: Conflict with the current state. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X DELETE \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/unassigned-receipts/document/{id} **Get one unassigned receipt document** Returns a pre-signed S3 URL of the file of an unassigned receipt, valid for 24 hours: the original file (PDF, PNG, JPG or GIF) if available, otherwise a picture of the receipt. The authenticated user must own the receipt. **Path Parameters** - `id` (required): Unique receipt identifier (format: `YYYYMMDDHHmm-nnnnnnnnn-nnnnnnn`). > **Important:** The job ID and the receipt ID look the same but are different. See [flow of unassigned receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts). **Success Response (200 OK)** Returns document metadata with pre-signed URL. **Field Descriptions** - **id**: Receipt identifier (matches request parameter) - **type**: Always "UnassignedReceiptDocument" for this resource - **version**: version of the receipt, a 64-bit whole number (no counter) - **versionString**: the same version as a string, for JavaScript clients, which round **version** - **document**: Pre-signed S3 URL for direct file download - **Valid for**: 24 hours - **File**: the original file if available, otherwise a picture of the receipt - **null**: when there is no file (yet), for example while the upload is still being processed - **Direct download**: URL can be used directly in browser or download managers **URL Validity** The URL is valid for 24 hours and cannot be extended; get a new one when needed, do not store it and do not pass it on, because receipts contain personal data. Parameters: - `id` (path, required): ID of the receipt. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: Successful response - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/document/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/unassigned-receipts/recent **Get unassigned receipt pictures** Retrieves the 30 most recent unassigned receipts for the authenticated user. Returns only the own receipts of the user. **Response (200 OK)** Returns complete receipt information of the last maximum 30 receipts. **Response Fields** - **success**: Request success flag - **count**: Number of receipts in response (max 30) - **overall**: Total unassigned receipts for this user - **objects**: Array of receipt objects with full metadata **Receipt Object Highlights** - **id**: Unique identifier - **urlForFile**: Thumbnail preview URL (valid for 24 hours) - **date**: Receipt date - **receiptDescription**: User description - **receiptKind**: Type (Hotel, Meal, etc.) - **isUploadFinished**: Processing status - **originalFilenames**: Original file names - All fields are described at [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt) **Sorting** Receipts sorted by upload date (newest first). **Best Practices** - Use `urlForFile` for thumbnail previews in list views - Refresh on user request or after successful upload - For more than 30 receipts, page through [GET /unassigned-receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/listUnassignedReceipts) Parameters: - `expand` (query, optional): Comma-separated list of fields to expand inline. Supported values: person, currency, receipt_kind, payment_method, country, vat, money, cost_object, fields - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: List of recent unassigned receipts for the current user. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/recent?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/unassigned-receipts **List unassigned receipts page by page** Retrieves the unassigned receipts of the authenticated user page by page, newest first. Returns only the own receipts of the user. The receipts have the same format as in [GET /unassigned-receipts/recent](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getRecentReceipts). **Paging** - `limit`: receipts per page, 30 by default, at most 100 (larger values are reduced to 100) - `cursor`: leave it out for the first page; for the next page send the value of `nextCursor` of the previous page - on the last page `hasMore` is false and `nextCursor` is null - new uploads do not shift the pages; deleted receipts and receipts assigned to a trip do not disturb paging **Response Fields** - **success**: Request success flag - **count**: Number of receipts on this page - **overall**: Total unassigned receipts for this user at the time of the request - **objects**: Array of receipt objects, all fields are described at [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt) - **nextCursor**: Cursor of the next page, or null - **hasMore**: Whether more receipts follow **Errors** Errors of this endpoint have a fixed `code`: `invalid_request` for an invalid `limit`, `invalid_cursor` for a damaged or unknown cursor (then request the first page again without cursor). The codes are listed in [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors). Parameters: - `expand` (query, optional): Comma-separated list of fields to expand inline. Supported values: person, currency, receipt_kind, payment_method, country, vat, money, cost_object, fields - `limit` (query, optional): Number of receipts per page, 30 by default. Values above 100 are reduced to 100. - `cursor` (query, optional): The value of nextCursor of the previous page. Leave it out for the first page. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: One page of the unassigned receipts of the current user, newest first. - `400`: Invalid request. The field code tells the reason. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/unassigned-receipts?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ## Receipt Editing in Apps For apps in which the user edits a receipt of the [unassigned receipts](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts) in a form: the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) calculates a change before it is saved, the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt) saves it. **Flow** 1. Open the receipt for editing with [`GET /unassigned-receipts/{id}?expand=fields`](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt) and build the form from `fields`; what `fields`, `isComplete`, `missingFields` and `checkStatus` mean is described with the fields there. 2. When the user changes the receipt kind, the country, the date or the currency, ask the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) with everything your client shows differently from the saved receipt. Show `taxRateHint` at the tax rate field; ask the user only when `droppedFields` is not empty. Send `amountsReceiptKindKey` with the `receiptKindKey` of the last answer you show, so that amounts typed after a change of the receipt kind are neither refused nor lost. 3. Save with the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt): the changed fields, `amountsReceiptKindKey` as with the preview, and the `version` you loaded (or `versionString`, see [save changes](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt)). Missing data may be saved, wrong values are refused. Which values are allowed is described in the input rules of the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt); what your client does with each answer is described with the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt). ### POST /v1/unassigned-receipts/preview/{id} **Preview a change of an unassigned receipt** Computes an unassigned receipt as it would be after a change, without saving anything. Use it when the user changes the receipt kind, the country, the date or the currency while editing a receipt: the answer has the new fields of the form, the moved amounts, the exchange rate and the amounts in EUR. **Request** - The body has the same field names and form as [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt): master data by their keys (`receiptKindKey`, `paymentMethodId`, cost centers and cost objectives by their number, `country` and `currency` as ISO code), dates as in the GET or as `YYYY-MM-DD`, amounts gross only: a layer like `receiptVats` is an object with the keys `full`, `reduced` or `zero`, each with `grossAmountFC`. `exchangeRate` sets a manual exchange rate (foreign currency per 1 EUR), `null` removes it. To empty a text field, send `""` or `null`; both mean an empty text. - Send everything your client shows differently from the saved receipt, also amounts not saved yet. The preview first takes these values and then makes the change of country and currency, date and receipt kind, like the receipt form of Spesenfuchs: amounts are moved to the fields of the new receipt kind, not deleted. With a new receipt kind the amounts you send are those of the old receipt kind; the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt) instead takes them as amounts of the new receipt kind. - `amountsReceiptKindKey` (optional): the receipt kind your client shows the amounts for, always the `receiptKindKey` of the last answer it shows (loading the receipt or the last preview). Then the amounts you send count as amounts of that receipt kind: the stored amounts are first moved to it, yours are put on top and checked with its rules (for example several VAT rates for office supplies), and then everything is moved to `receiptKindKey` like in the receipt form. Amounts typed after a change of the receipt kind are thus neither refused nor lost. Send it with every preview and with saving, together with all amounts of the form; an unknown receipt kind gives `unknown_value`. Without it nothing changes. - `country` and `currency` go together as one of the pairs in `currencies` of [GET /countries](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getCountries), like the country selection on the web. A new `country` alone keeps the currency of the receipt when it belongs to that country, else it gets the euro or, without euro, the first currency of the country. A pair that does not exist is refused with `currency_not_of_country` on the field `currency`. - `version` or `versionString` may be sent and is passed over, so you can send the same body as for saving. The answer has the version of the saved receipt in both fields. **Input rules** A change with the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) or [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt) follows the same rules as the receipt form on the web: - **Texts** are cleaned: spaces at the start and the end and invisible control characters are removed. In single line fields a line break becomes a space; the comment keeps its lines. - **Lengths:** `receiptDescription` and `receiverOfPresent` at most 65 characters, `persons`, `place` and `reason` at most 300, `receiptComment` at most 1000 characters in at most 5 lines. Otherwise `too_long` or `too_many_lines`. - **Dates** only within the current licence range, otherwise `outside_licence_range`. - **Amounts** are never negative (`out_of_range` at the amount). All amount fields of a receipt together (for example meal, drinks and tip) may amount to at most 100,000 euros (`out_of_range` at the field `receiptVats`). - **Manual exchange rate:** between the official rate divided by 10 and the official rate times 10, otherwise `out_of_range` at `exchangeRate`. Only values your request changes are checked. A saved receipt that breaks a limit can still be changed as long as you do not change that value. **Response (200 OK)** The receipt as in the GET, always with `fields` (see [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt)), and two more fields: - `taxRateHint`: the hint to check the tax rate after a change of the receipt kind, or `null`. Show it at the tax rate field. - `droppedFields`: amounts the change drops, each with `field`, `label` and `value`. Ask the user only when this list is not empty. Moved amounts are not in it, nor texts like place or persons: they are kept and come back when the user changes back. - Abroad there is only one amount: changing to a foreign country adds the amounts by VAT rate of the first amount up to one total amount. Amounts that exist only in Germany (breakfast and drinks of a hotel, tip and drinks of a business entertainment) are dropped, as in the receipt form of the web, and named in `droppedFields`; the city tax of a hotel stays. - What is still missing (for example the place of a business entertainment) is no error here but in `isComplete` and `missingFields`. **Errors** Errors have a fixed `code` (see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors)): `not_found`, `not_owner`, `recognition_running` while the receipt is still being read, `invalid_request` when the body is no JSON object, and `validation_failed` with the list `errors` when fields cannot be read, for example `unknown_field`, `read_only`, `invalid_format`, `unknown_value`, `inactive`, `multiple_rates_abroad` or `multiple_rates_not_allowed` (several VAT rates for an amount whose `multipleRates` is false). When the request sends a new country, the amounts sent are those shown for the country before. Back to Germany several VAT rates are allowed and the rates sent are kept, except an amount without German VAT (`zero`, the amount shown abroad): like an amount not sent, it gets the preset rate (first entry of `rates`). To a country abroad several VAT rates are checked with the receipt kind and added up to one amount; `multiple_rates_abroad` comes only for a receipt that is abroad and stays there. Parameters: - `id` (path, required): ID of the receipt. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`application/json`) Responses: - `200`: The receipt as it would be after the change. Nothing is saved. - `400`: The body is no JSON object. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: The receipt belongs to another person. - `404`: The receipt does not exist. - `409`: The receipt recognition is still running. - `422`: Fields of the request cannot be taken over. The list errors names each field with its code. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X POST \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/preview/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{"receiptKindKey": 2}' ``` ### PATCH /v1/unassigned-receipts/{id} **Save changes of an unassigned receipt** Saves the changed fields of an unassigned receipt and checks it like saving the receipt form in the web (see `checkStatus` below). The [introduction of this chapter](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps) describes the whole flow from the form through the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) to saving. **Request** - Only the changed fields, with the same names and form as [GET /unassigned-receipts/{id}](https://api.spesenfuchs.de/redoc.html#tag/Unassigned-Receipts/operation/getReceipt) and as the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt): master data by their keys, amounts gross only, a layer like `receiptVats` always as a whole. To empty a text field, send `""` or `null`; both mean an empty text. - With a new `receiptKindKey`, the amounts you send are those of the new receipt kind, as the user sees them after the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt): they are checked with its rules (for example several VAT rates for office supplies) and saved as sent, not moved. Amounts you do not send are filled by moving the stored amounts, as with a change of the receipt kind alone; an amount you send is never moved a second time into another field. - `amountsReceiptKindKey` (optional), as in the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt): the receipt kind the amounts you send are meant for. With it the PATCH takes the amounts exactly like the preview with the same body, so saving gives what the last preview showed; the rule above then does not apply. - `version` or `versionString` is required: the version of the receipt your client loaded, in the field you received it. JavaScript clients send `versionString`, because JavaScript rounds the 64-bit number `version`; if you send both, they must have the same value (else 422 with the field code `version_mismatch`). Net amounts, VAT, exchange rate and amounts in EUR are computed by the server. **Response (200 OK)** The saved receipt with the new `version` (and `versionString`), with `fields`, `isComplete` and `missingFields`. When the request changes nothing, nothing is saved and the `version` (and `versionString`) stays. **Answers at a glance** | Answer | What your client does | |---|---| | 200 | show the saved receipt; it has the new `version` (and `versionString`) | | 409 `version_conflict` | the receipt was changed meanwhile: ask the user whether to show the current state (in `receipt`) or to send the own changes again with the new `version` | | 409 `recognition_running` | the receipt is still being read: try again in a few seconds | | 422 `validation_failed` | show the messages of `errors` at the fields | | 503 `save_not_possible` | nothing was saved: try again later | **Missing data and wrong values** - Data that is still missing (for example the description, the place of a business entertainment or the departure of a hotel) does not stop saving: the receipt is saved and `isComplete` is false. - Wrong values (for example a text that is too long, more than 20 persons, a departure before the arrival) are refused with 422 and nothing is saved. Which values are allowed is described in the input rules of the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt). - `checkStatus`: send `checked` or `unchecked` to set it, like the check button on the web. `checked` for a receipt with missing data is refused with 422 and `receipt_incomplete` on the field `checkStatus`, followed by the missing fields in the form of `missingFields`; nothing is saved. Without `checkStatus`, saving counts as checking, like saving the receipt form on the web: a receipt that is complete afterwards becomes `checked`, missing data gives `mandatory_data_missing` (the receipt is saved anyway, so a user can save single details and add the rest later). `unchecked` takes the check back. **Version conflict** When the receipt was changed since your client loaded it and your request would change something, the answer is 409 with `code: version_conflict` and the current receipt under `receipt`. Ask the user whether to show the current state or to send the own changes again with the new `version`. When your request changes nothing because the receipt is already saved like this, the answer is 200 with the receipt, without saving, whatever the `version`. This makes it safe to repeat a request after a timeout: if it was already saved, the answer is 200; if someone saved the same fields differently meanwhile, the answer is 409. There is no time limit for this. **Errors** Errors have a fixed `code` (see [Errors](https://api.spesenfuchs.de/redoc.html#tag/Errors)): `not_found`, `not_owner`, `recognition_running` while the receipt is still being read, `version_conflict`, `invalid_request` when the body is no JSON object, `validation_failed` with the list `errors` (for example `multiple_rates_not_allowed` for several VAT rates where `multipleRates` is false, or `currency_not_of_country` when `country` and `currency` are no pair of [GET /countries](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getCountries), see the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt)), and `save_not_possible` (503) when the receipt could not be saved safely; then try again later. Parameters: - `id` (path, required): ID of the receipt. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Request body (`application/json`) Responses: - `200`: The saved receipt with the new version, with fields. When the request changes nothing, nothing is saved and the version stays. - `400`: The body is no JSON object. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: The receipt belongs to another person. - `404`: The receipt does not exist. - `409`: The version does not fit (version_conflict, with the current receipt under receipt) or the receipt recognition is still running (recognition_running). - `422`: Fields cannot be read or have wrong values. The list errors names each field with its code; nothing was saved. - `500`: Unexpected error. Give the support the timestamp of the answer. - `503`: The receipt could not be saved safely just now. Nothing was saved; try again later. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X PATCH \ 'https://api.spesenfuchs.de/v1/unassigned-receipts/?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' \ -H 'Content-Type: application/json' \ -d '{"receiptDescription": "Zeitung und Kugelschreiber, Messe", "version": 7}' ``` ## Master Data The master data are the lists a user chooses from when capturing expenses: receipt kinds, payment methods, cost centers or cost units, countries and currencies. In addition there are the company settings, for example whether the company uses cost centers. - **Fixed keys:** `receiptKindKey` of a receipt kind and `id` of a payment method are the same values as in the fields `receiptKindKey` and `paymentMethodId` of a receipt. - **Role:** Some fields are only visible to administrators and owners of the company. - **Caching:** All six endpoints return an `ETag`. Send it in `If-None-Match`; if nothing has changed, the response is `304 Not Modified` without content. The ETag also changes with the language and the role. This way you can check the lists at every start of the app without loading them each time. ### GET /v1/receipt-kinds **List receipt kinds** Lists the receipt kinds the user may choose, like the receipt form of the web app: the list for employers or employees (depending on the user), without the kinds the company switched off. The names are translated into the language of the user. **Fixed keys** `receiptKindKey` never changes. Receipts answer it as `receiptKindKey`, so a client with a cached list can match them. A receipt may show a kind the company switched off later; its name is in the receipt itself. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: Receipt kinds the user may choose, with their fixed keys. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/receipt-kinds?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/payment-methods **List payment methods** Lists the payment methods of the company, active and inactive, sorted by name. Payment methods apply to all users of a company. Only active ones can be chosen; inactive ones still appear on older receipts. **Fixed ids** `id` never changes. Receipts answer it as `paymentMethodId`. **Fields by role** `account`, `isUsed` and `isExportToFibu` are only answered to user admins and owners. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: Payment methods of the company, active and inactive. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/payment-methods?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/cost-objects **List cost centers or cost objectives** Lists the cost centers (`type=costCenter`) or cost objectives (`type=costObjective`) of the company, active and inactive, sorted by name. Without a valid `type` the answer is `400`. Inactive cost objects cannot be chosen but still appear on older receipts. Whether the company uses cost objects at all is answered by `GET /v1/company-settings`. **Matching** Receipts answer the cost center and cost objective by their number (`costObjectNumber`), which is unique within a company. **Fields by role** `isCostObjectUsed` is only answered to user admins and owners. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `type` (query, required): Which cost objects to list: costCenter or costObjective. - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: Cost centers or cost objectives of the company, active and inactive. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `400`: Invalid request. The field code tells the reason. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/cost-objects?type=costCenter&lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/countries **List countries** Lists all countries with their ISO 3166-1 alpha-3 code (`iso3166`, e.g. `DEU`), the name translated into the language of the user and the ISO 4217 code of their currency (`currency`). `displayName` is the name with the currency as the receipt form of the web shows it, e.g. `China (Hongkong-Dollar)`; it is unique, use it in selection lists. `currencies` lists every currency of the country with its own `displayName`; Bulgaria, Croatia and Cuba have two, so offer one entry per currency, as the receipt form of the web does. Sorted by name. Receipts answer the country by `iso3166`. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: All countries with ISO 3166-1 alpha-3 code, translated name and currency. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/countries?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/currencies **List currencies** Lists all currencies with their ISO 4217 code (`iso4217`, e.g. `CHF`) and the name translated into the language of the user, sorted by name. The currencies of a country are listed in `currencies` of [GET /countries](https://api.spesenfuchs.de/redoc.html#tag/Master-Data/operation/getCountries); the [preview](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/previewReceipt) and the [PATCH](https://api.spesenfuchs.de/redoc.html#tag/Receipt-Editing-in-Apps/operation/updateReceipt) take country and currency only as one of these pairs. Receipts answer the currency by `iso4217`. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: All currencies with ISO 4217 code and translated name. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/currencies?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ### GET /v1/company-settings **Get company settings** Answers the settings of the company a client needs to show and edit receipts. - **costObjectsEnabled**: whether the company uses cost centers and cost objectives (one switch for both). When true, show both fields on receipts, also when nothing is assigned yet. Caching with `ETag` and fields by role: see [Master Data](https://api.spesenfuchs.de/redoc.html#tag/Master-Data). Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. - `If-None-Match` (header, optional): ETag of an earlier answer; when the list is unchanged, the answer is 304 without body. Responses: - `200`: Settings of the company. - `304`: Not modified: the ETag sent in If-None-Match is still current. No body. - `401`: Not signed in: no or an invalid token, wrong credentials, or no person. The field code tells which. - `403`: Not allowed. The field code tells the reason. - `404`: Not found, or this version of the app is blocked. The field code tells which. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/company-settings?lang=eng' \ -H 'accept: */*' \ -H 'Authorization: Bearer ' ``` ## Health Check without a token whether the API is reachable: before the sign-in and for monitoring. ### GET /v1/health **Health check** Answers whether the API is reachable. No authentication required. Use it before the login (e.g. to show that the service is down) and for monitoring. It checks nothing expensive: a 200 means the server answers. Requests to this endpoint are not logged and count on the public rate limit. Parameters: - `lang` (query, optional): Optional: eng for messages in English, otherwise German. It applies as long as no user is known (sign-in, refresh, token errors, rate limits); after that the language of the user applies. Responses: - `200`: The API answers. - `500`: Unexpected error. Give the support the timestamp of the answer. - `429`: Too many requests: a rate limit is used up. Wait the seconds of Retry-After; limitType tells which limit. Example response `200`: ```json { "status" : "ok", "version" : "1.0.8", "timestamp" : "2026-02-23T14:33:00Z" } ``` ```bash curl -X GET \ 'https://api.spesenfuchs.de/v1/health' \ -H 'accept: */*' ``` # Schemas ## Money Represents a monetary value with currency and amount. - `type` (string): Resource type label (always 'Money') - `currency` (string): ISO-4217 currency code - `amount` (number): Monetary amount ## CostObject Represents a cost object such as a cost center or cost objective. - `id` (string): Unique cost object identifier (timestamp-based) - `type` (string): Object type - CostCenter or CostObjective - `costObjectName` (string): The descriptive name of the cost object - `costObjectNumber` (string): The accounting identifier or number of the cost object - `isInactive` (boolean): Indicates whether the cost object is inactive - `isCostObjectUsed` (boolean): Whether this cost object was used in at least one expense. In the master data lists only answered to user admins and owners. ## Country Represents a country defined by ISO 3166 and a translated display name. - `type` (string): Resource type label (always 'Country') - `iso3166` (string): ISO 3166-1 alpha-3 country code - `countryName` (string): Localized country name - `displayName` (string): Localized country name with the name of its currency, as the receipt form of the web shows it, e.g. China (Hongkong-Dollar). Unique for all countries; use it in selection lists. - `currency` (string): ISO 4217 code of the currency of the country. - `currencies` (array): All currencies of the country, the first one is currency. A few countries have two, e.g. Bulgaria, Croatia and Cuba; offer one entry per currency in selection lists, as the receipt form of the web does. ## Currency Represents a currency with ISO 4217 code and translated currency name. - `type` (string): Resource type label (always 'Currency') - `iso4217` (string): ISO 4217 currency code - `currencyName` (string): Localized name of the currency ## PaymentMethod Represents a payment method including accounting and export options. - `type` (string): Resource type label (always 'PaymentMethod') - `id` (string): Fixed id of the payment method (hex like a Mongo ObjectId). Matches paymentMethodId of receipts. - `paymentMethodName` (string): Descriptive name of the payment method - `account` (string): Accounting number or identifier associated with the payment method. In the master data lists only answered to user admins and owners. - `disburse` (boolean): Indicates whether this payment method is reimbursable - `isActive` (boolean): Whether the payment method is currently active - `isUsed` (boolean): Indicates if this method is used in any receipt. In the master data lists only answered to user admins and owners. - `isExportToFibu` (boolean): Whether this payment method is exported to accounting (FIBU). In the master data lists only answered to user admins and owners. - `isDefaultPaymentMethod` (boolean): Marks the method as the default choice ## Person Represents a person entity within Spesenfuchs. - `id` (string): Unique person identifier (timestamp-based) - `type` (string): Resource type label (always 'Person') - `version` (integer): Version of the person, a 64-bit whole number, not a counter. JavaScript and other clients that read JSON numbers as doubles round it; versionString has it exactly. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). - `name` (string): Full name of the person. - `email` (string): Lowercased email address of the person - `customerNumber` (string): Unique customer account identifier - `language` (string): User interface language preference - `isTrialExpired` (boolean): Indicates whether the trial period is expired ## ReceiptKind Represents the classification type of a receipt. - `type` (string): Resource type label (always 'ReceiptKind') - `receiptKindName` (string): Localized receipt kind name - `receiptKindKey` (integer): Immutable technical key for the receipt type ## UnassignedReceipt Represents an unassigned receipt uploaded to Spesenfuchs before attaching it to an expense. - `id` (string): Unique unassigned receipt identifier (timestamp-based). - `type` (string): Resource type label (always 'UnassignedReceipt'). - `version` (integer): Version of the receipt, a 64-bit whole number, not a counter. Send it back unchanged with the PATCH. JavaScript and other clients that read JSON numbers as doubles round it; they read and send versionString instead. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). The PATCH takes it instead of version. - `isUploadFinished` (boolean): Indicates whether the receipt upload has been fully completed. - `person` (object): Person ID or expanded Person object. Use ?expand=person for the full object. - `lastChange` (string): Timestamp of last modification, ISO 8601. - `urlForFile` (string): Public S3 URL of the uploaded file. Valid for 24 hours. - `date` (string): Date the receipt refers to, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `endDate` (string): Optional end date for Hotel receipts, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `documentDate` (string): Date printed on the original document, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `displayDate` (string): Human-readable date or date range in German DD.MM.YYYY format. - `receiptVats` (object): VAT layers for normal VAT processing. Only layers in use are present (keys full, reduced, zero). - `additionalReceiptVats` (object): VAT layers for additional non-standard VAT. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel or business entertainment. - `thirdReceiptVats` (object): VAT layers for third-level taxation. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind and document date have this field. - `cityTaxReceiptVats` (object): City tax VAT layers. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `parkingReceiptVats` (object): VAT layers for parking receipts. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `netAmountEUR` (object): Net amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `grossAmountEUR` (object): Gross amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `receiptDescription` (string): User-provided description of the receipt. - `currency` (object): ISO 4217 currency code or expanded Currency object. Use ?expand=currency for the full object. - `exchangeRate` (number): Exchange rate actually used to convert the foreign-currency amount to EUR (foreign-currency units per 1 EUR; EUR = foreignAmount / exchangeRate). 1.0 if the receipt is already in EUR. - `isManualExchangeRate` (boolean): True if exchangeRate was entered manually by the user instead of the system daily rate. - `systemExchangeRate` (number): The system daily rate for the currency at exchangeRateDate (foreign-currency units per 1 EUR), against which a manual rate is compared. Equals exchangeRate when isManualExchangeRate is false. Null for EUR receipts. - `exchangeRateDate` (string): Reference date of systemExchangeRate, ISO 8601, also when the rate was entered manually (isManualExchangeRate = true). Null for EUR receipts. - `receiptKind` (object): Receipt kind name or expanded ReceiptKind object. Use ?expand=receipt_kind for the full object. - `receiptKindKey` (integer): Fixed key of the receipt kind, as in GET /v1/receipt-kinds. - `place` (string): Location where the expense occurred (only relevant for business entertainment expense "Bewirtungsbeleg"). - `persons` (string): Free text with the participants as entered, e.g. 'Suel Manaa, Sabine' (only relevant for business entertainment expense "Bewirtungsbeleg"). - `reason` (string): Reason for the expense (only relevant for business entertainment expense "Bewirtungsbeleg") - `receiverOfPresent` (string): Name of the present receiver, if applicable - `paymentMethod` (object): Payment method name or expanded PaymentMethod object. Use ?expand=payment_method for the full object. - `paymentMethodId` (string): Fixed id of the payment method, as in GET /v1/payment-methods. - `country` (object): ISO 3166 country code or expanded Country object. Use ?expand=country for the full object. - `isOnlyInternalPersons` (boolean): True if only internal employees were hosted. - `originalFilenames` (array): Original filenames supplied during upload. - `costCenter` (object): Cost center number or expanded CostObject. Use ?expand=cost_object for the full object. - `costObjective` (object): Cost objective number or expanded CostObject. Use ?expand=cost_object for the full object. - `useCostObjectsOfTrip` (boolean): If true, cost objects are inherited from the trip. - `receiptComment` (string): Optional user-entered comment - `isEinvoice` (boolean): True if the document was uploaded as an electronic invoice. - `creator` (string): Source of the receipt. - `fields` (array): Only with expand=fields. Fields of the receipt form for the receipt kind, country and date of this receipt, in the order of the form: field name, label in the language of the user, whether a value is required and, for amounts, the VAT rates in percent to choose from, the preset rate first (empty abroad). - `isComplete` (boolean): True if nothing is missing or wrong in the receipt, i.e. missingFields is empty. - `missingFields` (array): What is missing or wrong in the receipt, in the form of the field errors of status 422: code, field (null when the error belongs to no single field) and message in the language of the user. Empty when the receipt is complete. - `checkStatus` (string): Check status of the receipt in the receipt inbox on the web: mandatory_data_missing (data is missing), unchecked (complete, but not yet marked as checked) or checked (marked as checked). Stored with the receipt, unlike isComplete, which is computed for every answer. Saving with a PATCH counts as checking, like saving the receipt form on the web: without checkStatus a PATCH sets checked when the receipt is complete afterwards and mandatory_data_missing when data is missing; the receipt is saved in both cases. unchecked in the PATCH takes the check back; checked for a receipt with missing data is refused with 422 receipt_incomplete. unchecked is otherwise left for complete receipts from the receipt recognition that nobody has saved yet. ## UnassignedReceiptDocument Represents an unassigned receipt uploaded to Spesenfuchs before attaching it to an expense - `id` (string): Unique unassigned receipt identifier (timestamp-based) - `type` (string): Resource type label (always 'UnassignedReceiptDocument' for this resource type) - `version` (integer): Version of the receipt, a 64-bit whole number, not a counter. Send it back unchanged with the PATCH. JavaScript and other clients that read JSON numbers as doubles round it; they read and send versionString instead. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). The PATCH takes it instead of version. - `document` (string): Public S3 URL of the receipt file, valid for 24 hours: the original file if available, otherwise a picture of the receipt. null when there is no file (yet), for example while the upload is still being processed. ## UnassignedReceiptJob Represents the asynchronous upload job for an unassigned receipt. - `id` (string): Unique job identifier (timestamp-based). - `type` (string): Resource type label (always 'UnassignedReceiptUploadJob'). - `version` (integer): Version of the upload job, a 64-bit whole number, not a counter; 0 while the job has no person. JavaScript and other clients that read JSON numbers as doubles round it; versionString has it exactly. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). - `jobStatus` (string): Current processing state of the job. - `finishedAt` (string): Date and time when the job finished, ISO 8601. Null if still running. - `jobError` (string): Error message if the job failed. - `lastChange` (string): Time of last modification, ISO 8601. - `filename` (string): Original upload filename. - `person` (object): Person ID or expanded Person object. Use ?expand=person for the full object. - `unassignedReceipt` (object): Receipt ID or expanded UnassignedReceipt object. Use ?expand=unassigned_receipt for the full object. - `personName` (string): Name of the person receiving the upload. - `personEmail` (string): Email address of receiver. - `creator` (string): Source of the job. ## Vat Represents a VAT category with a localized name. - `type` (string): Resource type label (always 'Vat') - `vatName` (string): Localized VAT category name ## ReceiptVat Represents a VAT layer for a specific VAT category. - `netAmountEUR` (object): Net amount in EUR. Use ?expand=money for the full object. - `grossAmountFC` (object): Gross amount in foreign currency. Use ?expand=money for the full object. - `grossAmountEUR` (object): Gross amount in EUR. Use ?expand=money for the full object. - `vatAmountEUR` (object): VAT amount in EUR. Use ?expand=money for the full object. - `exchangeRate` (number) - `currency` (object): ISO 4217 currency code or expanded Currency object. Use ?expand=currency for the full object. - `vat` (object): VAT name or expanded Vat object. Use ?expand=vat for the full object. - `ratePercent` (number): VAT rate in percent the amounts were computed with: the rate of the VAT kind on the document date of the receipt (e.g. 5 for reduced VAT in the second half of 2020), 0 under the small business rule (Kleinunternehmerregelung). ## ApiError Error response of the API with a fixed code. - `success` (boolean): Always false in an error response. - `code` (string): Fixed code of the error in English snake_case. It never changes its meaning. - `message` (string): Message for humans in the language of the user; without a known user in the language of the parameter lang. - `error` (string): Deprecated: only some older endpoints send it, with the same text as message. Use code. - `timestamp` (string): Only with the code internal_error: the time of the request or answer. Give it to the support. - `errors` (array): Only with the code validation_failed: one entry per field. ## RateLimitError Error response 429: a rate limit is used up. - `success` (boolean): Always false in an error response. - `code` (string): Always rate_limit_exceeded. - `message` (string): Message for humans in the language of the parameter lang, for uploads in the language of the user. - `error` (string): Deprecated: the same value as code. Use code. - `limitType` (string): The limit that is used up. - `endpointType` (string): Only with limitType ip: which limit per IP address. - `retryAfter` (integer): Seconds until the limit is full again, the same as the header Retry-After. - `userRemaining` (integer): Only with limitType user or organization: requests left for the user. - `orgRemaining` (integer): Only with limitType user or organization: requests left for the company. - `remaining` (integer): Only with limitType ip: requests left for the IP address. - `running` (integer): Only with limitType uploads: upload jobs of the user running now. - `maximum` (integer): Only with limitType uploads: upload jobs of a user that may run at the same time. ## FieldError One field error of an error response. - `code` (string): Fixed code of the field error. - `field` (string): Name of the field. - `message` (string): Message for humans in the language of the user; without a known user in the language of the parameter lang. ## ReceiptField One field of the receipt form. - `field` (string): Name of the field in the receipt, e.g. receiptDescription or receiptVats. - `label` (string): Label of the field in the receipt form, in the language of the user. - `required` (boolean): True if the receipt is incomplete without a value. - `rates` (array): Only for amounts: the VAT rates in percent to choose from, the preset rate first. Empty abroad. - `multipleRates` (boolean): Only for amounts: true if the amount takes several VAT rates (entry by VAT rate, keys full, reduced, zero), false if it takes one. Offer a further rate only when true; otherwise the preview and the PATCH answer 422 with multiple_rates_not_allowed or multiple_rates_abroad. ## ReceiptPreview The unassigned receipt as it would be after a change, never saved. - `id` (string): Unique unassigned receipt identifier (timestamp-based). - `type` (string): Resource type label (always 'UnassignedReceipt'). - `version` (integer): Version of the receipt, a 64-bit whole number, not a counter. Send it back unchanged with the PATCH. JavaScript and other clients that read JSON numbers as doubles round it; they read and send versionString instead. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). The PATCH takes it instead of version. - `isUploadFinished` (boolean): Indicates whether the receipt upload has been fully completed. - `person` (object): Person ID or expanded Person object. Use ?expand=person for the full object. - `lastChange` (string): Timestamp of last modification, ISO 8601. - `urlForFile` (string): Public S3 URL of the uploaded file. Valid for 24 hours. - `date` (string): Date the receipt refers to, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `endDate` (string): Optional end date for Hotel receipts, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `documentDate` (string): Date printed on the original document, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `displayDate` (string): Human-readable date or date range in German DD.MM.YYYY format. - `receiptVats` (object): VAT layers for normal VAT processing. Only layers in use are present (keys full, reduced, zero). - `additionalReceiptVats` (object): VAT layers for additional non-standard VAT. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel or business entertainment. - `thirdReceiptVats` (object): VAT layers for third-level taxation. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind and document date have this field. - `cityTaxReceiptVats` (object): City tax VAT layers. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `parkingReceiptVats` (object): VAT layers for parking receipts. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `netAmountEUR` (object): Net amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `grossAmountEUR` (object): Gross amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `receiptDescription` (string): User-provided description of the receipt. - `currency` (object): ISO 4217 currency code or expanded Currency object. Use ?expand=currency for the full object. - `exchangeRate` (number): Exchange rate actually used to convert the foreign-currency amount to EUR (foreign-currency units per 1 EUR; EUR = foreignAmount / exchangeRate). 1.0 if the receipt is already in EUR. - `isManualExchangeRate` (boolean): True if exchangeRate was entered manually by the user instead of the system daily rate. - `systemExchangeRate` (number): The system daily rate for the currency at exchangeRateDate (foreign-currency units per 1 EUR), against which a manual rate is compared. Equals exchangeRate when isManualExchangeRate is false. Null for EUR receipts. - `exchangeRateDate` (string): Reference date of systemExchangeRate, ISO 8601, also when the rate was entered manually (isManualExchangeRate = true). Null for EUR receipts. - `receiptKind` (object): Receipt kind name or expanded ReceiptKind object. Use ?expand=receipt_kind for the full object. - `receiptKindKey` (integer): Fixed key of the receipt kind, as in GET /v1/receipt-kinds. - `place` (string): Location where the expense occurred (only relevant for business entertainment expense "Bewirtungsbeleg"). - `persons` (string): Free text with the participants as entered, e.g. 'Suel Manaa, Sabine' (only relevant for business entertainment expense "Bewirtungsbeleg"). - `reason` (string): Reason for the expense (only relevant for business entertainment expense "Bewirtungsbeleg") - `receiverOfPresent` (string): Name of the present receiver, if applicable - `paymentMethod` (object): Payment method name or expanded PaymentMethod object. Use ?expand=payment_method for the full object. - `paymentMethodId` (string): Fixed id of the payment method, as in GET /v1/payment-methods. - `country` (object): ISO 3166 country code or expanded Country object. Use ?expand=country for the full object. - `isOnlyInternalPersons` (boolean): True if only internal employees were hosted. - `originalFilenames` (array): Original filenames supplied during upload. - `costCenter` (object): Cost center number or expanded CostObject. Use ?expand=cost_object for the full object. - `costObjective` (object): Cost objective number or expanded CostObject. Use ?expand=cost_object for the full object. - `useCostObjectsOfTrip` (boolean): If true, cost objects are inherited from the trip. - `receiptComment` (string): Optional user-entered comment - `isEinvoice` (boolean): True if the document was uploaded as an electronic invoice. - `creator` (string): Source of the receipt. - `fields` (array): Always in the preview. Fields of the receipt form for the receipt kind, country and date of the receipt after the change, in the order of the form: field name, label in the language of the user, whether a value is required and, for amounts, the VAT rates in percent to choose from, the preset rate first (empty abroad). - `isComplete` (boolean): True if nothing is missing or wrong in the receipt, i.e. missingFields is empty. - `missingFields` (array): What is missing or wrong in the receipt, in the form of the field errors of status 422: code, field (null when the error belongs to no single field) and message in the language of the user. Empty when the receipt is complete. - `checkStatus` (string): Check status of the receipt in the receipt inbox on the web: mandatory_data_missing (data is missing), unchecked (complete, but not yet marked as checked) or checked (marked as checked). Stored with the receipt, unlike isComplete, which is computed for every answer. Saving with a PATCH counts as checking, like saving the receipt form on the web: without checkStatus a PATCH sets checked when the receipt is complete afterwards and mandatory_data_missing when data is missing; the receipt is saved in both cases. unchecked in the PATCH takes the check back; checked for a receipt with missing data is refused with 422 receipt_incomplete. unchecked is otherwise left for complete receipts from the receipt recognition that nobody has saved yet. - `taxRateHint` (string): Hint to check the tax rate after a change of the receipt kind, or null. - `droppedFields` (array): Amounts the change drops. Ask the user only when this list is not empty. ## SavedReceipt The unassigned receipt as the PATCH saved it. - `id` (string): Unique unassigned receipt identifier (timestamp-based). - `type` (string): Resource type label (always 'UnassignedReceipt'). - `version` (integer): Version of the receipt, a 64-bit whole number, not a counter. Send it back unchanged with the PATCH. JavaScript and other clients that read JSON numbers as doubles round it; they read and send versionString instead. - `versionString` (string): The version as a string with the same value, for clients that round version (JavaScript). The PATCH takes it instead of version. - `isUploadFinished` (boolean): Indicates whether the receipt upload has been fully completed. - `person` (object): Person ID or expanded Person object. Use ?expand=person for the full object. - `lastChange` (string): Timestamp of last modification, ISO 8601. - `urlForFile` (string): Public S3 URL of the uploaded file. Valid for 24 hours. - `date` (string): Date the receipt refers to, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `endDate` (string): Optional end date for Hotel receipts, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `documentDate` (string): Date printed on the original document, ISO 8601 date-time, always with the fixed offset +01:00 (the calendar day is the day of the receipt). - `displayDate` (string): Human-readable date or date range in German DD.MM.YYYY format. - `receiptVats` (object): VAT layers for normal VAT processing. Only layers in use are present (keys full, reduced, zero). - `additionalReceiptVats` (object): VAT layers for additional non-standard VAT. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel or business entertainment. - `thirdReceiptVats` (object): VAT layers for third-level taxation. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind and document date have this field. - `cityTaxReceiptVats` (object): City tax VAT layers. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `parkingReceiptVats` (object): VAT layers for parking receipts. Only layers in use are present (keys full, reduced, zero). Empty unless the receipt kind is hotel. - `netAmountEUR` (object): Net amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `grossAmountEUR` (object): Gross amount in EUR as string or expanded Money object. Use ?expand=money for the full object. - `receiptDescription` (string): User-provided description of the receipt. - `currency` (object): ISO 4217 currency code or expanded Currency object. Use ?expand=currency for the full object. - `exchangeRate` (number): Exchange rate actually used to convert the foreign-currency amount to EUR (foreign-currency units per 1 EUR; EUR = foreignAmount / exchangeRate). 1.0 if the receipt is already in EUR. - `isManualExchangeRate` (boolean): True if exchangeRate was entered manually by the user instead of the system daily rate. - `systemExchangeRate` (number): The system daily rate for the currency at exchangeRateDate (foreign-currency units per 1 EUR), against which a manual rate is compared. Equals exchangeRate when isManualExchangeRate is false. Null for EUR receipts. - `exchangeRateDate` (string): Reference date of systemExchangeRate, ISO 8601, also when the rate was entered manually (isManualExchangeRate = true). Null for EUR receipts. - `receiptKind` (object): Receipt kind name or expanded ReceiptKind object. Use ?expand=receipt_kind for the full object. - `receiptKindKey` (integer): Fixed key of the receipt kind, as in GET /v1/receipt-kinds. - `place` (string): Location where the expense occurred (only relevant for business entertainment expense "Bewirtungsbeleg"). - `persons` (string): Free text with the participants as entered, e.g. 'Suel Manaa, Sabine' (only relevant for business entertainment expense "Bewirtungsbeleg"). - `reason` (string): Reason for the expense (only relevant for business entertainment expense "Bewirtungsbeleg") - `receiverOfPresent` (string): Name of the present receiver, if applicable - `paymentMethod` (object): Payment method name or expanded PaymentMethod object. Use ?expand=payment_method for the full object. - `paymentMethodId` (string): Fixed id of the payment method, as in GET /v1/payment-methods. - `country` (object): ISO 3166 country code or expanded Country object. Use ?expand=country for the full object. - `isOnlyInternalPersons` (boolean): True if only internal employees were hosted. - `originalFilenames` (array): Original filenames supplied during upload. - `costCenter` (object): Cost center number or expanded CostObject. Use ?expand=cost_object for the full object. - `costObjective` (object): Cost objective number or expanded CostObject. Use ?expand=cost_object for the full object. - `useCostObjectsOfTrip` (boolean): If true, cost objects are inherited from the trip. - `receiptComment` (string): Optional user-entered comment - `isEinvoice` (boolean): True if the document was uploaded as an electronic invoice. - `creator` (string): Source of the receipt. - `fields` (array): Always in the answer of the PATCH. Fields of the receipt form for the receipt kind, country and date of the saved receipt, in the order of the form: field name, label in the language of the user, whether a value is required and, for amounts, the VAT rates in percent to choose from, the preset rate first (empty abroad). - `isComplete` (boolean): True if nothing is missing or wrong in the receipt, i.e. missingFields is empty. - `missingFields` (array): What is missing or wrong in the receipt, in the form of the field errors of status 422: code, field (null when the error belongs to no single field) and message in the language of the user. Empty when the receipt is complete. - `checkStatus` (string): Check status of the receipt in the receipt inbox on the web: mandatory_data_missing (data is missing), unchecked (complete, but not yet marked as checked) or checked (marked as checked). Stored with the receipt, unlike isComplete, which is computed for every answer. Saving with a PATCH counts as checking, like saving the receipt form on the web: without checkStatus a PATCH sets checked when the receipt is complete afterwards and mandatory_data_missing when data is missing; the receipt is saved in both cases. unchecked in the PATCH takes the check back; checked for a receipt with missing data is refused with 422 receipt_incomplete. unchecked is otherwise left for complete receipts from the receipt recognition that nobody has saved yet. ## DroppedField An amount the change drops. - `field` (string): Name of the amount field, e.g. thirdReceiptVats. - `label` (string): Label of the field before the change, in the language of the user. - `value` (string): Gross amount that is dropped, as text. ## ReceiptVatsChange Amounts of a VAT layer by VAT rate, gross only. Several rates only in receiptVats of a receipt in Germany whose receipt kind allows it. - `full` (object) - `reduced` (object) - `zero` (object) ## VersionConflict Error answer of the PATCH with status 409. With version_conflict it carries the current receipt under receipt. - `success` (boolean): Always false in an error response. - `code` (string): Fixed code of the error in English snake_case. It never changes its meaning. - `message` (string): Message for humans in the language of the user; without a known user in the language of the parameter lang. - `error` (string): Deprecated: only some older endpoints send it, with the same text as message. Use code. - `timestamp` (string): Only with the code internal_error: the time of the request or answer. Give it to the support. - `errors` (array): Only with the code validation_failed: one entry per field. - `receipt` (UnassignedReceipt)