cancel
Showing results for 
Search instead for 
Did you mean: 

InventoryGenEntries with InternalSerialNumber

juanpmg2
Discoverer
0 Kudos
172

Good afternoon to all.

I would like to see if someone can help me. I can successfully enter products from my API using the endpoint 

https://XXXXXX:50000/b1s/v1/InventoryGenEntries with the body  

{
  "DocumentLines": [
    {
      "ItemCode": "410224",
      "Quantity": 1,
      "WarehouseCode": "001",
      "AccountCode": "1.01.004.01.002",
    }
  ]
But now i need to send the lot number. I'm trying to do the following. 
{
"DocumentLines": [
{
"ItemCode": "410224",
"Quantity": 1,
"WarehouseCode": "001",
"AccountCode": "1.01.004.01.002",
"SerialNumbers": [
{
"InternalSerialNumber": "1424"
}
]
}
]
} but it give me this error  {
"error": {
"code": -10,
"message": {
"lang": "en-us",
"value": "10001172 - Blank strings are not allowed in row 1 (in unique field). [OSRN.SysNumber][line: 0]"
}
}
}. Can some one help me. Thank you!!!!

Accepted Solutions (0)

Answers (1)

Answers (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi juanpmg2,

Kindly check the following setting in SAP Business One:

Serial Numbers.jpg

In my database, I have set the option Unique Serial Numbers by as Mfr Serial No.

Now, if I use the following request and do not set value in ManufacturerSerialNumber property, I get the same error as you are having:

POST /b1s/v1/InventoryGenEntries

{
    "DocumentLines": [
        {
            "ItemCode": "S10000",
            "Quantity": 1,
            "SerialNumbers": [
                {
                    "InternalSerialNumber": "TMSRL02"
                }
            ]
        }
    ]
}
 
{
    "error": {
        "code"-10,
        "message": {
            "lang""en-us",
            "value""10001172 - Blank strings are not allowed in row 1 (in unique field). [OSRN.SysNumber][line: 0]"
        }
    }
}
Kindly check it accordingly.
 
Kind regards,
ANKIT CHAUHAN
SAP Business One Support
juanpmg2
Discoverer
0 Kudos
Hi ANKIT_CHAUHAN
juanpmg2
Discoverer
0 Kudos
Hi ANKIT_CHAUHAN... I made the change in the general settings and changed it in the Unique Serial Numbers section to "Manufacturer's Serial Number" and with the new request body. { "DocDate": "2025-03-22", "DocDueDate": "2025-03-22", "Comments": "Entrada automática por API - lote 1526", "DocumentLines": [ { "ItemCode": "410224", "Quantity": 1, "WarehouseCode": "001", "AccountCode": "1.01.004.01.002", "SerialNumbers": [ { "ManufacturerSerialNumber": "1526", "InternalSerialNumber": "1526", "LotNumber": "1526", "AdmissionDate": "2025-03-25", "ManufactureDate": "2025-03-24" } ] } ] } I still have the error. "value": "10001172 - Blank strings are not allowed in row 1 (in unique field). [OSRN.SysNumber][line: 0]"