Proposal for the Creation of Assembly item and BOM in NetSuite through Restlet

Creation of Assembly item and BOM in NetSuite through Restlet 

Proposal summary 

Creates and view Assembly item and Bill of Materials in NetSuite through Restlet call. 

Requirement  

I need to have a restlet service created that would allow me to have an assembly item created And BOM created. And also restlets that would allow me to read the assembly item and bom 

Our Solution 

To view the records – GET API 

During the call of GET Api we will also share another RESTLET URL. You will be getting the details of item components and send it as a JSON structure. 

If NetSuite contains 10,000 items, we cannot make them to send as a whole. In such cases we will limit the results to 100 per page. We will always send the number of items in the first page if the current page is not specified in GET request. 

GET – Get item list – HTTP Response Code: 200

    HTTP/1.1 200 
    Pagination-Count: 1000 
    Pagination-Page: 10 
    Pagination-Limit: 100 

    Content-Type: application/json 
     
    [ 
      { 
        “id”: 10, 
        “name”: “shirt”, 
        “color”: “red”, 
        “price”: “$123” 
      }, 
      { 
        “id”: 11, 
        “name”: “coat”, 
        “color”: “black”, 
        “price”: “$2300” 
      } 
    ] 

  • In the next request you could specify the page number so that we can send the item list in corresponding page. 
  • If you specify the internal ID of assembly item, we can list out only the assembly item and its components. Like we can filter out the results in such a way that components and assembly item will only list. If the ID not specified in the GET request, we will send component items only.  

GET – HTTP Response Code: 404 

In case of any error during processing of item ID you will be notified with an error message. 

Sample error message: 

    HTTP/1.1 404 
    Content-Type: application/json 
 
    { 
      “message”: “The item does not exist” 
    } 

To create Assembly item and BOM – POST API 

We assume that a third-party application calls the Restlet to create assembly item & BOM in NetSuite. We will create a Restlet in NetSuite and will share the credentials and URL to you and also, will provide a basic JSON structure with mandatory fields of creating the records in NetSuite. Hope using all these details you can configure external application and send request to NetSuite. After analysing the request, we create the record in NetSuite based on the type request.  

  • The POST request must include the list of components of Assembly item to create. 
  • One POST API is for one individual item and its bill of materials. 
  • The basic details must include in the payload. 
  • If the request is for creating the Assembly item, fetches the details from request body and create the item record. Fetches the details of assembly item components from the request body, then creates BOM. 
  • We will consider the mandatory account settings regarding item creation.  
  • This API works only for the creation the Assembly and BOM not updating the same 

POST – Create a new item – HTTP Response Code: 201 

Sample response code: 

    HTTP/1.1 201 
    id: 12 
    Content-Type: application/json 
 
    { 
      “message”: “The item was created successfully” 
    } 

After the successful creation of records, we will send response with unique ID (internal ID of the record in NetSuite). Which is unique identifier for each record. This can be saved in the application for future references. 

POST – HTTP Response Code: 400 

HTTP/1.1 400 
Content-Type: application/json 
     
    { 
        “message”: “Validation errors in your request”, /* skip or optional error message */ 
        “errors”: [ 
            { 
                “message”: “Oops! The value is invalid”, 
                “code”: 34, 
                “field”: ” ” 
            }, 
            { 
                “message”: “Oops! The format is not correct”, 
                “code”: 35, 
                “field”: ” ” 
            } 
        ] 
    } 

Notes 

  • Now the POST API supports only the creation of the Assembly and BOM. The update and delete also can be include but will take an extra time than total estimate. 
  • The values necessary for creating an item must be included with POST request. 

Assumptions 

Proposal is prepared based on following assumptions: 

  • One create API is for creating one item at a time. 
  • We will share the credentials and RESTLET URL with you. 
  • Also we will share basic JSON structure for each request with mandatory fields.  

Budget and Time 

42h

Leave a comment

Your email address will not be published. Required fields are marked *