Skip to end of banner
Go to start of banner

Creating B2B Transaction -- Invoice Use Case

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 16 Next »

On this page

The Challenge

Creating an invoice when a sales order is fulfilled requires that you create the invoice in your ERP system and then manually upload/enter it into the EDI gateway. This is mostly a manual process which utilizes a lot of time. In addition to that, it is a challenge to handle errors and any changes in the expected schema. 

SnapLogic's B2B solution helps you setup a Pipeline that handles the invoice creation aspect. This use case demonstrates how you can leverage SnapLogic to create invoices for multiple fulfilled sales orders in NetSuite and then send these invoices to the EDI gateway's SFTP site. 

The Solution

The following Pipeline, when executed, creates an invoice for every fulfilled order in Netsuite and sends the invoice to the EDI gateway. 

This Pipeline utilizes an expression library called helpers. You will need to download this expression library to execute this Pipeline correctly. Download the Pipeline and the expression library from the Downloads section below.

This Pipeline performs the following tasks:

Task1: Reading and Mapping the NetSuite Sales Order

In the use case Creating B2B Transaction -- Sales Order Use Case we wrote the sales order created by NetSuite into a file in the SnapLogic Database (SLDB). We now read this file to retrieve all the sales order data by using the File Reader Snap labelled Read Result. This data is then parsed and sent to the Mapper Snap labelled Get SO Mapper. This Snap is configured to retrieve the Internal ID for each sales order.

The base reference type, salesOrder, and the Internal IDs are sent to the NetSuite Get Snap labelled Get Sales Order.

This enables us to retrieve the order's current state. 

Task 2: Creating Item Fulfillment

Item fulfillment in any business case is a manual process. A sales order is deemed fulfilled only after the merchandise/product/service has been shipped for delivery. In our use case, we simulate that process by marking the sales orders as fulfilled or "_shipped". This part is carried out by the Snaps labelled Root Mapper, Item Mapper, and Create Item Fulfillment. All these Snaps work together to provide the Internal ID.

The output from the Root Mapper Snap is passed to the NetSuite Create Snap labelled Create Invoice where the invoices are created.

Task 3: Creating and Processing the Invoice

The NetSuite Create Snap, Create Invoice, is configured to create invoice based on the Internal ID it receives.

From the above output we retrieve only the base reference, type, and Internal ID using the Mapper Snap, Get Invoice Mapper.

We do this since the base reference and Internal ID are all we need to retrieve the invoice's details from NetSuite using the NetSuite Get Snap labelled Get Invoice. This Snap retrieves the invoice's details. From these details we retrieve the Control ID using the Mapper Snap labelled Invoice Mapper.

At this juncture, we have all the information we need from NetSuite to communicate to the EDI gateway that the sales order sent from it has been fulfilled. To do so, we perform two operations:

  • Send the invoice to the EDI gateway
  • Create a local record of the invoice

Sending invoice to the EDI gateway

The invoice data is formatted as a JSON and written into the EDI gateway's Out sub-directory using a File Writer Snap. This establishes a communication between the ERP system and the EDI gateway. 

Creating a local record of the invoice

The invoice data is formatted as a JSON and written into the SLDB. You can write a SnapLogic expression to use the invoice ID and Control ID in the filename to keep it unique and identifiable.

Try it Out

  1. Download the Solution Pipeline and  Expression Library

  2. Login to SnapLogic and click the  button in SnapLogic Designer.

  3. Select the Pipeline from your local Drive.

  4. Edit the Pipeline's details such as Label.


  5. Import the expression library in the Expression Libraries section.



  6. Click Save.

  7. Configure the accounts in the Snaps as appropriate.

  8. Validate and execute the Pipeline.

Downloads

  File Modified
You are not logged in. Any changes you make will be marked as anonymous. You may want to Log In if you already have an account.
No files shared here yet.
  • Drag and drop to upload or browse for files
    • No labels