You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

使用Xero Assets API无法设置Depreciation Start Date问题求助

Xero Assets API创建固定资产时折旧起始日期UI不显示问题

我通过Xero Assets API创建固定资产(未使用SDK),所有字段均正常生效,唯独Depreciation Start Date在Xero UI中显示为空。

发送的API请求体

{
  "assetName": "Asset name",
  "assetNumber": "CA-46987", 
  "serialNumber": "",
  "purchasePrice": 432,
  "purchaseDate": "2024-03-06T15:04:30.373",
  "bookDepreciationSetting": {
    "depreciationMethod": "StraightLine",
    "averagingMethod": "FullMonth",
    "effectiveLifeYears": 5,
    "depreciationCalculationMethod": "Life"
  },
  "bookDepreciationDetail": {
    "depreciationStartDate": "2024-03-07"
  }
}

API返回响应

{
  ...
  "bookDepreciationSetting": {
    "depreciableObjectId": "0965dc9e-3a5a-46f0-aac9-d7b7f0a466a5",
    "depreciableObjectType": "Asset",
    "bookEffectiveDateOfChangeId": "98108fe1-9eaa-4145-b660-4f36ca2a5418",
    "depreciationMethod": "StraightLine",
    "averagingMethod": "FullMonth",
    "effectiveLifeYears": 5,
    "depreciationCalculationMethod": "None"
  },
  "bookDepreciationDetail": {
    "depreciationStartDate": "2024-03-07T00:00:00",
    "priorAccumDepreciationAmount": 0,
    "currentAccumDepreciationAmount": 0,
    "currentCapitalGain": 0,
    "currentGainLoss": 0
  },
  "taxDepreciationSettings": [],
  "taxDepreciationDetails": [],
  "canRollback": true,
  "accountingBookValue": 432,
  "taxValues": [],
  "isDeleteEnabledForDate": true
}

从响应可见,depreciationStartDate已被正确处理为2024-03-07T00:00:00,并非简单回显我发送的日期部分2024-03-07,但在Xero UI中该字段仍为空,其余信息均正常填充。

已尝试的日期格式

  • 2024-03-07
  • 2024-03-07T00:00:00
  • 2024-03-07T00:00:00.000
  • 完整ISO日期格式

以上格式均无效。

补充测试

当使用"\/Date(1709769600)\/"格式发送日期时,API响应中bookDepreciationDetail里的depreciationStartDate字段直接被忽略:

...
"bookDepreciationDetail": {
  "priorAccumDepreciationAmount": 0,
  "currentAccumDepreciationAmount": 0,
  "currentCapitalGain": 0,
  "currentGainLoss": 0
},
...

请问这是API Bug还是我遗漏了必要参数?

内容的提问来源于stack exchange,提问作者styku

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.28 10:05:19