0

我正在尝试通过 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 有效(因为我直接从应用程序中的分类帐帐户中获取)。我怎样才能解决这个问题?

4

1 回答 1

0

请仔细检查您用于销售发票的分类帐是否也列在

GET /ledger_accounts?visible_in=sales

这将为您提供可用于销售发票、销售报价、销售信用票据等的有效分类帐帐户列表。

另外,请查看有关发票的官方文档

于 2019-07-02T11:46:32.070 回答