Xero API - “折扣率‘0.00’无效。”使用具有负金额的行项目创建发票时出错

问题描述 投票:0回答:1
当尝试通过 API 发送创建发票请求时,当发票包含负金额的行项目时,我收到 BadRequest 错误“发生验证异常,折扣率‘0.00’无效。”。同时,我可以通过 UI 创建带有负行项目的发票。使用 API 可以实现这一点吗? C

要求:

{ "AmountDue": 1.0, "AmountPaid": 0.0, "Contact": { "ContactID": "080d6f7d-db12-4a35-ae52-de5a4e815b4d" }, "CurrencyCode": "CAD", "CurrencyRate": 0.0, "Date": "2024-05-02T15:22:44", "LineAmountTypes": "Exclusive", "LineItems": [ { "AccountCode": "200", "Description": "item2", "DiscountAmount": 0.0, "DiscountRate": "0.00000", "ItemCode": "item2", "LineAmount": 10.0, "Quantity": 1.0, "TaxAmount": 0.0, "UnitAmount": 10.0 }, { "AccountCode": "200", "Description": "item3", "DiscountAmount": 0.0, "DiscountRate": "0.00000", "ItemCode": "item3", "LineAmount": -9.0, "Quantity": 1.0, "TaxAmount": 0.0, "UnitAmount": -9.0 } ], "SentToContact": false, "Status": "DRAFT", "SubTotal": 1.0, "Total": 1.0, "TotalDiscount": 0.0, "TotalTax": 0.0, "Type": "ACCREC" }
期望它能够工作,因为它可以通过 UI 实现。

invoice xero-api
1个回答
© www.soinside.com 2019 - 2024. All rights reserved.