netsuitenetsuite-rest-api

Netsuite Rest Api: Item Fulfillment


I'm currently trying to fulfill an item from a Transfer Order via the Netsuite Rest Api, without any luck.

My intention is fulfill a quantity of 1 for a specific line/item id. This will need to update the status of the Transfer Order to partially fulfilled. Once I've fulfilled all items on the transfer order, I intend to create an item receipt for each item and update the status of the Transfer Order to "Received". I cannot get to these steps unless I can create the item fulfillment first.

They provide the following sample payload in their docs but it is incorrect:

{ "item":{ "items":[ { "orderLine":1, "location":6, "itemreceive": true } { "orderLine": 3 "location": 6, "itemreceive": false } ] }
}

using the following url:

POST https://<accountID>/services/rest/record/v1/salesorder/{{SALES_ORDER_ID}}/!transform/itemFulfillment

I understand that the above sample payload is intended for use with a Sales Order, but from my understanding it should work in a similar fashion for a Transfer Order

I've tried multiple payloads, including the following:

{
    "item": {
        "items": [
            {
                "itemreceive": true,
                "orderLine": 1,
                "quantity": 1
            }
        ]
    },
    "shipstatus": "C"
}

and using the following url:

POST https://<accountID>/services/rest/record/v1/transferorder/{{TRANSFER_ORDER_ID}}/!transform/itemFulfillment

On all attempts thus far, I receive the following error:

{
    "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"
        }
    ]
}

Any help would be greatly appreciated!


Solution

  • Try this URL: /transferOrder/<tfoID>/!transform/itemFulfillment and this body:

    {
      "item": {
        "items": [
          {
            "orderLine": 2,
            "quantity": 7
          }
        ]
      }
    }
    

    You seem to have already done what I have posted above.

    Finally, set 'Default Items to Zero Received/Fulfilled' to true under Setup > Accounting > Accounting Preferences > Order Management. This last part is the kicker.