---
title: "Create Transaction"
method: POST
path: "/transactions"
tags: ["Incomes & Expenses"]
---

# Create Transaction

`POST /transactions`

Record a new income or expense entry. What the entry is linked to is inferred from the request:
- provide `stay_code` to record an entry against a specific stay,
- provide `property_id` to record an entry against a specific property,
- provide neither to record an operator-level entry (not tied to any specific property or stay; only available to the master operator).

`stay_code` and `property_id` are mutually exclusive.

The `direction` field decides whether the entry is an `income` or an `expense`, which in turn determines which dictionaries are used for `item_id` (`GET /income_items` or `GET /expense_items`) and `payment_method_id` (`GET /income_methods` or `GET /expense_methods`). The `amount` is always provided as a positive number; the sign is derived from `direction`. The `currency` accompanies the amount and must be supplied unless `stay_code` is provided, in which case it is inherited from the reservation order and, if you do provide it, it must match the order's currency.

## Request body

- object
  - `property_id` integer — The id of the property to record the entry against. Mutually exclusive with `stay_code`. Omit both to record an operator-level entry.
  - `stay_code` string — The `stay_code` (returned by `GET /reservations`) of the stay to record the entry against. Mutually exclusive with `property_id`. Omit both to record an operator-level entry.
  - `direction` 'income' | 'expense', required — Whether this entry represents money received (`income`) or money spent (`expense`).
  - `amount` number, required — Absolute amount of the entry. Always provide a positive value; the sign is derived from `direction`.
  - `currency` string — Currency code that accompanies `amount`. Required unless `stay_code` is provided; reservation-linked entries inherit the currency from the order and reject mismatching values. See [Supported Currencies](/reference/supported-currencies) for more information.
  - `item_id` integer, required — The id of the item categorization. Must be a valid id from `GET /income_items` when `direction=income`, or from `GET /expense_items` when `direction=expense`.
  - `payment_method_id` integer, required — The id of the payment method. Must be a valid id from `GET /income_methods` when `direction=income`, or from `GET /expense_methods` when `direction=expense`.
  - `action_at` string — When the action took place. Accepts ISO 8601 (`YYYY-MM-DDTHH:MM:SSZ`). Defaults to the current time. If set to a future time the entry is created with status `outstanding`; otherwise it is `paid`.
  - `note` string — Free-form note (max 500 characters).

## Response `200`

The transaction entry has been successfully created.

- object
  - `request_id` string, required — Unique identifier for the request.
  - `error_code` integer, required — Numeric error code representing the status of the response. A value of `200` indicates success. <br> See the [Error Codes](/reference/error-manual#error-codes) section for more information.
  - `error_msg` string, required — Message detailing the status of the response.
  - `data` object, required
    - `transaction_id` integer, required — Unique identifier of the newly created transaction entry.

---

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