Monday, May 3, 2021

#848 OIC May 21 Release - B2B support for UN EDIFACT Part 2

 This post covers the creation of the "missing" backend integration from the previous post.

I discussed the auto-generation of the send/receive integrations in the previous post. What I now need to do is create a backend integration for processing my EDFACT Order. That integration will create a Sales Order in Netsuite. It will then be called from the scope below.


 





Create the Backend Integration 

To recap, the "receive" integration has done the formal AS2 and EDIFACT checks - nothing else. 
The backend integration will do the actual fetch/translate of the document so that OIC can process it further. The basic backend integration flow is as follows - 


 


As you can see from above - REST trigger which then loops over the EDI messages - 

For each message - take the b2b reference passed in the request payload and fetch the b2b doc. Finally. I just log the sender / receiver fields of the doc.

So now to the implementation details - The REST API Request payload is as follows - 

{
  "type" : "MSG",
  "id" : "1",
  "direction" : "INBOUND",
  "trading-partner" : "AA-CommiskeyWindsbach",
  "document-definition" : "AAEDIFACT96AORDER",
  "connectivity-properties-code" : "AA-AS2-Commiskey_AS2_RECEIVE",
  "connectivity-properties-version" : "01.00.0000",
  "message" : [ {
    "b2b-message-reference" : "biz:0AC400D117503A8246000000347849EB"
  }, {
    "b2b-message-reference" : "biz:0AC400D117503A8246000000347849EB"
  } ]
}

The Response payload - 
{"status": "success"}

The FOR EACH configuration - 













The TranslateIncomingOrder configuration - 




















The Map configuration - 








The Log configuration - 



 





















One can, of course, access the xml representation of the D96A Order document - 


 













So let's log the salient order details - how about product, quantity and unit price?

Back in EDIFACT land - 

IMD+F++:::Hare of the Dog T-Shirt'
QTY+ 52:10:EA'
PRI+AAA:98.20::NTP:1:EA'

I open the IMD node - 




















So which of these holds the product description?
Here I can take a look again at the EDIFACT documentation for D96A -















I can also refer to the Activity Stream from my previous test - 


















The order was for 10 t-shirts - QTY - C186-02

The price, expensive, but well worth it - €98.20, considering these t-shirts are hand made by Nietzschean philosophy students in Weimar.











C509-02

I log these values - and re-test -
















The final step - how to create a Sales Order in Netsuite ...
Give me a couple of minutes to implement this.














No comments: