Exigo Web Services API v2022.12.19.1

CalculateOrder

Calculates pricing, tax, shipping and volume info for a potential order. This is for calculation only and does not store a permanent record. Client provides address, itemcodes, and quantity. Server calculates and => s pricing, tax, shipping and volume info.

Input Properties

CalculateOrderRequest
PropertyData TypeNotes
CurrencyCodeString
WarehouseID Int32Unique location for orders.
ShipMethodID Int32
PriceType Int32Controls which price band to use.
Address1StringOptional.
Address2StringOptional.
Address3StringOptional.
CityStringOptional.
StateString
ZipStringOptional.
CountryString
CountyStringOptional.
CustomerIDInt32Unique numeric identifier for a customer record.
TaxRateOverrideDecimalOptional.
ShippingAmountOverrideDecimalOptional.
ReturnOrderIDInt32Optional.
Other11StringOptional.
Other12StringOptional.
Other13StringOptional.
Other14StringOptional.
Other15StringOptional.
Other16StringOptional.
Other17StringOptional.
Other18StringOptional.
Other19StringOptional.
Other20StringOptional.
DetailsOrderDetailRequest[]At least 1 item is required.
ReturnShipMethodsBoolean
PartyIDInt32Optional.
ReturnTraceBooleanOptional. . Defaults to False.
CustomerKeyStringOptional. Unique alpha numeric identifier for customer record. Exeption will occur if CustomerID & CustomerKey are provided.
ReturnOrderKeyStringOptional.
OrderIDInt32Optional. . Defaults to 0.
OrderType OrderType
OrderSubStatusTyInt32Optional.
OrderDetailRequest
PropertyData TypeNotes
ItemCode StringOptional.
OrderDetailIDGuidOptional. Recommended to be filled for all dynamic kit items with proper parent-child relationships.
ParentOrderDetailIDGuidOptional. Recommended to be filled for all dynamic kit items with proper parent-child relationships.
QuantityDecimal
ParentItemCodeStringOptional. Use only when building kits.
PriceEachOverrideDecimalOptional. Overrides item setup.
TaxableEachOverrideDecimalOptional. Overrides item setup.
ShippingPriceEachOverrideDecimalOptional. Overrides item setup.
BusinessVolumeEachOverrideDecimalOptional. Overrides item setup.
CommissionableVolumeEachOverrideDecimalOptional. Overrides item setup.
Other1EachOverrideDecimalOptional. Overrides item setup.
Other2EachOverrideDecimalOptional. Overrides item setup.
Other3EachOverrideDecimalOptional. Overrides item setup.
Other4EachOverrideDecimalOptional. Overrides item setup.
Other5EachOverrideDecimalOptional. Overrides item setup.
Other6EachOverrideDecimalOptional. Overrides item setup.
Other7EachOverrideDecimalOptional. Overrides item setup.
Other8EachOverrideDecimalOptional. Overrides item setup.
Other9EachOverrideDecimalOptional. Overrides item setup.
Other10EachOverrideDecimalOptional. Overrides item setup.
DescriptionOverrideStringOptional. Overrides item setup.
Reference1StringOptional. Reference field.
AdvancedAutoOptionsAdvancedAutoOptionsRequestOptional. Advanced auto order options.
OrderLineInt32Optional. Sets OrderLine if sent.

Output Properties

CalculateOrderResponse
PropertyData TypeNotes
TotalDecimal
SubTotalDecimal
TaxTotalDecimal
ShippingTotalDecimal
DiscountTotalDecimal
DiscountPercentDecimal
WeightTotalDecimal
BusinessVolumeTotalDecimal
CommissionableVolumeTotalDecimal
Other1Total Decimal
Other2Total Decimal
Other3Total Decimal
Other4Total Decimal
Other5Total Decimal
Other6Total Decimal
Other7Total Decimal
Other8Total Decimal
Other9Total Decimal
Other10Total Decimal
Other11String
Other12String
Other13String
Other14String
Other15String
Other16String
Other17String
Other18String
Other19String
Other20String
ShippingTaxDecimal
OrderTaxDecimal
FedTaxTotalDecimal
StateTaxTotalDecimal
DetailsOrderDetailResponse[]
ShipMethodsShipMethodResponse[]
WarningsString
TraceString
HandlingFeeTotalDecimal
OrderDetailResponse
PropertyData TypeNotes
OrderDetailIDGuid
ParentOrderDetailIDGuid
ItemCode String
DescriptionString
QuantityDecimal
PriceEachDecimal
PriceTotalDecimal
TaxDecimal
WeightEachDecimal
WeightDecimal
BusinessVolumeEachDecimal
BusinesVolumeDecimal
CommissionableVolumeEachDecimal
CommissionableVolumeDecimal
Other1EachDecimal
Other1 Decimal
Other2EachDecimal
Other2 Decimal
Other3EachDecimal
Other3 Decimal
Other4EachDecimal
Other4 Decimal
Other5EachDecimal
Other5 Decimal
Other6EachDecimal
Other6 Decimal
Other7EachDecimal
Other7 Decimal
Other8EachDecimal
Other8 Decimal
Other9EachDecimal
Other9 Decimal
Other10EachDecimal
Other10 Decimal
ParentItemCodeString
TaxableDecimal
FedTaxDecimal
StateTaxDecimal
CityTaxDecimal
CityLocalTaxDecimal
CountyTaxDecimal
CountyLocalTaxDecimal
ManualTaxDecimal
IsStateTaxOverrideBoolean
OrderLineInt32
Reference1String
ShippingPriceEachDecimal
HandlingFeeDecimal
ShipMethodResponse
PropertyData TypeNotes
ShipMethodID Int32
DescriptionString
ShippingAmountDecimal

Http Request

POST https://yourcompany-api.exigo.com/3.0/orders/calculate HTTP/1.1
Content-Type: application/json
Authorization: Basic base64Encoded(yourlogin@yourcompany:yourpassword)

{ "currencyCode": "1", "warehouseID": 1, "shipMethodID": 1, "priceType": 1, "address1": "", "address2": "", "address3": "", "city": "", "state": "1", "zip": "", "country": "1", "county": "", "customerID": 1, "details": null, "returnShipMethods": true, "partyID": 1, "customerKey": "DDks8235txcid", "orderType": null }

Http Response

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: length

{ "total": null, "subTotal": null, "taxTotal": null, "shippingTotal": null, "discountTotal": null, "discountPercent": null, "weightTotal": null, "businessVolumeTotal": null, "commissionableVolumeTotal": null, "other1Total": null, "other2Total": null, "other3Total": null, "other4Total": null, "other5Total": null, "other6Total": null, "other7Total": null, "other8Total": null, "other9Total": null, "other10Total": null, "other11": "", "other12": "", "other13": "", "other14": "", "other15": "", "other16": "", "other17": "", "other18": "", "other19": "", "other20": "", "shippingTax": null, "orderTax": null, "fedTaxTotal": null, "stateTaxTotal": null, "details": null, "shipMethods": null, "warnings": "", "trace": "", "handlingFeeTotal": null, "result": null }

Soap Request

The following is a sample SOAP 1.1 request and response. The placeholders shown need to be replaced with actual values.

POST /3.0/ExigoApi.asmx HTTP/1.1
Host: api.exigo.com
Content-Type: text/xml; charset=utf-8
Content-Length: length
SOAPAction: "https://api.exigo.com/CalculateOrder"

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Header> <ApiAuthentication xmlns="http://api.exigo.com/"> <LoginName>string</LoginName> <Password>string</Password> <Company>string</Company> <Identity>string</Identity> <RequestTimeUtc>dateTime</RequestTimeUtc> <Signature>string</Signature> </ApiAuthentication> </soap:Header> <soap:Body> <CalculateOrderRequest xmlns="http://api.exigo.com/"> <CurrencyCode>string</CurrencyCode> <WarehouseID>int</WarehouseID> <ShipMethodID>int</ShipMethodID> <PriceType>int</PriceType> <Address1>string</Address1> <Address2>string</Address2> <Address3>string</Address3> <City>string</City> <State>string</State> <Zip>string</Zip> <Country>string</Country> <County>string</County> <CustomerID>int</CustomerID> <TaxRateOverride>decimal</TaxRateOverride> <ShippingAmountOverride>decimal</ShippingAmountOverride> <ReturnOrderID>int</ReturnOrderID> <Other11>string</Other11> <Other12>string</Other12> <Other13>string</Other13> <Other14>string</Other14> <Other15>string</Other15> <Other16>string</Other16> <Other17>string</Other17> <Other18>string</Other18> <Other19>string</Other19> <Other20>string</Other20> <Details> <OrderDetailRequest> <ItemCode>string</ItemCode> <OrderDetailID>guid</OrderDetailID> <ParentOrderDetailID>guid</ParentOrderDetailID> <Quantity>decimal</Quantity> <ParentItemCode>string</ParentItemCode> <PriceEachOverride>decimal</PriceEachOverride> <TaxableEachOverride>decimal</TaxableEachOverride> <ShippingPriceEachOverride>decimal</ShippingPriceEachOverride> <BusinessVolumeEachOverride>decimal</BusinessVolumeEachOverride> <CommissionableVolumeEachOverride>decimal</CommissionableVolumeEachOverride> <Other1EachOverride>decimal</Other1EachOverride> <Other2EachOverride>decimal</Other2EachOverride> <Other3EachOverride>decimal</Other3EachOverride> <Other4EachOverride>decimal</Other4EachOverride> <Other5EachOverride>decimal</Other5EachOverride> <Other6EachOverride>decimal</Other6EachOverride> <Other7EachOverride>decimal</Other7EachOverride> <Other8EachOverride>decimal</Other8EachOverride> <Other9EachOverride>decimal</Other9EachOverride> <Other10EachOverride>decimal</Other10EachOverride> <DescriptionOverride>string</DescriptionOverride> <Reference1>string</Reference1> <AdvancedAutoOptions> <ProcessWhileDate>dateTime</ProcessWhileDate> <SkipUntilDate>dateTime</SkipUntilDate> <DetailStartDate>dateTime</DetailStartDate> <DetailEndDate>dateTime</DetailEndDate> <DetailInterval>int</DetailInterval> </AdvancedAutoOptions> <OrderLine>int</OrderLine> </OrderDetailRequest> </Details> <ReturnShipMethods>boolean</ReturnShipMethods> <PartyID>int</PartyID> <ReturnTrace>boolean</ReturnTrace> <CustomerKey>string</CustomerKey> <ReturnOrderKey>string</ReturnOrderKey> <OrderID>int</OrderID> <OrderType>Default or CustomerService or ShoppingCart or WebWizard or AutoOrder or Import or BackOrder or ReplacementOrder or ReturnOrder or WebAutoOrder or TicketSystem or APIOrder or BackOrderParent or ChildOrder or Other1 or Other2 or Other3 or Other4 or Other5 or Other6 or Other7 or Other8 or Other9 or Other10</OrderType> <OrderSubStatusTy>int</OrderSubStatusTy> </CalculateOrderRequest> </soap:Body> </soap:Envelope>

Soap Response

HTTP/1.1 200 OK
Content-Type: text/xml; charset=utf-8
Content-Length: length

<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"> <soap:Body> <CalculateOrderResult xmlns="http://api.exigo.com/"> <Total>decimal</Total> <SubTotal>decimal</SubTotal> <TaxTotal>decimal</TaxTotal> <ShippingTotal>decimal</ShippingTotal> <DiscountTotal>decimal</DiscountTotal> <DiscountPercent>decimal</DiscountPercent> <WeightTotal>decimal</WeightTotal> <BusinessVolumeTotal>decimal</BusinessVolumeTotal> <CommissionableVolumeTotal>decimal</CommissionableVolumeTotal> <Other1Total>decimal</Other1Total> <Other2Total>decimal</Other2Total> <Other3Total>decimal</Other3Total> <Other4Total>decimal</Other4Total> <Other5Total>decimal</Other5Total> <Other6Total>decimal</Other6Total> <Other7Total>decimal</Other7Total> <Other8Total>decimal</Other8Total> <Other9Total>decimal</Other9Total> <Other10Total>decimal</Other10Total> <Other11>string</Other11> <Other12>string</Other12> <Other13>string</Other13> <Other14>string</Other14> <Other15>string</Other15> <Other16>string</Other16> <Other17>string</Other17> <Other18>string</Other18> <Other19>string</Other19> <Other20>string</Other20> <ShippingTax>decimal</ShippingTax> <OrderTax>decimal</OrderTax> <FedTaxTotal>decimal</FedTaxTotal> <StateTaxTotal>decimal</StateTaxTotal> <Details> <OrderDetailResponse> <OrderDetailID>guid</OrderDetailID> <ParentOrderDetailID>guid</ParentOrderDetailID> <ItemCode>string</ItemCode> <Description>string</Description> <Quantity>decimal</Quantity> <PriceEach>decimal</PriceEach> <PriceTotal>decimal</PriceTotal> <Tax>decimal</Tax> <WeightEach>decimal</WeightEach> <Weight>decimal</Weight> <BusinessVolumeEach>decimal</BusinessVolumeEach> <BusinesVolume>decimal</BusinesVolume> <CommissionableVolumeEach>decimal</CommissionableVolumeEach> <CommissionableVolume>decimal</CommissionableVolume> <Other1Each>decimal</Other1Each> <Other1>decimal</Other1> <Other2Each>decimal</Other2Each> <Other2>decimal</Other2> <Other3Each>decimal</Other3Each> <Other3>decimal</Other3> <Other4Each>decimal</Other4Each> <Other4>decimal</Other4> <Other5Each>decimal</Other5Each> <Other5>decimal</Other5> <Other6Each>decimal</Other6Each> <Other6>decimal</Other6> <Other7Each>decimal</Other7Each> <Other7>decimal</Other7> <Other8Each>decimal</Other8Each> <Other8>decimal</Other8> <Other9Each>decimal</Other9Each> <Other9>decimal</Other9> <Other10Each>decimal</Other10Each> <Other10>decimal</Other10> <ParentItemCode>string</ParentItemCode> <Taxable>decimal</Taxable> <FedTax>decimal</FedTax> <StateTax>decimal</StateTax> <CityTax>decimal</CityTax> <CityLocalTax>decimal</CityLocalTax> <CountyTax>decimal</CountyTax> <CountyLocalTax>decimal</CountyLocalTax> <ManualTax>decimal</ManualTax> <IsStateTaxOverride>boolean</IsStateTaxOverride> <OrderLine>int</OrderLine> <Reference1>string</Reference1> <ShippingPriceEach>decimal</ShippingPriceEach> <HandlingFee>decimal</HandlingFee> </OrderDetailResponse> </Details> <ShipMethods> <ShipMethodResponse> <ShipMethodID>int</ShipMethodID> <Description>string</Description> <ShippingAmount>decimal</ShippingAmount> </ShipMethodResponse> </ShipMethods> <Warnings> <string>string</string> </Warnings> <Trace>string</Trace> <HandlingFeeTotal>decimal</HandlingFeeTotal> </CalculateOrderResult> </soap:Body> </soap:Envelope>

C# Rest Client

Install Nuget package Exigo.Api.Client

try

{

    //Create Api Client

    var api = new ExigoApiClient("yourcmpany", "yourlogin", "yourpassword");

 

    //Create Request

    var req = new CalculateOrderRequest();

 

    req.CurrencyCode = "1";

    req.WarehouseID = 1;            //Unique location for orders

    req.ShipMethodID = 1;

    req.PriceType = 1;              //Controls which price band to use

    req.Address1 = "1";

    req.Address2 = "1";

    req.Address3 = "1";

    req.City = "1";

    req.State = "1";

    req.Zip = "1";

    req.Country = "1";

    req.County = "1";

    req.CustomerID = 1;             //Unique numeric identifier for a customer record.

 

    //Add Details

    var details = new List<OrderDetailRequest>();

 

    var detail1 = new OrderDetailRequest();

    detail1.ItemCode = "1";

    detail1.Quantity = 1;

    details.Add(detail1);

 

    var detail2 = new OrderDetailRequest();

    detail2.ItemCode = "2";

    detail2.Quantity = 2;

    details.Add(detail2);

 

    //Now attach the list to the request

    req.Details = details.ToArray();

    req.ReturnShipMethods = true;

    req.PartyID = 1;

    req.CustomerKey = "DDks8235txcid";//Unique alpha numeric identifier for customer record. Exeption will occur if CustomerID & CustomerKey are provided.

    req.OrderType = OrderType.Default;

 

    //Send Request to Server and Get Response

    var res = await api.CalculateOrderAsync(req);

 

    //Now examine the results:

    Console.WriteLine("Total: {0}", res.Total);

    Console.WriteLine("SubTotal: {0}", res.SubTotal);

    Console.WriteLine("TaxTotal: {0}", res.TaxTotal);

    Console.WriteLine("ShippingTotal: {0}", res.ShippingTotal);

    Console.WriteLine("DiscountTotal: {0}", res.DiscountTotal);

    Console.WriteLine("DiscountPercent: {0}", res.DiscountPercent);

    Console.WriteLine("WeightTotal: {0}", res.WeightTotal);

    Console.WriteLine("BusinessVolumeTotal: {0}", res.BusinessVolumeTotal);

    Console.WriteLine("CommissionableVolumeTotal: {0}", res.CommissionableVolumeTotal);

    Console.WriteLine("Other11: {0}", res.Other11);

    Console.WriteLine("Other12: {0}", res.Other12);

    Console.WriteLine("Other13: {0}", res.Other13);

    Console.WriteLine("Other14: {0}", res.Other14);

    Console.WriteLine("Other15: {0}", res.Other15);

    Console.WriteLine("Other16: {0}", res.Other16);

    Console.WriteLine("Other17: {0}", res.Other17);

    Console.WriteLine("Other18: {0}", res.Other18);

    Console.WriteLine("Other19: {0}", res.Other19);

    Console.WriteLine("Other20: {0}", res.Other20);

    Console.WriteLine("ShippingTax: {0}", res.ShippingTax);

    Console.WriteLine("OrderTax: {0}", res.OrderTax);

    Console.WriteLine("FedTaxTotal: {0}", res.FedTaxTotal);

    Console.WriteLine("StateTaxTotal: {0}", res.StateTaxTotal);

 

    foreach (var orderDetail in res.Details)

    {

        Console.WriteLine("OrderDetailID: {0}", orderDetail.OrderDetailID);

        Console.WriteLine("ParentOrderDetailID: {0}", orderDetail.ParentOrderDetailID);

        Console.WriteLine("ItemCode: {0}", orderDetail.ItemCode);

        Console.WriteLine("Description: {0}", orderDetail.Description);

        Console.WriteLine("Quantity: {0}", orderDetail.Quantity);

        Console.WriteLine("OrderLine: {0}", orderDetail.OrderLine);

        Console.WriteLine("Reference1: {0}", orderDetail.Reference1);

        Console.WriteLine("ShippingPriceEach: {0}", orderDetail.ShippingPriceEach);

    }

 

    foreach (var shipMethod in res.ShipMethods)

    {

        Console.WriteLine("ShipMethodID: {0}", shipMethod.ShipMethodID);

        Console.WriteLine("Description: {0}", shipMethod.Description);

        Console.WriteLine("ShippingAmount: {0}", shipMethod.ShippingAmount);

    }

    Console.WriteLine("Warnings: {0}", res.Warnings);

    Console.WriteLine("Trace: {0}", res.Trace);

    Console.WriteLine("HandlingFeeTotal: {0}", res.HandlingFeeTotal);

}

catch (Exception ex)

{

    Console.WriteLine("Error: " + ex.Message);

}

C# Soap Client

try

{

    //Create Main API Context Object

    ExigoApi api = new ExigoApi();

 

    //Create Authentication Header

    ApiAuthentication auth = new ApiAuthentication();

    auth.LoginName = "yourLoginName";

    auth.Password = "yourPassword";

    auth.Company = "yourCompany";

    api.ApiAuthenticationValue = auth;

 

    //Create Request

    CalculateOrderRequest req = new CalculateOrderRequest();

 

    req.CurrencyCode = "1";

    req.WarehouseID = 1;            //Unique location for orders

    req.ShipMethodID = 1;

    req.PriceType = 1;              //Controls which price band to use

    req.Address1 = "1";

    req.Address2 = "1";

    req.Address3 = "1";

    req.City = "1";

    req.State = "1";

    req.Zip = "1";

    req.Country = "1";

    req.County = "1";

    req.CustomerID = 1;             //Unique numeric identifier for a customer record.

 

    //Add Details

    List<OrderDetailRequest> details = new List<OrderDetailRequest>();

 

    OrderDetailRequest detail1 = new OrderDetailRequest();

    detail1.ItemCode = "1";

    detail1.Quantity = 1;

    details.Add(detail1);

 

    OrderDetailRequest detail2 = new OrderDetailRequest();

    detail2.ItemCode = "2";

    detail2.Quantity = 2;

    details.Add(detail2);

 

    //Now attach the list to the request

    req.Details = details.ToArray();

    req.ReturnShipMethods = true;

    req.PartyID = 1;

    req.CustomerKey = "DDks8235txcid";//Unique alpha numeric identifier for customer record. Exeption will occur if CustomerID & CustomerKey are provided.

    req.OrderType = OrderType.Default;

 

    //Send Request to Server and Get Response

    CalculateOrderResponse res = api.CalculateOrder(req);

 

    //Now examine the results:

    Console.WriteLine("Total: {0}", res.Total);

    Console.WriteLine("SubTotal: {0}", res.SubTotal);

    Console.WriteLine("TaxTotal: {0}", res.TaxTotal);

    Console.WriteLine("ShippingTotal: {0}", res.ShippingTotal);

    Console.WriteLine("DiscountTotal: {0}", res.DiscountTotal);

    Console.WriteLine("DiscountPercent: {0}", res.DiscountPercent);

    Console.WriteLine("WeightTotal: {0}", res.WeightTotal);

    Console.WriteLine("BusinessVolumeTotal: {0}", res.BusinessVolumeTotal);

    Console.WriteLine("CommissionableVolumeTotal: {0}", res.CommissionableVolumeTotal);

    Console.WriteLine("Other11: {0}", res.Other11);

    Console.WriteLine("Other12: {0}", res.Other12);

    Console.WriteLine("Other13: {0}", res.Other13);

    Console.WriteLine("Other14: {0}", res.Other14);

    Console.WriteLine("Other15: {0}", res.Other15);

    Console.WriteLine("Other16: {0}", res.Other16);

    Console.WriteLine("Other17: {0}", res.Other17);

    Console.WriteLine("Other18: {0}", res.Other18);

    Console.WriteLine("Other19: {0}", res.Other19);

    Console.WriteLine("Other20: {0}", res.Other20);

    Console.WriteLine("ShippingTax: {0}", res.ShippingTax);

    Console.WriteLine("OrderTax: {0}", res.OrderTax);

    Console.WriteLine("FedTaxTotal: {0}", res.FedTaxTotal);

    Console.WriteLine("StateTaxTotal: {0}", res.StateTaxTotal);

 

    foreach (OrderDetailResponse orderDetail in res.Details)

    {

        Console.WriteLine("OrderDetailID: {0}", orderDetail.OrderDetailID);

        Console.WriteLine("ParentOrderDetailID: {0}", orderDetail.ParentOrderDetailID);

        Console.WriteLine("ItemCode: {0}", orderDetail.ItemCode);

        Console.WriteLine("Description: {0}", orderDetail.Description);

        Console.WriteLine("Quantity: {0}", orderDetail.Quantity);

        Console.WriteLine("OrderLine: {0}", orderDetail.OrderLine);

        Console.WriteLine("Reference1: {0}", orderDetail.Reference1);

        Console.WriteLine("ShippingPriceEach: {0}", orderDetail.ShippingPriceEach);

    }

 

    foreach (ShipMethodResponse shipMethod in res.ShipMethods)

    {

        Console.WriteLine("ShipMethodID: {0}", shipMethod.ShipMethodID);

        Console.WriteLine("Description: {0}", shipMethod.Description);

        Console.WriteLine("ShippingAmount: {0}", shipMethod.ShippingAmount);

    }

    Console.WriteLine("Warnings: {0}", res.Warnings);

    Console.WriteLine("Trace: {0}", res.Trace);

    Console.WriteLine("HandlingFeeTotal: {0}", res.HandlingFeeTotal);

}

catch (Exception ex)

{

    Console.WriteLine("Error: " + ex.Message);

}

VB.Net

Try

    'Create Main API Context Object

    Dim api as new ExigoApi()

 

    'Create Authentication Header

    Dim auth as new ApiAuthentication()

    auth.LoginName = "yourLoginName"

    auth.Password = "yourPassword"

    auth.Company = "yourCompany"

    api.ApiAuthenticationValue = auth

 

    'Create Request

    Dim req as new CalculateOrderRequest()

 

    req.CurrencyCode = "1"

    req.WarehouseID = 1

    req.ShipMethodID = 1

    req.PriceType = 1

    req.Address1 = "1"

    req.Address2 = "1"

    req.Address3 = "1"

    req.City = "1"

    req.State = "1"

    req.Zip = "1"

    req.Country = "1"

    req.County = "1"

    req.CustomerID = 1

 

    'Add Details

    Dim details As New List(Of OrderDetailRequest)()

 

    Dim detail1 as new OrderDetailRequest()

    detail1.ItemCode = "1"

    detail1.Quantity = 1

    details.Add(detail1)

 

    Dim detail2 as new OrderDetailRequest()

    detail2.ItemCode = "2"

    detail2.Quantity = 2

    details.Add(detail2)

 

    'Now attach the list to the request

    req.Details = details.ToArray()

    req.ReturnShipMethods = true

    req.PartyID = 1

    req.CustomerKey = "DDks8235txcid"

    req.OrderType = OrderType.Default

 

    'Send Request to Server and Get Response

    Dim res As CalculateOrderResponse = api.CalculateOrder(req)

 

    'Now examine the results:

    Console.WriteLine("Total: {0}", res.Total)

    Console.WriteLine("SubTotal: {0}", res.SubTotal)

    Console.WriteLine("TaxTotal: {0}", res.TaxTotal)

    Console.WriteLine("ShippingTotal: {0}", res.ShippingTotal)

    Console.WriteLine("DiscountTotal: {0}", res.DiscountTotal)

    Console.WriteLine("DiscountPercent: {0}", res.DiscountPercent)

    Console.WriteLine("WeightTotal: {0}", res.WeightTotal)

    Console.WriteLine("BusinessVolumeTotal: {0}", res.BusinessVolumeTotal)

    Console.WriteLine("CommissionableVolumeTotal: {0}", res.CommissionableVolumeTotal)

    Console.WriteLine("Other11: {0}", res.Other11)

    Console.WriteLine("Other12: {0}", res.Other12)

    Console.WriteLine("Other13: {0}", res.Other13)

    Console.WriteLine("Other14: {0}", res.Other14)

    Console.WriteLine("Other15: {0}", res.Other15)

    Console.WriteLine("Other16: {0}", res.Other16)

    Console.WriteLine("Other17: {0}", res.Other17)

    Console.WriteLine("Other18: {0}", res.Other18)

    Console.WriteLine("Other19: {0}", res.Other19)

    Console.WriteLine("Other20: {0}", res.Other20)

    Console.WriteLine("ShippingTax: {0}", res.ShippingTax)

    Console.WriteLine("OrderTax: {0}", res.OrderTax)

    Console.WriteLine("FedTaxTotal: {0}", res.FedTaxTotal)

    Console.WriteLine("StateTaxTotal: {0}", res.StateTaxTotal)

 

    For Each orderDetail As OrderDetailResponse In res.Details

        Console.WriteLine("OrderDetailID: {0}", orderDetail.OrderDetailID)

        Console.WriteLine("ParentOrderDetailID: {0}", orderDetail.ParentOrderDetailID)

        Console.WriteLine("ItemCode: {0}", orderDetail.ItemCode)

        Console.WriteLine("Description: {0}", orderDetail.Description)

        Console.WriteLine("Quantity: {0}", orderDetail.Quantity)

        Console.WriteLine("OrderLine: {0}", orderDetail.OrderLine)

        Console.WriteLine("Reference1: {0}", orderDetail.Reference1)

        Console.WriteLine("ShippingPriceEach: {0}", orderDetail.ShippingPriceEach)

    Next

 

    For Each shipMethod As ShipMethodResponse In res.ShipMethods

        Console.WriteLine("ShipMethodID: {0}", shipMethod.ShipMethodID)

        Console.WriteLine("Description: {0}", shipMethod.Description)

        Console.WriteLine("ShippingAmount: {0}", shipMethod.ShippingAmount)

    Next

    Console.WriteLine("Warnings: {0}", res.Warnings)

    Console.WriteLine("Trace: {0}", res.Trace)

    Console.WriteLine("HandlingFeeTotal: {0}", res.HandlingFeeTotal)

Catch ex As Exception

    Console.WriteLine("Error: " & ex.Message)

End Try

PHP

Note: PHP is not officially supported.

<?php

try

{

    //Setup the SoapClient and Authentication

    $api = new SoapClient("http://api.exigo.com/3.0/ExigoApi.asmx?WSDL");

    $ns = "http://api.exigo.com/";

    $auth = array()

    $auth["LoginName"] = new SoapVar("yourLoginName",XSD_STRING,null,null,null,$ns);

    $auth["Password"] = new SoapVar("yourPassword",XSD_STRING,null,null,null,$ns);

    $auth["Company"] = new SoapVar("yourCompany",XSD_STRING,null,null,null,$ns);

    $headerBody = new SoapVar($auth, SOAP_ENC_OBJECT);

    $header = new SoapHeader($ns, 'ApiAuthentication', $headerBody);

    $api->__setSoapHeaders(array($header));

 

    //Create Request

 

    $req->CurrencyCode = "1";

    $req->WarehouseID = 1;

    $req->ShipMethodID = 1;

    $req->PriceType = 1;

    $req->Address1 = "1";

    $req->Address2 = "1";

    $req->Address3 = "1";

    $req->City = "1";

    $req->State = "1";

    $req->Zip = "1";

    $req->Country = "1";

    $req->County = "1";

    $req->CustomerID = 1;

 

    //Add Details

 

    $detail1->ItemCode = "1";

    $detail1->Quantity = 1;

 

    $detail2->ItemCode = "2";

    $detail2->Quantity = 2;

 

    //Now attach the list to the request

    req.Details = array(detail1,detail2);

    $req->ReturnShipMethods = 1;

    $req->PartyID = 1;

    $req->CustomerKey = "DDks8235txcid";

    $req->OrderType = 1;

 

    //Send Request to Server and Get Response

    $res = $api.CalculateOrder($req);

 

    //Now examine the results:

}

catch (SoapFault $ex)

{

    echo "Error: ", $ex->getMessage();

}

?>

Java

Note: Java is not officially supported.

try

{

    //Create Main API Context Object

    ExigoApi api = new ExigoApi();

 

    //Create Authentication Header

    ApiAuthentication auth = new ApiAuthentication();

    auth.setLoginName("yourLoginName");

    auth.setPassword("yourPassword");

    auth.setCompany("yourCompany");

    api.setApiAuthenticationValue(auth);

 

    //Create Request

    CalculateOrderRequest req = new CalculateOrderRequest();

 

    req.setCurrencyCode("1");

    req.setWarehouseID(1);

    req.setShipMethodID(1);

    req.setPriceType(1);

    req.setAddress1("1");

    req.setAddress2("1");

    req.setAddress3("1");

    req.setCity("1");

    req.setState("1");

    req.setZip("1");

    req.setCountry("1");

    req.setCounty("1");

    req.setCustomerID(1);

 

    //Add Details

    ArrayOfOrderDetailRequest details = new ArrayOfOrderDetailRequest();

 

    OrderDetailRequest detail1 = new OrderDetailRequest();

    detail1.setItemCode("1");

    detail1.setQuantity(1);

    details.Add(detail1);

 

    OrderDetailRequest detail2 = new OrderDetailRequest();

    detail2.setItemCode("2");

    detail2.setQuantity(2);

    details.Add(detail2);

 

    //Now attach the list to the request

    req.setDetails(details);

    req.setReturnShipMethods(1);

    req.setPartyID(1);

    req.setCustomerKey("DDks8235txcid");

    req.setOrderType(1);

 

    //Send Request to Server and Get Response

    CalculateOrderResponse res = api.getExigoApiSoap().calculateOrder(req, auth);

 

    //Now examine the results:

}

catch (Exception ex)

{

    System.out.println("Error: " + ex.getMessage());

}

CSV

This method does not support csv output.