how can i insert a Netsuite inventory adjustment with lot numbered items with suitetalk?

495 Views Asked by At

I don't know how to configure the inventory detail in the JSON

I'm trying to POST at https://<>.suitetalk.api.netsuite.com/services/rest/record/v1/inventoryAdjustment

this JSON

{
"account":  4738,
"trandate":"2022-11-14",
"subsidiary":3,

"inventory": 
    {
    "items": 
    [
        
        {
             
            "item": 9908,            
            "location":25,
            "adjustQtyBy": 100,
            "memo":"m-203174 p-21992 c-TM/55 #2"
            
           
           ,
            "inventoryDetail": 
            { 
                "inventoryAssignment": 
                [ 
                    { 
                        "receiptInventoryNumber": 2002111, 
                        "quantity": 100 
                    }
                ] 
            }
            
        }
        
    ]

    }
}

but i'm receiving this error:

{
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title": "Bad Request",
    "status": 400,
    "o:errorDetails": [
        {
            "detail": "Error while accessing a resource. You still need to reconfigure the inventory detail record after changing the quantity.",
            "o:errorPath": "inventory.items[0]",
            "o:errorCode": "USER_ERROR"
        }
    ]
}

i got this second error after changing inventorydetail section:

{
    "type": "https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.1",
    "title": "Bad Request",
    "status": 400,
    "o:errorDetails": [
        {
            "detail": "Invalid content in the request body.",
            "o:errorCode": "INVALID_CONTENT"
        }
    ]
}
1

There are 1 best solutions below

0
On BEST ANSWER

Now it works

{
"account":  4737,
"trandate":"2022-11-14",
"subsidiary":3,
"inventory": 
    {
    "items": 
    [
        {
            "item": 9908,            
            "location":25,
            "adjustQtyBy": 100,
            "memo":"P$203174$21992$TM/55$2"
           ,
           "inventoryDetail": 
            {                     
                "inventoryAssignment": 
                {                         
                    "items": 
                    [
                        {                             
                            "receiptInventoryNumber": 2002111,                             
                            "quantity": 100,
                            "expirationDate":"2022-11-30"
                        }
                    ]                     
                }                 
            }
        }
    ]
    }
}