El2getfrService

El2getfrService.asmx

This web service provides methods for calculating freight amounts based on Elliott freight calculation logic. It allows  you to quote freight amounts to your customers on the website if the freight policy is not straightforward. It replaces the old web service EligetfrService, which is still available for backward compatibility.

GetFrtByOrder

By providing an order number, this method returns the order’s freight amount, ship-via code and description, total sales amount, and weight.

Usage:

GetFrtByOrderResult = A.GetFrtByOrder(UserName, UserPassword, int OrderNo, ExtraInput)

Parameters UserID, Password and ExtraInput are not used at this moment.

 

Input Parameter

Parameter

Length

Type

Detail

OrderNo

6

Integer

Required. This is the order number to get freight amount.

 

GetFrtByOrderResult Structure

Property Name

Type

Detail

ReturnCode

Integer

Zero means OK; for other return codes, please see the “El2getfrService Return Code” section.

ReturnMsg

String

This is a description of the return code. For example, if return code is zero, you can expect “OK” in this field.

ShipViaDesc

String

The order’s ship via description.

FreightAmount

Double

The order’s freight amount.

TotalSaleAmount

Double

The order’s total sales amount.

Weight

String

The order’s total weight.

ShipViaNo

String

The order’s ship via code.

ExtraOutput

String

Not used for now.

 

Code Example (VB)

The following sample codes will get the freight amount for order number 123456.

 

Dim Service As New webServicesgetfr.El2getfrService

Dim Result As New webServicesgetfr.GetFrtByOrderResult

Result = Service.GetFrtByOrder(“”,“”,123456,“”)

If Result.ReturnCode = 0 Then

  lblFreight.Text = Result.FreightAmount.ToString

Else

  lblFreight.Text = Result.ReturnMsg

  lblErrorFlag.Text = Result.ReturnCode.ToString

End If

 

GetFrtByCusAndItem

By providing customer number and item number, return correspoding freight amount, ship-via code and description, total sales amount, and weight.

Usage:

GetFrtByCusAndItemResult = A.GetFrtByCusAndItem(UserName, UserPassword, CustomerNo, ItemNo, Quantity, TotalSaleAmount, ShipViaCode, ShipTo, City, State, ZipCode, Country, TermsCode, ExtraInput)

Parameters UserID, Password and ExtraInput are not used at this moment.

 

Input Parameters

Parameter

Length

Type

Upper

Detail

CustomerNo

6

String

Y

Required

ItemNo

15

String

Y

Required. System will look up the item weight based on ItemNo.

Quantity

9.3

Double

 

Zero will be converted to one automatically.

TotalSaleAmount

7.2

Double

 

Total sales amount. If freight is calculated based on sales amount, it is obvious that you need to pass this information correctly. If freight is caculated based on weight, this information is also important for calculating insurance amount. It is important to pass the TotalSaleAmount.

ShipViaCode

2

String

Y

Default to customer’s ship-via code.

ShipTo

2

String

Y

Default to customer’s ship-to.

City

15

String

Y

Default to customer’s city.

State

2

String

Y

Default to customer’s state.

ZipCode

10

String

Y

Default to customer’s zip code.

Country

20

String

Y

Default to customer’s country.

TermsCode

2

String

Y

Default to customer’s terms code. COD terms code may add additional charges to the freight amount.

 

GetFrtByCusAndItemResult Structure

Property Name

Type

Detail

ReturnCode

Integer

Zero means OK; for other return codes, please see “El2getfrService Return Code” section.

ReturnMsg

String

This is description of return code. For example, if return code is zero, you can expect “OK” in this field.

ShipViaDesc

String

 

FreightAmount

Double

 

TotalSaleAmount

Double

The value here will be the same as input TotalSaleAmount.

Weight

String

This is the item weight * quantity.

ShipViaNo

String

 

ExtraOutput

String

Not used for now.

 

Code Example (VB)

The following sample codes will get the freight amount for customer number “000001” and item number “049.”

 

Dim Service As New webServicesgetfr.El2getfrService

Dim Result As New webServicesgetfr.GetFrtByCusAndItemResult

Dim CustomerNo As String = “000001”

Dim ItemNo As String = “049”

Result = Service.GetFrtByCusAndItem(“”, “”, CustomerNo, ItemNo, 0, 0, “”, “”, “”, “”, “”, “”, “”, “”)

If Result.ReturnCode = 0 Then

  lblFreight.Text = Result.FreightAmount.ToString

Else

  lblFreight.Text = Result.ReturnMsg

  lblErrorFlag.Text = Result.ReturnCode.ToString

End If

 

GetFrtByCusAndWeightOrAmt

This method returns freight amount by providing customer number and total weight/total sales amount. The freight calculation can be by either weight or sales amount depending on the setup of ship-via code. If the ship-via’s freight calculation method is “A” (amount), you should provide TotalSaleAmount in input. Otherwise, you should provide TotalWeight in input. If you are not sure, you should provide both TotalWeight and TotalSaleAmount.

Usage:

GetFrtByCusAndWeightOrAmtResult = A.GetFrtByCusAndItem(UserName, UserPassword, CustomerNo, TotalWeight, TotalSaleAmount, ShipViaCode, ShipTo, City, State, ZipCode, Country, TermsCode, ExtraInput)

Parameters UserID, Password and ExtraInput are not used at this moment.

 

Input Parameters

Parameter

Length

Type

Upper

Detail

CustomerNo

6

String

Y

Required.

TotalWeight

7.2

Double

 

Required if ship-via’s freight calculation method is NOT “A” (amount).

TotalSaleAmount

7.2

Double

 

Required if ship-via’s freight calculation method is “A” (amount).

ShipViaCode

2

String

Y

Default to customer’s ship-via code.

ShipTo

2

String

Y

Default to customer’s ship-to.

City

15

String

Y

Default to customer’s city.

State

2

String

Y

Default to customer’s state.

ZipCode

10

String

Y

Default to customer’s zip code.

Country

20

String

Y

Default to customer’s country.

TermsCode

2

String

Y

Default to customer’s terms code.

 

GetFrtByCusAndWeightOrAmtResult Structure

Property Name

Type

Detail

ReturnCode

Integer

Zero means OK; for other return codes, please see “El2getfrService Return Code” section.

ReturnMsg

String

This is description of return code. For example, if return code is zero, you can expect “OK” in this field.

ShipViaDesc

String

 

FreightAmount

Double

 

TotalSaleAmount

Double

The value here will be the same as input TotalSaleAmount.

Weight

String

If input TotalWeight is not zero, this will be the same as input TotalWeight.

 

ShipViaNo

String

 

ExtraOutput

String

Not used for now.

 

Code Example (VB)

The following sample codes will return the freight amount that corresponds to customer “000001” with total weight equal to 30 and amount equal to 359.28.

 

Dim Service As New webServicesgetfr.El2getfrService

Dim Result As New webServicesgetfr.GetFrtByCusAndWeightOrAmtResult

Dim CustomerNo As String = “000001”

Dim TotalWeight As Double = 30

Dim TotalSaleAmount As Double = 359.28

Result = Service.GetFrtByCusAndItem(“”, “”, CustomerNo, TotalWeight, TotalSaleAmount, “”, “”, “”, “”, “”, “”, “”, “”)

If Result.ReturnCode = 0 Then

  lblFreight.Text = Result.FreightAmount

Else

   lblFreight.Text = Result.ReturnMsg

  lblErrorFlag.Text = Result.ReturnCode.ToString

End If

 

 

El2getfrService Return Code

 0 = OK

 1 = File Error

 2 = Data Missing (Customer No Missing)

 3 = Order Not On File

 4 = Data Missing (Both Item & Weight Missing)

 5 = Ship Via Not On File

 6 = Order Line Item Not On File

 7 = Customer Not On File

 8 = Ship To Not On File

 9 = Item Not On File

10 = No Carrier Exist In This Ship Via

11 = Carrier Code Not On File

12 = Carrier Mode Not On File

13 = Freight Zone Not On File

14 = Freight Rate Not On File

15 = No Service Available

CLS


 

Feedback and Knowledge Base