我正在尝试通过Sage Accounting API调用添加销售发票。然而,我总是得到相同的错误,并且我找不到原因。
请求详情:
参数:
{
"sales_invoice": {
"contact_id": "2d06dde3927744f09c60557aae2d1f10",
"date": "2019-07-01 13:14:56",
"invoice_lines": [
{
"description": "Original remote control JVC RM-C3095",
"ledger_account_id": "7ccb54ca5df741f0b6cfbb6c35791f93",
"unit_price": "20.0000",
"quantity": 1,
"tax_rate_id": "ES_EXEMPT",
"eu_goods_services_type_id": "GOODS"
}
],
"invoice_number_prefix": "INV-",
"invoice_number": 4,
"delivery_address": {
"city": "xxx",
"address_line_1": "yyy",
"address_line_2": "zzz",
"postal_code": "014178"
},
"main_address": {
"city": "xxx",
"address_line_1": "yyy",
"address_line_2": "zzz",
"postal_code": "014178"
}
}
}错误:
Array
(
[0] => Array
(
[$severity] => error
[$dataCode] => RecordInvalid
[$message] => is invalid
[$source] => line_items.ledger_account
)
)即使账号id是有效的(就像我直接从应用中的账号中获取的一样)。我该如何解决这个问题呢?
发布于 2019-07-02 19:46:32
请仔细检查您用于销售发票的分类帐账户是否也列在
GET /ledger_accounts?visible_in=sales这将为您提供可用于销售发票、销售报价、销售贷方票据等的有效分类帐帐户列表。
此外,请查看官方documentation about invoicing。
https://stackoverflow.com/questions/56847075
复制相似问题