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
OrderDetailRequest
Output Properties
CalculateOrderResponse
OrderDetailResponse
ShipMethodResponse
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, "autoOrderId": 1, "replacementOrderId": 1, "declineCount": 1, "isRMA": true, "backOrderFromId": 1, "isCommissionable": true, "flag1": true, "flag2": true, "flag3": true, "returnCategoryId": 1, "replacementCategoryId": 1, "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: sandboxapi100.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 /> <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 /> </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("BusinesVolume: {0}", orderDetail.BusinesVolume);
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("BusinesVolume: {0}", orderDetail.BusinesVolume);
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("BusinesVolume: {0}", orderDetail.BusinesVolume)
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());
}