RE: Error creating partial receipt of PO using REST API
I have a PO with one line (qty: 100). I’m able to create a receipt for the full quantity:
POST services/rest/record/v1/purchaseOrder/xxx/!transform/itemReceipt {
"tranDate": "2024-08-12"}
But I get an error when attempting to create a partial receipt:
POST services/rest/record/v1/purchaseOrder/7150513/!transform/itemReceipt' {
"tranDate": "2024-08-12",
"item": {
"items": [{
"orderLine": 1,
"itemReceive": true,
"quantity": 10,
"inventorydetail": {
"inventoryassignment": {
"items": [{
"binnumber": 9,
"quantity": 10}]}}}]}}
{"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. The total inventory detail quantity must be 10.","o:errorPath":"item.items[?(@.orderLine==1)]","o:errorCode":"USER_ERROR"}]}
I found this example in NS help. That does not specify quantity on the line level — I tried the same, but get a different error that expects the full quantity (100).
{"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. The total inventory detail quantity must be 100.","o:errorPath":"item.items[?(@.orderLine==1)]","o:errorCode":"USER_ERROR"}]}
Thanks for any pointers!
To wrap this up, here’s how we got this working:
- set a default bin for all items (if not, just include inventory detail as noted earlier)
- in the POST entity, include an item for each open line that’s not yet fully received
- do not include an item for any closed/fully-received line (that causes an error)
- line to receive on: {“orderLine”: 1, “quantity”: 10}
- line to skip: {“orderLine”: 1, “itemReceive”: false}
- use the API to get the PO to find the orderLines — they don’t necessarily match “line number” shown in the UI