创建收支记录

记录新的收入或支出条目。该条目所链接的内容是从请求中推断出来的:

  • 提供 stay_code 来记录特定住宿的条目,
  • 提供 property_id 来记录针对特定房间的条目,
  • 不提供记录房东账号级别的条目(不与任何特定房间或住宿绑定;仅适用于主房东账号)。

stay_codeproperty_id 是互斥的。

direction 字段决定条目是 income 还是 expense,这又决定了 item_idGET /income_itemsGET /expense_items)和 payment_method_idGET /income_methodsGET /expense_methods)使用哪些字典。 amount 始终以正数形式提供;符号由 directioncurrency 随金额一起提供,并且必须提供,除非提供了 stay_code,在这种情况下,它是从订单订单继承的,如果您提供了它,它必须与订单的货币相匹配。

Body Params
integer

要记录条目的房间的 ID。与 stay_code 互斥。省略两者以记录房东账号级别的条目。

string

用于记录条目的停留的 stay_code(由 GET /reservations 返回)。与 property_id 互斥。省略两者以记录房东账号级别的条目。

string
enum
required

此条目代表收到的钱 (income) 还是花费的钱 (expense)。

Allowed:
number
required

条目的绝对数量。始终提供正数;符号由 direction

string

amount 附带的货币代码。必需的,除非提供了 stay_code;与订单相关的条目继承订单中的货币并拒绝不匹配的值。请参阅 Supported Currencies 了解更多信息。

integer
required

商品分类的id。当 direction=income 时,必须是来自 GET /income_items 的有效 ID;当 direction=expense 时,必须是来自 GET /expense_items 的有效 ID。

integer
required

支付方式的id。当 direction=income 时,必须是来自 GET /income_methods 的有效 ID;当 direction=expense 时,必须是来自 GET /expense_methods 的有效 ID。

string

当行动发生时。接受 ISO 8601 (ZZPH0ZZ)。默认为当前时间。如果设置为未来时间,则会创建状态为 outstanding 的条目;否则为paid

string

自由格式注释(最多 500 个字符)。

Response

Language
Credentials
Header
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json