Skip to content
Back to Blog
eCommerce

Mar 17, 2017

UPS and Zenventory | Integration

Integration of UPS and Zenventory. Add The Ease of Shipping With Zenventory. Easily Send Orders From Zenventory to UPS for Package and Shipping.

Stay Up-to-Date

Subscribe to our newsletter to receive updates on new releases, trending topics, and more!

Overview

Yes you can connect UPS Worldship to Zenventory. Why? So you can automate shipping by retrieving ready to ship orders. Once integrated, processing Zenventory orders means simply typing the Zenventory order number in UPS Worldship. Better yet, configure your Zenventory packing slips to display an barcoded order number. That way you’ll only need to scan the order number into UPS Worldship to retrieve the Zenventory order for shipping. UPS Worldship retrieves the ship-to information from Zenventory. UPS Worldship can also post tracking, weight, and service details back to Zenventory. Read the Zenventory API documents at http://help.zenventory.com/article-categories/technical-info/

Customize UPS Worldship With VBScript

UPS Worldship is customized using VBScript. Below I’ll share with you a generic script that connects to Zenventory and retrieves orders ready to ship. Note that this script simply demonstrates connecting to our SOAP web service and only retrieving orders ready to ship. This script will need to be refined to parse the returned XML. This script does not demonstrate how to post orders back, but that is also quite straight forward. The Zenventory web service contains other methods as well.

Here’s an example script:

‘First let’s create  a new service reuest and name it:

Set objSOAP = New ServiceRequest
objSOAP.SetSoapAction(“Test”)

‘Now we’ll make a raw http query to the service to retrieve a session ID. Note that the secure key is generated by Zenventory against a user. So log in to your Zenventory system, go to Admin, and users to generate the key.

objSOAP.sSOAPRequest = “<?xml version=””1.0″” encoding=””utf-8″”?><soap:Envelope xmlns:soap=””http://schemas.xmlsoap.org/soap/envelope/”” xmlns:xsi=””http://www.w3.org/2001/XMLSchema-instance”” xmlns:xsd=””http://www.w3.org/2001/XMLSchema”” xmlns:tns=””http://www.ubiquia.com/service/””>  <soap:Body>    <tns:GetSessionRequest key=””Insert Secure Key Here“”><session/></tns:GetSessionRequest></soap:Body></soap:Envelope>”

objSOAP.SendRequest
sResponse = objSOAP.sResponse

sResponse2 = sResponse

‘Parse the sessionid out of the response
testtextid = InStr(sResponse,”id=”””)
testtextidlength = 26
testtextextra = 4
testtextstart = testtextid + testtextextra
sessionid = Mid(sResponse,testtextstart,testtextidlength)

‘We use the sessionid  from the above response to make the GetShipmentsRequest. Note that according to the Zenventory documentation we need a last checked date.

objSOAP.sSOAPRequest = “<?xml version=””1.0″” encoding=””utf-8″”?> <soap:Envelope xmlns:soap=””http://schemas.xmlsoap.org/soap/envelope/”” xmlns:xsi=””http://www.w3.org/2001/XMLSchema-instance”” xmlns:xsd=””http://www.w3.org/2001/XMLSchema”” xmlns:tns=””http://www.ubiquia.com/service/””>  <soap:Body>     <tns:GetShipmentsRequest LastCheck=””08/07/2016″”>      <session id=”””& sessionid & “””/>    </tns:GetShipmentsRequest>  </soap:Body></soap:Envelope>”
objSOAP.SendRequest
sResponseFinal = objSOAP.sResponse

‘For test purposes we output the orders response to a text file. You can parse the response an update UPS Worldship instead of doing this.

Set objFSO=CreateObject(“Scripting.FileSystemObject”)
outFile=”c:\test\response.txt”
Set objFile = objFSO.CreateTextFile(outFile,True)
objFile.Write sResponseFinal & vbCrLf
objFile.Close

‘Class for sending SOAP 1.2 request

‘———————————————————–
‘You need to run SetSoapAction with the web service name, then set sSOAPRequest. Then run SendRequest
Class ServiceRequest
Private oWinHttp,sContentType
Public sWebServiceURL, sSOAPAction, sSOAPRequest,sResponse,servicename

Private Sub Class_Initialize
Set oWinHttp = CreateObject(“WinHttp.WinHttpRequest.5.1″)

‘Web Service Content Type
sContentType =”application/soap+xml;charset=UTF-8”

End Sub

Public Function SetSoapAction(servicename)
‘Ensure you use the appropriate URL for your Zenventory application
sSoapAction = “https://app.zenventory.com/services/shipwidget.wsdl”
sWebServiceURL = “https://yourURL.zenventory.com/services/shipwidget.php”
End Function

Public Function SendRequest

‘Open HTTP connection
oWinHttp.Open “POST”, sWebServiceURL, False

‘Setting request headers
oWinHttp.setRequestHeader “Content-Type”, sContentType
oWinHttp.setRequestHeader “SOAPAction”, sSOAPAction

‘Send SOAP request
oWinHttp.Send  sSOAPRequest

‘Get XML Response
sResponse = oWinHttp.ResponseText

End Function

Public Function Close
Set oWinHttp = Nothing
End Function

End Class

‘————————————————–

Summary

Note that the above generic VBScript can be also used with many legacy systems such as ProShip, FedEx ShipManager, and many other legacy systems that need to exchange order information and shipping data with Zenventory.

Zenventory

Can Zenventory Help You?

If you think Zenventory is the solution you have been looking for, fill out the below form to talk to someone from our team!

 

Latest Articles

How Shipping Software Changes the Game

Learn why many e-commerce businesses have turned to shipping software to help offset supply chain challenges.

WMS Software: A Beginner's Guide for 3PLs

How does WMS software benefit a fast growing 3PL? Here’s a closer look for warehouse operators on the inner workings and benefits of WMS so...

How to Handle the Amazon Inflation Surcharge

Amazon recently announced the Amazon inflation surcharge – a 5% fee that has FBA sellers concerned. Here’s how to overcome the increased se...