NETSUITE:使用 REST API 将销售订单转换为发票时出现错误

问题描述 投票:0回答:1

我在 Netsuite 中有一个销售订单,我正在尝试为部分销售订单开具发票,以便能够向客户多次开具发票。
我尝试了不同的方法,但每次都会出错。

销售订单第一行有 3 个项目,第二行有 2 个项目

网址:{{REST_SERVICES}}/record/v1/salesorder/18657/!transform/invoice

{
    "trandate":"2023-11-21",
    "startdate":"2023-11-21",
    "duedate":"2023-12-31",
    "memo": "This is apostman test!",
    "externalid":"PO000093",
    "salesrep":"209",
    "tranId": "T2023000024",
    "item":{
        "items" : [ 
            {
                "item": {
                    "id" : "578"
                },
                "quantity" : 1.00
            },
            {
                "item": {
                    "id" : "578"
                },
                "quantity" : 1.00
            }
        ]
    }
}

=> 返回:

{
    "type": "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.1",
    "title": "Bad Request",
    "status": 400,
    "o:errorDetails": [
        {
            "detail": "Error while accessing a resource. Please choose an item to add.",
            "o:errorPath": "item.items[0]",
            "o:errorCode": "USER_ERROR"
        }
    ]
}

文档中的方法:

{
    "trandate":"2023-11-21",
    "startdate":"2023-11-21",
    "duedate":"2023-12-31",
    "memo": "This is apostman test!",
    "externalid":"PO000093",
    "salesrep":"209",
    "tranId": "T2023000024",
    "item":{
        "items" : [ 
            {
                "orderLine" : 1,
                "quantity" : 1.00
            },
            {
                "orderLine" : 2,
                "quantity" : 1.00
            }
        ]
    }
}

返回:

{
    "type": "https://www.rfc-editor.org/rfc/rfc9110.html#section-15.6.1",
    "title": "Internal Server Error",
    "status": 500,
    "o:errorDetails": [
        {
            "detail": "An unexpected error occurred. Error ID: lod29zoc1fx69m8xhmt5i",
            "o:errorCode": "UNEXPECTED_ERROR"
        }
    ]
}
rest netsuite netsuite-rest-api
1个回答
0
投票

我向 Netsuite 提出了一个案例,正在等待答复。
另一种方法是创建独立发票并将该行链接到销售订单。
这是一个例子:

{
    "entity": {
        "id": "1957"
    },
    "item": {
        "items": [
            {
                "account": {
                    "id": "307"
                },
                "amount": 2000.0,
                "description": "Testing invoicing",
                "item": {
                    "id": "578"
                },
                "orderDoc": {
                    "id": <your sales order id>
                },
                "orderLine": <your sales order line number>,
                "quantity": 1.0,
                "rate": 2000.0
            }
        ]
    },
    "memo": "Testing transformation alternative",
    "prevDate": "2023-10-30",
    "prevRep": 209,
    "salesEffectiveDate": "2023-10-30",
    "subsidiary": {
        "id": "5"
    },
    "tranDate": "2023-10-30",
    "tranId": "INV004 testing alternative - 0003"
}
© www.soinside.com 2019 - 2024. All rights reserved.