Wednesday, July 8, 2020

#783 OIC integrating BigCommerce with Netsuite

Big Commerce is a very popular SaaS eCommerce platform, used by many Netsuite customers.
Ergo, integration between the two is necessary and easy with Oracle Integration (OIC).

Welcome to my Hare of the Dog shop on Big Commerce -

I add a couple of top quality products - Hare of the Dog T-Shirts - handmade by medieval philosophy students. The material is 100% recycled and recyclable, and is also edible.

Ok, now that we have something, let's check out the BigCommerce REST apis.

I set the OAuth scopes - Products are not shown in the screenshot below, but suffice to say, I select modify for them.

I save my selection and the following is displayed -

Now it's time for Postman - let's get the Products -

There's my T-Shirt - in all it's pristine glory.

OIC Integration Syncing Products between BigCommerce and Netsuite

Step 1 - Create a REST Connection to Big Commerce

Here I create a REST connection specifying the base url -

I specify API-Key based Security.

I copy my Big Commerce Access Token to the API Key field and
then configure API Key Usage as follows -

-H X-Auth-Token:${api-key}

So that's my token taken care of.
The X-Auth-Client will be passed as a custom header, as you will shortly see.

So here is the basic integration -

A scheduled integration that invokes the Big commerce REST connection to retrieve Products.
Here is the configuration of GetProducts -

I have used the response from my Postman test as the sample json payload above.

All I need to map is the custom header -

The rest of the integration is the usual modus operandi -
For each Product -
check if its pendant InventoryItem exists in Netsuite.
This I do via a GET on InventoryItem -

I check the InventoryItem externalId - key is the BigCommerce Product sku -

and log the result in either case.

Test Result 

Ok, so the basic sanity test worked -

Main use case between Big Commerce and Netsuite is probably order processing.

Again my starting point is Postman -

Now that is disappointing - I google and read that /orders is not yet supported in the v3 REST api.
So I try with v2 -

and there is my T-Shirt order.
Note the response is in xml.

OIC Processing Big Commerce Orders 

I need to define a new REST connection for v2 -

I add the v2 connection - configuring as follows -

Naturally, I could also amend the original REST connection -

Now for a test ... I just included the GetOrders after GetProducts processing -

Imagine such an integration runs daily, then I will only want to pick up the orders created/modified since the last run. I can use the following fields for this -

Another useful field for filtering will be the status field.

Yet another -

The order processing logic could be as follows -

1. Retrieve new/modified orders from Big Commerce 
2. Check status

2.1. If "Awaiting Fulfillment" - customer has paid, but has not yet received the goods
2.1.1. Check if B2B or B2C (if company set, then it is a B2B order) IF B2B - create Sales order in Netsuite If B2C - create Cash Sale in Netsuite

2.2. If "Fulfilled" - customer has received goods (shipped by Big Commerce)
2.2.1. Create ItemFulfillment in Netsuite
We may also need to cater for a "PartiallyFulfilled" order as well.

No comments: