Description
We’re in the process of getting setup with a punchout and EDI provider Punchout2Go, and need to set up an integration to receive order files into Netsuite and create a sales order.
Solution
Proposal summary
This proposal describes the process of creating Sales orders in Netsuite by receiving order files from EDI Provider Punchout2Go by setting an integration.
Requirement
Blueleaf needs to setup with a punchout and EDI provider Punchout2Go, and need to set up an integration to receive order files into Netsuite and create a sales order.
We have given a sample payload which is transmitted to us by Punchout2Go and we can use it for creating Sales order in Netsuite.
Payload- Sample
{
“punchout_session”: “”,
“mode”: “test”,
“header”: {
“from_domain”: “NetworkID”,
“from_identity”: “2362”,
“to_domain”: “DUNS”,
“to_identity”: “2362”,
“shared_secret”: “secretive”,
“po_payload_id”: “200308221150.1061578208432.5888140454604746680@punchout2go.com”,
“po_order_id”: “RPO-11887”,
“po_order_date”: “2022-02-14T16:55:50+00:00”,
“po_order_type”: “new”,
“requested_delivery_date”: “”,
“payment_term”: “”,
“payment_term_days”: “”,
“order_request_id”: “9523478”
},
“details”: {
“currency”: “GBP”,
“total”: “27.54”,
“shipping”: “0”,
“shipping_title”: “”,
“tax”: “0”,
“tax_title”: “”,
“discount”: “”,
“discount_title”: “”,
“ship_to”: {
“address_id”: “Main”,
“address_name”: “Main Office”,
“address_code”: “”,
“deliverto”: “Rebecca Anderson”,
“street”: “3445 Seminole Trail #218”,
“city”: “Charlottesville”,
“state”: “VA”,
“postalcode”: “22911”,
“country”: “United States”,
“country_code”: “US”,
“email”: “rebecca.anderson@punchout2go.com”,
“telephone”: “7572718293”
},
“bill_to”: {
“address_id”: “Main”,
“address_name”: “Main Office”,
“address_code”: “”,
“deliverto”: “Rebecca Anderson”,
“street”: “3445 Seminole Trail #218”,
“city”: “Charlottesville”,
“state”: “VA”,
“postalcode”: “22911”,
“country”: “United States”,
“country_code”: “US”,
“email”: “rebecca.anderson@punchout2go.com”,
“telephone”: “7572718293”
},
“contact”: {
“name”: “Rebecca Anderson”,
“address_name”: “”,
“deliverto”: “”,
“street”: “”,
“city”: “”,
“state”: “”,
“postalcode”: “”,
“country”: “”,
“country_code”: “”,
“email”: “rebecca.anderson@punchout2go.com”,
“phone”: “757-2718293”
}
},
“items”: [
{
“line_number”: “1”,
“requested_delivery_date”: “”,
“quantity”: “1”,
“supplier_id”: “TW907149”,
“supplier_aux_id”: “TW907149”,
“unitprice”: “22.95”,
“currency”: “GBP”,
“description”: “Bath Sheet – Charcoal x 2”,
“uom”: “Each”,
“comments”: “”
}
]
}
Our Solution
The requirement can be achieved by creating a RESTLET script where Punchout can pass the payload that contains the order details and OAuth 1.0, then it will create the Sales Order in Netsuite.
Integration Field Mapping
- Under Shipping tab, while we add the shipping address we will select it from the SHIP TO SELECT (field Id: shipaddresslist) drop down field if the payload address_id match with any shipaddresslist. Otherwise we will create a new address with the provided details such as address_name, deliverto, street, state, country etc.
- Under Billing tab, while we add the billing address we will select it from the BILL TO SELECT (field Id: billaddresslist) drop down field if the payload address_id match with any billaddresslist. Otherwise we will create a new address with the provided details such as address_name, deliverto, street, state, country etc.
- We will add the contact, if the name in the payload matches with the contact field. Otherwise we will not map it.
- While adding items to the Sales Order, if the supplier_id matches with the item line, we will add it. Otherwise will create a new item with the provided details.
| PAYLOAD FIELD | NETSUITE FIELD |
| mode | memo |
| po_order_id | tranid |
| po_order_date | trandate |
| requested_delivery_date | custbody_rpod_delivery_date |
| payment_term | term |
| order_request_id | custbody_siteorderid |
| currency | currency |
| shipping | shippingcost |
| shipping_title | shipmethod |
| tax | taxcode (it came from taxcode_display and can’t edit) |
| tax_title | taxcode_display |
| discount | discountrate |
| discount_title | discountitem |
| Ship Address : address_id | shipaddresslist |
| address_name | addressee |
| deliverto | entity |
| street | addr1 |
| city | city |
| state | state |
| postalcode | zip |
| country | country |
| Matching field not available in Netsuite | |
| telephone | Matching field not available in Netsuite |
| Contact : name | contact |
| Bill Address : address_id | billaddresslist |
| address_name | addressee |
| deliverto | entity |
| street | addr1 |
| city | city |
| state | state |
| postalcode | zip |
| country | country |
| Matching field not available in Netsuite | |
| telephone | Matching field not available in Netsuite |
| Item : requested_delivery_date | custcol_shipdate |
| quantity | quantity |
| supplier_id | item |
| unitprice | rate |
| uom | units_display |
| description | description |
Assumptions
- We are assuming that the third party (Punchout2Go) will initiate the sync to get the order details(payload).
- Punchout2Go is using OAuth 1.0 which will support the RESTLET integration.
- The sales order will be created only if the given payload match with the Netsuite data(Specially the drop down values in Netsuite).
- We will eliminate the duplication in Sales Order creation by mapping the “Order Request ID” in payload with the “Site Order ID” in Netsuite Sales Order record.
- We will proceed with the sales orders only if the items specified in payload are already available in Netsuite. The item can be fetched using the “supplier_id” in the payload and is mapped with “Item Id” in Netsuite.
- If the items section is missing in the payload or corresponding item is not available in Netsuite, then we should show a response “Item Not Found”.
- We can access the customer from the billing or shipping details of the Payload. If we can’t access such a customer, we need to create a custom one with the specified details provided in the payload.
- Posting of Payload data and the Authentication code will be handled by the Punchout2Go.
Risk
- If Puchout2Go doesn’t provide the payload, we can’t do the integration setup
- If the client is not using OAuth 1.0, we can’t setup Restlet integration.
- If the item is not in Netsuite, we can’t create Sales order.
Time hours
| Task (Sandbox & Production) | Time |
| RESTlet script | 32 hours |