API POST request with deep inserts creates "unwanted" lines
Hi,
When performing multiple API Posts using the same payload to create Purchase Invoice with lines using deep inserts ended up creating "unwanted" additional lines. This to me is wrong, when the same POST request is executed, BC should just issue a duplicate error.
1) Create API pages for Purchase Header and Line (Document Type = Order)
2) POST request is executed with the following payload:
{
"documentType": "Order",
"no": "9011",
"buyFromVendorNo": "10000",
"yourReference": "VINV001",
"purchaseLines": [
{
"lineNo": 1,
"type": "Item",
"no": "1964-S",
"description": "TEST",
"quantity": 1
},
{
"lineNo": 2,
"type": "Item",
"no": "1964-S",
"description": "TEST",
"quantity": 2
}
]
}
3) The same Payload is executed again (This time, I would expect BC to issue and error, instead I get a 201)
4) When I check the Purchase Order in BC, this is what I see:
It seems any additional POST request that I execute to create Purchase Order 9011, will just keep appending lines to the Order.
The expected behaviour from this would be for BC to issue a duplicate error.