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!
Seems that “inventorydetail” is not applied if the item has a default bin in the PO location.
For example, when the item has a default bin, then the following works:
POST services/rest/record/v1/purchaseOrder/7150513/!transform/itemReceipt {
“tranDate”: “2024-08-12”,
“item”: {
“items”: [{
“orderLine”: 1,
“quantity”: 10}]}}
“tranDate”: “2024-08-12”,
“item”: {
“items”: [{
“orderLine”: 1,
“quantity”: 10}]}}
However if the item does not have a default bin, then specifying inventorydetail works:
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}]}}}]}}
“tranDate”: “2024-08-12”,
“item”: {
“items”: [{
“orderLine”: 1,
“itemReceive”: true,
“quantity”: 10,
“inventorydetail”: {
“inventoryassignment”: {
“items”: [{
“binnumber”: 9,
“quantity”: 10}]}}}]}}
This seems like a bug. I’ve opened a ticket with NS.