@Gabriella Hennings wrote:
1) Sometimes it works, and sometimes it doesn't.
What do you mean by separating the update and insert allocations? I can't update the purchaseorderline receiptQty at the same time as inserting the allocations?
2) I also sometimes get the error "Error updating purchase receipt. Document with number 000015 could not be found" or "Error releasing purchase receipt Document with number 000016 could not be found" when trying to update or release a receipt even though i can see that the receipt exist in Visma.
1) First PUT: Insert Allocations
Second PUT: Update if necessary
2) Please check the receipt type (Document Type)
[ PoReceipt, PoReturn, TransferReceipt ]
In your JSON you're opening Allocations [] array multiple times for each line, you should only have one array and add lines under that. Please see the sample payload below.
{
"receiptType": {
"Value": "PoReceipt"
},
"lines": [
{
"allocations": [
{
"operation": "2",
"lineNbr": {
"value": 1
},
"location": {
"value": "1"
},
"lotSerialNumber": {
"value": "123"
},
"quantity": {
"value": 5
},
"uom": {
"value": "STK"
},
"expirationDate": {
"value": "2020-08-20T08:47:35.253Z"
}
},
{
"operation": "2",
"lineNbr": {
"value": 1
},
"location": {
"value": "1"
},
"lotSerialNumber": {
"value": "1234"
},
"quantity": {
"value": 5
},
"uom": {
"value": "STK"
},
"expirationDate": {
"value": "2020-08-20T08:47:35.253Z"
}
},
{
"operation": "2",
"lineNbr": {
"value": 3
},
"location": {
"value": "1"
},
"lotSerialNumber": {
"value": "12345"
},
"quantity": {
"value": 5
},
"uom": {
"value": "STK"
},
"expirationDate": {
"value": "2020-08-20T08:47:35.253Z"
}
}
],
"operation": "2",
"lineNbr": {
"value": 1
},
"receiptQty": {
"Value": 16
}
}
]
}
... View more