i am trying to transform a purchase order into an ...
# ask-stanley-ai
m
i am trying to transform a purchase order into an item receipt. When i pass in this data for the line items item: { items: [ { orderLine: 62, inventoryDetail: { quantity: 42, inventoryAssignment: { items: [ { quantity: 42, receiptInventoryNumber: "v_2.4", }, ], }, }, }] I get this error: "Error while accessing a resource. The total inventory detail quantity must be 42." Why?
c
AI generated answer (using internal Slack threads):
Based on the conversations, it seems like the error "The total inventory detail quantity must be 42" is occurring because the total quantity specified in the
inventoryDetail
section of your payload does not match the total quantity of the line items in the purchase order. In the payload you provided, you have specified a quantity of 42 for the
inventoryDetail
. However, the error message suggests that the total quantity of the line items in the purchase order is not matching this number. Here's a possible solution: Ensure that the total quantity specified in the
inventoryDetail
section matches the total quantity of the line items in the purchase order. If you have multiple line items, you need to ensure that the sum of the quantities of all line items equals the quantity specified in the
inventoryDetail
. Here's an example of how you might structure your payload:
Copy code
json
{
  "item": {
    "items": [
      {
        "orderLine": 62,
        "inventoryDetail": {
          "quantity": 42,
          "inventoryAssignment": {
            "items": [
              {
                "quantity": 21,
                "receiptInventoryNumber": "v_2.4",
              },
              {
                "quantity": 21,
                "receiptInventoryNumber": "v_2.5",
              }
            ],
          },
        },
      }
    ]
  }
}
In this example, the total quantity specified in the
inventoryDetail
section is 42, which matches the total quantity of the line items in the purchase order (21 + 21). ****** 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.878202915
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865704954
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.85631448
Please provide your feedback on this answer.