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!

Rookie Asked on August 13, 2024 in SuiteTalk.
Add Comment
2 Answer(s)

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}]}}
 
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}]}}}]}}
 
 
This seems like a bug.  I’ve opened a ticket with NS.
Rookie Answered on August 13, 2024.
Add Comment

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
Rookie Answered on August 15, 2024.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.
  • This site made possible by our sponsors:   Tipalti   Celigo   SuiteMigration   Become a Sponsor