UPS Rate integration is provided with licensing of the CyberStore UPS Shipping Add-On Module.
Rate queries are performed by CyberStore to the UPS public API using properly formatted XML-based strings. Standard query syntax is hard-coded
into the CyberStore business logic, however, should an implementation require it, the Rate API XML template can be overridden with a custom XML file.
Within the sample XML provided there will be several replacement strings that substitute variable values in context during processing. The following table provides a legend to what these tags are and what their expected values are.
| Replacement | Value |
|---|---|
| {0} | AccessNumber |
| {1} | UserId |
| {2} | Password |
| {3} | FromStreet1 |
| {4} | FromStreet2 |
| {5} | FromStreet3 |
| {6} | FromCity |
| {7} | FromState |
| {8} | FromPostalCode |
| {9} | FromCountry |
| {10} | ToStreet1 |
| {11} | ToStreet2 |
| {12} | ToStreet3 |
| {13} | ToCity |
| {14} | ToState |
| {15} | ToPostalCode |
| {16} | ToCountry |
| {17} | ShippingCode |
| {18} | Weight |
| {19} | ProviderUOMCode |
| {20} | PackagingCode |
To customize the XML, copy the contents of the sample code provided below into a file called UPSRateQuery.XML, make any modifications desired and then save the file to your Site/XML folder in your instance of CyberStore. When present, the system will automatically detect the custom string and submit it instead of the default. To remove a customization and restore default processing, simply rename or delete the UPSRateQuery.XML file from the Site/XML folder.
| UPSRateQuery.xml |
Copy Code
|
|---|---|
<?xml version=""1.0"" ?> <AccessRequest xml:lang='en-US'> <AccessLicenseNumber> {0} </AccessLicenseNumber> <UserId> {1} </UserId> <Password> {2} </Password> </AccessRequest> <?xml version=""1.0"" ?> <RatingServiceSelectionRequest> <Request> <TransactionReference> <CustomerContext>Rating and Service</CustomerContext> <XpciVersion>1.0</XpciVersion> </TransactionReference> <RequestAction>Rate</RequestAction> <RequestOption>Rate</RequestOption> </Request> <Shipment> <Shipper> <Address> <AddressLine1>{3}</AddressLine1> <AddressLine2>{4}</AddressLine2> <AddressLine3>{5}</AddressLine3> <City>{6}</City> <StateProvinceCode>{7}</StateProvinceCode> <PostalCode>{8}</PostalCode> <CountryCode>{9}</CountryCode> </Address> </Shipper> <ShipTo> <Address> <AddressLine1>{10}</AddressLine1> <AddressLine2>{11}</AddressLine2> <AddressLine3>{12}</AddressLine3> <City>{13}</City> <StateProvinceCode>{14}</StateProvinceCode> <PostalCode>{15}</PostalCode> <CountryCode>{16}</CountryCode> </Address> </ShipTo> <ShipFrom> <Address> <AddressLine1>{3}</AddressLine1> <AddressLine2>{4}</AddressLine2> <AddressLine3>{5}</AddressLine3> <City>{6}</City> <StateProvinceCode>{7}</StateProvinceCode> <PostalCode>{8}</PostalCode> <CountryCode>{9}</CountryCode> </Address> </ShipFrom> <Service><Code>{17}</Code></Service> <Package> <PackagingType> <Code>{20}</Code> </PackagingType> <PackageWeight> <UnitOfMeasurement> <Code>{19}</Code> </UnitOfMeasurement> <Weight>{18}</Weight> </PackageWeight> </Package> <ShipmentServiceOptions /> </Shipment> </RatingServiceSelectionRequest> |
|