Any idea how to reference an item when transformin...
# suitetalkapi
k
Any idea how to reference an item when transforming from purchaseorder>vendorbill? I've tried:
Copy code
{
  "method": "POST",
  "url": "<https://3997092-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/purchaseorder/2201922/!transform/vendorbill>",
  "headers": {...},
  "body": {
    "tranid": "I-058298",
    "item": {
      "items": [
        {
          "item": "37624",
          "rate": 11,
          "quantity": 1
        }
      ]
    }
  }
}
AND
Copy code
{
  "method": "POST",
  "url": "<https://3997092-sb1.suitetalk.api.netsuite.com/services/rest/record/v1/purchaseorder/2201922/!transform/vendorbill>",
  "headers": {...},
  "body": {
    "tranid": "I-058298",
    "item": {
      "items": [
        {
          "item": {"id": "37624"},
          "rate": 11,
          "quantity": 1
        }
      ]
    }
  }
}
I've tried many variations and only get:
Copy code
{
  "detail": "Error while accessing a resource. Please choose an item to add.",
  "o:errorPath": "item.items[0]",
  "o:errorCode": "USER_ERROR"
}
b
k
setting the replace parameter gives me a 500 error
b
continue through the information about keys
k
Key1, key2 is a little abstract. Do I need item id and line number or something?
b
item id is not unique
it cant be the key
line number isnt really great either, that can change
k
If I look at a PO, it has lineuniquekey
along with a line id
b
working with sublists generally involves guessing the key
a lot of the time its the same as soap keys
k
any idea why ?replace=item would throw a 500? The documentation on !transform says to use POST, so I don't think it will support PATCH
lineuniquekey gives the same "item not found" if I remove the replace flag
internalId and line give the same result
b
there is no point doing a transform if you are replacing all the items
what is the key for soap
k
I'm partially billed for purchase orders as they are fulfilled.
The key for soap seems to be orderLine or line, neither of these work
Adding order line gives me a 500
b
you may just want to manually create the vendorbill without transforming
you should hopefully be able to link the two by setting the orderLine and orderDoc fields on the item
else you need to go into the body of the response for those failures, the status code by itself isnt very helpful
k
Ok, I may pursue this as a work around and file a support ticket to see if they can clarify billing in the transform step. At scale, one step would be better. Thanks for all you help!