Netsuite – Repairdesk Integration – Proposal

Requirement:

Need to implement integration between NetSuite and Repair desk to automatically create purchase order in Repair desk for the sales order in NetSuite.

Solution:

We will develop 3 Restlet scripts to provide the Repair Desk team with the custom API endpoints for customer authentication, PO creation and inventory creation in Repair Desk. 

Customer Authentication: 

  • We will create an Get endpoint for customer authentication. 
  • When a customer login to the Repair Desk using their email address and password, the repair desk will be passing the user credentials to us in a payload. (Email and password) 
  • Once we receive this request with user credentials, we will search for a customer record in NetSuite having the email address the repair desk passed. 
  • If the customer with this email id exists in NetSuite, we will send RD a success message and the customers internal ID as response. The success code will be 200. 
  • If the customer does not exist, we will send them an error response. The error code will be 400. 
  • We will be developing a Restlet for implementing the above-described functionality. 
  • So, when a user tries to login to RD, they will call our Restlet endpoint and our Restlet will provide them the customers internal id back if the customer exists. In this way RD can identify if the customer is an authorized one or not. 

Purchase Order Creation: 

  • We will create an Get endpoint for PO creation in Repair Desk. 
  • When a customer enters the sales order id (Sales order document document number) of an order they created on Balaji’s website into Repair Desk, Repair Desk will send the ID to us. Using this sales order ID, we will identify the corresponding sales order record, and the details of the order will be sent back to Repair Desk as a response. 
  • To accomplish this, we will create our second Restlet script. Repair Desk can call this endpoint, and we will retrieve the data from the sales order and provide it as a response. 
  • So, when a customer enters the sales order document number in Repair Desk, they will send us a request with the sales order document number using the Restlet API endpoint we provide them. 
  • When our Restlet script get the requets, it will fetch all the order-level, customer-level and item-level details of the sales order and send these details as a JSON structure back to RD as response to their request call. 
  • They can create the Purchase order in RD using the Netsuite order details. 

Challenges: 

  • This will not be a real-time procedure. There is a concurrency issue with Restlet, that’s only 5 requests can be made to this rest API at a time, the 6th request will not be considered.  
  • So, RD will schedule their requests for PO sync based on this limitation. 
  • We will create a custom checkbox in sales order records to mark the sales orders for which a purchase order is created in RD. 

Payload for fetching the Order details from NetSuite: 

         “customer_id”: “3251”, 

         “customer_token”: “564342” (Customer Token), 
            “order_id”: “2001”  (Netsuite document number) 

Item Creation: 

  • This integration from NetSuite to repair desk.  
  • We will create an API endpoint for fetching the inventory (items) details from NetSuite. When the RD team calls this endpoint, we will provide the data as paginated, every page contains 50 item details. 
  • RD will schedule the item sync to fetch the item data from NetSuite once every week. 
  • We will be sending the items to RD batch wise. When we get request from Repair Desk. 
  • Item details that will be shared with RD: 
Data Required NetSuite Field Data Type 
SKU ITEM NAME/NUMBER String 
UPC UPC CODE String 
Itemid ITEM INTERNAL ID String 
Category DISTRIBUTION CATEGORY String 
Vendor VENDOR / VENDOR AUTO PO String 
Manufacturer MANUFACTURER String 
Name DISPLAY NAME/CODE String 
Producttype ITEM TYPE String 
Baseimage IMAGE 1 String 
Shortdescription SALES DESCRIPTION String 
Urlkey ITEM URL String 

Assumptions 

  • We will be sending a success response to the Customer Authentication request only if a customer with the email id they provided exists in NetSuite. 
  • The Repair Desk team must provide the NetSuite’s Sales order document number/sales order internal id in the API request. Then only we can identify sales orders in NetSuite. 
  • We will consider only the PO creation in repair desk, not the PO update and delete. 
  • PO sync will not be a real-time procedure. There is a concurrency issue with Restlet, that’s only 5 requests can be made to this rest API at a time, the 6th request will not be considered. So, RD will schedule their requests for PO sync based on this limitation. 
  • Item sync will be a scheduled procedure. The RD team will use our endpoint for getting inventory  
  • As of now, for Item sync, we only consider the item creation in Repair desk. If the item is updated in NetSuite, we will not update the change in Repair desk item. 

Leave a comment

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