When attempting to update an itemreceipt via REST ...
# ask-stanley-ai
g
When attempting to update an itemreceipt via REST i keep getting the following response:
Copy code
{
  "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. You have attempted an invalid sublist or line item operation. You are either trying to access a field on a non-existent line or you are trying to add or remove lines from a static sublist.",
      "o:errorPath": "item",
      "o:errorCode": "USER_ERROR"
    }
  ]
}
My Payload is:
Copy code
{
  "item": {
    "items": [
      {
        "orderLine": 1,
        "location": 3
      },
      {
        "orderLine": 2,
        "location": 3
      }
    ]
  }
}
doing PATCH /itemReceipt/{receiptID}
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the issue you're encountering is related to the way you're referencing the line items in your payload. In the context of transforming a purchase order to an item receipt via the REST API, you should use the
orderLine
field to reference the line items, not the
line
field. The
orderLine
field corresponds to the line number on the original transaction (in this case, the purchase order). The line numbers start from 1, not 0. Here's an example of how your payload should look like:
Copy code
json
{
    "item":{
       "items":[
          {
            "orderLine": 1,
            "itemreceive": true,
            "location": 6
          },
          {
            "orderLine": 2,
            "itemreceive": true,
            "location": 6
          }
       ]
    },
    "shipStatus": {
        "id": "C"
    }
}
Please note that the
itemreceive
field is set to
true
for each line item that you want to receive. Also, the
location
field is set to the internal ID of the location where the items are to be received. ****** Disclaimer: This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes. ******
Slack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.897579551
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.888308585
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.884887874
Please provide your feedback on this answer.
g
This looks to be for fulfilment, not itemReceipt ?