Chilkat HOME .NET Core C# Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi ActiveX Delphi DLL Go Java Lianja Mono C# Node.js Objective-C PHP ActiveX PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift 2 Swift 3,4,5... Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Unicode C++) UPS Rate RequestSee more UPS ExamplesSimple UPS Rate Example For more information, see https://developer.ups.com/api/reference?loc=en_US#operation/Rate
#include <CkHttpW.h> #include <CkJsonObjectW.h> #include <CkHttpResponseW.h> #include <CkStringBuilderW.h> void ChilkatSample(void) { // This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. CkHttpW http; // Use this online tool to generate code from sample JSON: // Generate Code to Create JSON // The following JSON is sent in the request body. // { // "RateRequest": { // "Request": { // "TransactionReference": { // "CustomerContext": "CustomerContext" // } // }, // "Shipment": { // "Shipper": { // "Name": "ShipperName", // "ShipperNumber": "ShipperNumber", // "Address": { // "AddressLine": [ // "ShipperAddressLine", // "ShipperAddressLine", // "ShipperAddressLine" // ], // "City": "TIMONIUM", // "StateProvinceCode": "MD", // "PostalCode": "21093", // "CountryCode": "US" // } // }, // "ShipTo": { // "Name": "ShipToName", // "Address": { // "AddressLine": [ // "ShipToAddressLine", // "ShipToAddressLine", // "ShipToAddressLine" // ], // "City": "Alpharetta", // "StateProvinceCode": "GA", // "PostalCode": "30005", // "CountryCode": "US" // } // }, // "ShipFrom": { // "Name": "ShipFromName", // "Address": { // "AddressLine": [ // "ShipFromAddressLine", // "ShipFromAddressLine", // "ShipFromAddressLine" // ], // "City": "TIMONIUM", // "StateProvinceCode": "MD", // "PostalCode": "21093", // "CountryCode": "US" // } // }, // "PaymentDetails": { // "ShipmentCharge": { // "Type": "01", // "BillShipper": { // "AccountNumber": "ShipperNumber" // } // } // }, // "Service": { // "Code": "03", // "Description": "Ground" // }, // "NumOfPieces": "1", // "Package": { // "PackagingType": { // "Code": "02", // "Description": "Packaging" // }, // "Dimensions": { // "UnitOfMeasurement": { // "Code": "IN", // "Description": "Inches" // }, // "Length": "5", // "Width": "5", // "Height": "5" // }, // "PackageWeight": { // "UnitOfMeasurement": { // "Code": "LBS", // "Description": "Pounds" // }, // "Weight": "1" // } // } // } // } // } CkJsonObjectW json; json.UpdateString(L"RateRequest.Request.TransactionReference.CustomerContext",L"CustomerContext"); json.UpdateString(L"RateRequest.Shipment.Shipper.Name",L"ShipperName"); json.UpdateString(L"RateRequest.Shipment.Shipper.ShipperNumber",L"ShipperNumber"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.AddressLine[0]",L"ShipperAddressLine"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.AddressLine[1]",L"ShipperAddressLine"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.AddressLine[2]",L"ShipperAddressLine"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.City",L"TIMONIUM"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.StateProvinceCode",L"MD"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.PostalCode",L"21093"); json.UpdateString(L"RateRequest.Shipment.Shipper.Address.CountryCode",L"US"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Name",L"ShipToName"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.AddressLine[0]",L"ShipToAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.AddressLine[1]",L"ShipToAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.AddressLine[2]",L"ShipToAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.City",L"Alpharetta"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.StateProvinceCode",L"GA"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.PostalCode",L"30005"); json.UpdateString(L"RateRequest.Shipment.ShipTo.Address.CountryCode",L"US"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Name",L"ShipFromName"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.AddressLine[0]",L"ShipFromAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.AddressLine[1]",L"ShipFromAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.AddressLine[2]",L"ShipFromAddressLine"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.City",L"TIMONIUM"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.StateProvinceCode",L"MD"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.PostalCode",L"21093"); json.UpdateString(L"RateRequest.Shipment.ShipFrom.Address.CountryCode",L"US"); json.UpdateString(L"RateRequest.Shipment.PaymentDetails.ShipmentCharge.Type",L"01"); json.UpdateString(L"RateRequest.Shipment.PaymentDetails.ShipmentCharge.BillShipper.AccountNumber",L"ShipperNumber"); json.UpdateString(L"RateRequest.Shipment.Service.Code",L"03"); json.UpdateString(L"RateRequest.Shipment.Service.Description",L"Ground"); json.UpdateString(L"RateRequest.Shipment.NumOfPieces",L"1"); json.UpdateString(L"RateRequest.Shipment.Package.PackagingType.Code",L"02"); json.UpdateString(L"RateRequest.Shipment.Package.PackagingType.Description",L"Packaging"); json.UpdateString(L"RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Code",L"IN"); json.UpdateString(L"RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Description",L"Inches"); json.UpdateString(L"RateRequest.Shipment.Package.Dimensions.Length",L"5"); json.UpdateString(L"RateRequest.Shipment.Package.Dimensions.Width",L"5"); json.UpdateString(L"RateRequest.Shipment.Package.Dimensions.Height",L"5"); json.UpdateString(L"RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Code",L"LBS"); json.UpdateString(L"RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Description",L"Pounds"); json.UpdateString(L"RateRequest.Shipment.Package.PackageWeight.Weight",L"1"); // Load the OAuth2 access token obtained via client credentials as shown // in this UPS OAuth2 Client Credentials example. CkJsonObjectW jsonToken; bool success = jsonToken.LoadFile(L"qa_data/tokens/ups_oauth2_token.json"); if (success != true) { wprintf(L"Failed to load ups_oauth2_token.json\n"); return; } // The access token JSON looks something like this: // { // "token_type": "Bearer", // "issued_at": "1686911985606", // "client_id": "2498righ8wr6aihe98rt8rhowirtyw9er6twe80rtywrehrt", // "access_token": "eyJraW......R2sbqrY", // "expires_in": "14399", // "status": "approved" // } // Adds the "Authorization: Bearer <YOUR_TOKEN_HERE>" header. http.put_AuthToken(jsonToken.stringOf(L"access_token")); http.SetRequestHeader(L"Content-Type",L"application/json"); http.SetRequestHeader(L"transId",L"string"); http.SetRequestHeader(L"transactionSrc",L"testing"); // The "version" indicates Rate API to display the new release features in Rate API response based on Rate release. // Supported values: v1, v1601, v1607, v1701, v1707, v2108, v2205. http.SetUrlVar(L"version",L"v1"); // The "requestoption" has the following valid values: // Rate = The server rates (The default Request option is Rate if a Request Option is not provided). // Shop = The server validates the shipment, and returns rates for all UPS products from the ShipFrom to the ShipTo addresses. // Rate is the only valid request option for Ground Freight Pricing requests. http.SetUrlVar(L"requestoption",L"Rate"); CkHttpResponseW *resp = http.PostJson3(L"https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string",L"application/json",json); if (http.get_LastMethodSuccess() == false) { wprintf(L"%s\n",http.lastErrorText()); return; } CkStringBuilderW sbResponseBody; resp->GetBodySb(sbResponseBody); CkJsonObjectW jResp; jResp.LoadSb(sbResponseBody); jResp.put_EmitCompact(false); wprintf(L"Response Body:\n"); wprintf(L"%s\n",jResp.emit()); // ---------------------------------------------------------------------------------------------------------- // Important: If you get the following error response, read further for the solution.. // // { // "response": { // "errors": [ // { // "code": "250002", // "message": "Invalid Authentication Information." // } // ] // } // } // // It means you didn't add the Rating API permission to your app. // To add the Rating API, login to your developer account and go to your Apps page at https://developer.ups.com/apps?loc=en_US // Then edit your app and add the Rating API. // ---------------------------------------------------------------------------------------------------------- int respStatusCode = resp->get_StatusCode(); wprintf(L"Response Status Code = %d\n",respStatusCode); if (respStatusCode >= 400) { wprintf(L"Response Header:\n"); wprintf(L"%s\n",resp->header()); wprintf(L"Failed.\n"); delete resp; return; } delete resp; // Sample JSON response: // (Sample code for parsing the JSON response is shown below) // { // "RateResponse": { // "Response": { // "ResponseStatus": { // "Code": "s", // "Description": "string" // }, // "Alert": [ // { // "Code": "string", // "Description": "string" // } // ], // "AlertDetail": [ // { // "Code": "string", // "Description": "string", // "ElementLevelInformation": { // "Level": "s", // "ElementIdentifier": [ // { // "Code": null, // "Value": null // } // ] // } // } // ], // "TransactionReference": { // "CustomerContext": "string" // } // }, // "RatedShipment": [ // { // "Disclaimer": [ // { // "Code": "st", // "Description": "string" // } // ], // "Service": { // "Code": "str", // "Description": "string" // }, // "RateChart": "s", // "RatedShipmentAlert": [ // { // "Code": "string", // "Description": "string" // } // ], // "BillableWeightCalculationMethod": "st", // "RatingMethod": "st", // "BillingWeight": { // "UnitOfMeasurement": { // "Code": "str", // "Description": "string" // }, // "Weight": "strin" // }, // "TransportationCharges": { // "CurrencyCode": "str", // "MonetaryValue": "stringstringstri" // }, // "BaseServiceCharge": { // "CurrencyCode": "str", // "MonetaryValue": "stringstringstri" // }, // "ItemizedCharges": [ // { // "Code": "str", // "Description": "string", // "CurrencyCode": "str", // "MonetaryValue": "string", // "SubType": "string" // } // ], // "FRSShipmentData": { // "TransportationCharges": { // "GrossCharge": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "DiscountAmount": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "DiscountPercentage": "st", // "NetCharge": { // "CurrencyCode": "str", // "MonetaryValue": "string" // } // }, // "FreightDensityRate": { // "Density": "strin", // "TotalCubicFeet": "string" // }, // "HandlingUnits": [ // { // "Quantity": "string", // "Type": { // "Code": null, // "Description": null // }, // "Dimensions": { // "UnitOfMeasurement": null, // "Length": null, // "Width": null, // "Height": null // }, // "AdjustedHeight": { // "Value": null, // "UnitOfMeasurement": null // } // } // ] // }, // "ServiceOptionsCharges": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "TaxCharges": [ // { // "Type": "string", // "MonetaryValue": "string" // } // ], // "TotalCharges": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "TotalChargesWithTaxes": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "NegotiatedRateCharges": { // "ItemizedCharges": [ // { // "Code": "str", // "Description": "string", // "CurrencyCode": "str", // "MonetaryValue": "string", // "SubType": "string" // } // ], // "TaxCharges": [ // { // "Type": "string", // "MonetaryValue": "string" // } // ], // "TotalCharge": { // "CurrencyCode": "string", // "MonetaryValue": "string" // }, // "TotalChargesWithTaxes": { // "CurrencyCode": "string", // "MonetaryValue": "string" // } // }, // "RatedPackage": [ // { // "BaseServiceCharge": { // "CurrencyCode": "str", // "MonetaryValue": "string" // }, // "TransportationCharges": { // "CurrencyCode": "string", // "MonetaryValue": "string" // }, // "ServiceOptionsCharges": { // "CurrencyCode": "string", // "MonetaryValue": "string" // }, // "TotalCharges": { // "CurrencyCode": "string", // "MonetaryValue": "string" // }, // "Weight": "string", // "BillingWeight": { // "UnitOfMeasurement": { // "Code": null, // "Description": null // }, // "Weight": "string" // }, // "Accessorial": [ // { // "Code": null, // "Description": null // } // ], // "ItemizedCharges": [ // { // "Code": null, // "Description": null, // "CurrencyCode": null, // "MonetaryValue": null, // "SubType": null // } // ], // "NegotiatedCharges": { // "ItemizedCharges": [ // null // ] // }, // "SimpleRate": { // "Code": "st" // }, // "RateModifier": [ // { // "ModifierType": null, // "ModifierDesc": null, // "Amount": null // } // ] // } // ], // "TimeInTransit": { // "PickupDate": "stringst", // "DocumentsOnlyIndicator": "string", // "PackageBillType": "st", // "ServiceSummary": { // "Service": { // "Description": "string" // }, // "GuaranteedIndicator": "string", // "Disclaimer": "string", // "EstimatedArrival": { // "Arrival": { // "Date": null, // "Time": null // }, // "BusinessDaysInTransit": "strin", // "Pickup": { // "Date": null, // "Time": null // }, // "DayOfWeek": "string", // "CustomerCenterCutoff": "string", // "DelayCount": "str", // "HolidayCount": "st", // "RestDays": "st", // "TotalTransitDays": "strin" // }, // "SaturdayDelivery": "string", // "SaturdayDeliveryDisclaimer": "string", // "SundayDelivery": "string", // "SundayDeliveryDisclaimer": "string" // }, // "AutoDutyCode": "st", // "Disclaimer": "string" // }, // "ScheduledDeliveryDate": "string", // "RoarRatedIndicator": "string" // } // ] // } // } // Sample code for parsing the JSON response... // Use the following online tool to generate parsing code from sample JSON: // Generate Parsing Code from JSON // Chilkat functions returning "const char *" return a pointer to temporary internal memory owned and managed by Chilkat. // See this example explaining how this memory should be used: const char * functions. const wchar_t *Level = 0; int j; int count_j; const wchar_t *Value = 0; const wchar_t *ServiceCode = 0; const wchar_t *ServiceDescription = 0; const wchar_t *RateChart = 0; const wchar_t *BillableWeightCalculationMethod = 0; const wchar_t *RatingMethod = 0; const wchar_t *UnitOfMeasurementCode = 0; const wchar_t *UnitOfMeasurementDescription = 0; const wchar_t *Weight = 0; const wchar_t *CurrencyCode = 0; const wchar_t *MonetaryValue = 0; const wchar_t *BaseServiceChargeCurrencyCode = 0; const wchar_t *BaseServiceChargeMonetaryValue = 0; const wchar_t *GrossChargeCurrencyCode = 0; const wchar_t *GrossChargeMonetaryValue = 0; const wchar_t *DiscountAmountCurrencyCode = 0; const wchar_t *DiscountAmountMonetaryValue = 0; const wchar_t *DiscountPercentage = 0; const wchar_t *NetChargeCurrencyCode = 0; const wchar_t *NetChargeMonetaryValue = 0; const wchar_t *Density = 0; const wchar_t *TotalCubicFeet = 0; const wchar_t *ServiceOptionsChargesCurrencyCode = 0; const wchar_t *ServiceOptionsChargesMonetaryValue = 0; const wchar_t *TotalChargesCurrencyCode = 0; const wchar_t *TotalChargesMonetaryValue = 0; const wchar_t *TotalChargesWithTaxesCurrencyCode = 0; const wchar_t *TotalChargesWithTaxesMonetaryValue = 0; const wchar_t *TotalChargeCurrencyCode = 0; const wchar_t *TotalChargeMonetaryValue = 0; const wchar_t *PickupDate = 0; const wchar_t *DocumentsOnlyIndicator = 0; const wchar_t *PackageBillType = 0; const wchar_t *GuaranteedIndicator = 0; const wchar_t *Disclaimer = 0; const wchar_t *Date = 0; const wchar_t *Time = 0; const wchar_t *BusinessDaysInTransit = 0; const wchar_t *PickupTime = 0; const wchar_t *DayOfWeek = 0; const wchar_t *CustomerCenterCutoff = 0; const wchar_t *DelayCount = 0; const wchar_t *HolidayCount = 0; const wchar_t *RestDays = 0; const wchar_t *TotalTransitDays = 0; const wchar_t *SaturdayDelivery = 0; const wchar_t *SaturdayDeliveryDisclaimer = 0; const wchar_t *SundayDelivery = 0; const wchar_t *SundayDeliveryDisclaimer = 0; const wchar_t *AutoDutyCode = 0; const wchar_t *TimeInTransitDisclaimer = 0; const wchar_t *ScheduledDeliveryDate = 0; const wchar_t *RoarRatedIndicator = 0; const wchar_t *SubType = 0; const wchar_t *Quantity = 0; const wchar_t *TypeCode = 0; const wchar_t *TypeDescription = 0; const wchar_t *UnitOfMeasurement = 0; const wchar_t *Length = 0; const wchar_t *Width = 0; const wchar_t *Height = 0; const wchar_t *AdjustedHeightValue = 0; const wchar_t *AdjustedHeightUnitOfMeasurement = 0; const wchar_t *v_Type = 0; const wchar_t *TransportationChargesCurrencyCode = 0; const wchar_t *TransportationChargesMonetaryValue = 0; const wchar_t *BillingWeightWeight = 0; const wchar_t *SimpleRateCode = 0; int k; int count_k; bool nullVal; const wchar_t *ModifierType = 0; const wchar_t *ModifierDesc = 0; const wchar_t *Amount = 0; const wchar_t *Code = jResp.stringOf(L"RateResponse.Response.ResponseStatus.Code"); const wchar_t *Description = jResp.stringOf(L"RateResponse.Response.ResponseStatus.Description"); const wchar_t *CustomerContext = jResp.stringOf(L"RateResponse.Response.TransactionReference.CustomerContext"); int i = 0; int count_i = jResp.SizeOfArray(L"RateResponse.Response.Alert"); while (i < count_i) { jResp.put_I(i); Code = jResp.stringOf(L"RateResponse.Response.Alert[i].Code"); Description = jResp.stringOf(L"RateResponse.Response.Alert[i].Description"); i = i + 1; } i = 0; count_i = jResp.SizeOfArray(L"RateResponse.Response.AlertDetail"); while (i < count_i) { jResp.put_I(i); Code = jResp.stringOf(L"RateResponse.Response.AlertDetail[i].Code"); Description = jResp.stringOf(L"RateResponse.Response.AlertDetail[i].Description"); Level = jResp.stringOf(L"RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level"); j = 0; count_j = jResp.SizeOfArray(L"RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier"); while (j < count_j) { jResp.put_J(j); Code = jResp.stringOf(L"RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code"); Value = jResp.stringOf(L"RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value"); j = j + 1; } i = i + 1; } i = 0; count_i = jResp.SizeOfArray(L"RateResponse.RatedShipment"); while (i < count_i) { jResp.put_I(i); ServiceCode = jResp.stringOf(L"RateResponse.RatedShipment[i].Service.Code"); ServiceDescription = jResp.stringOf(L"RateResponse.RatedShipment[i].Service.Description"); RateChart = jResp.stringOf(L"RateResponse.RatedShipment[i].RateChart"); BillableWeightCalculationMethod = jResp.stringOf(L"RateResponse.RatedShipment[i].BillableWeightCalculationMethod"); RatingMethod = jResp.stringOf(L"RateResponse.RatedShipment[i].RatingMethod"); UnitOfMeasurementCode = jResp.stringOf(L"RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code"); UnitOfMeasurementDescription = jResp.stringOf(L"RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description"); Weight = jResp.stringOf(L"RateResponse.RatedShipment[i].BillingWeight.Weight"); CurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue"); BaseServiceChargeCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode"); BaseServiceChargeMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue"); GrossChargeCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode"); GrossChargeMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue"); DiscountAmountCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode"); DiscountAmountMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue"); DiscountPercentage = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage"); NetChargeCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode"); NetChargeMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue"); Density = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density"); TotalCubicFeet = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet"); ServiceOptionsChargesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode"); ServiceOptionsChargesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue"); TotalChargesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].TotalCharges.CurrencyCode"); TotalChargesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].TotalCharges.MonetaryValue"); TotalChargesWithTaxesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode"); TotalChargesWithTaxesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue"); TotalChargeCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode"); TotalChargeMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue"); TotalChargesWithTaxesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode"); TotalChargesWithTaxesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue"); PickupDate = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.PickupDate"); DocumentsOnlyIndicator = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator"); PackageBillType = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.PackageBillType"); ServiceDescription = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description"); GuaranteedIndicator = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator"); Disclaimer = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer"); Date = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date"); Time = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time"); BusinessDaysInTransit = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit"); PickupDate = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date"); PickupTime = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time"); DayOfWeek = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek"); CustomerCenterCutoff = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff"); DelayCount = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount"); HolidayCount = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount"); RestDays = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays"); TotalTransitDays = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays"); SaturdayDelivery = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery"); SaturdayDeliveryDisclaimer = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer"); SundayDelivery = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery"); SundayDeliveryDisclaimer = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer"); AutoDutyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode"); TimeInTransitDisclaimer = jResp.stringOf(L"RateResponse.RatedShipment[i].TimeInTransit.Disclaimer"); ScheduledDeliveryDate = jResp.stringOf(L"RateResponse.RatedShipment[i].ScheduledDeliveryDate"); RoarRatedIndicator = jResp.stringOf(L"RateResponse.RatedShipment[i].RoarRatedIndicator"); j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].Disclaimer"); while (j < count_j) { jResp.put_J(j); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].Disclaimer[j].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].Disclaimer[j].Description"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedShipmentAlert"); while (j < count_j) { jResp.put_J(j); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].ItemizedCharges"); while (j < count_j) { jResp.put_J(j); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].ItemizedCharges[j].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].ItemizedCharges[j].Description"); CurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue"); SubType = jResp.stringOf(L"RateResponse.RatedShipment[i].ItemizedCharges[j].SubType"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits"); while (j < count_j) { jResp.put_J(j); Quantity = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity"); TypeCode = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code"); TypeDescription = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description"); UnitOfMeasurement = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement"); Length = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length"); Width = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width"); Height = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height"); AdjustedHeightValue = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value"); AdjustedHeightUnitOfMeasurement = jResp.stringOf(L"RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].TaxCharges"); while (j < count_j) { jResp.put_J(j); v_Type = jResp.stringOf(L"RateResponse.RatedShipment[i].TaxCharges[j].Type"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges"); while (j < count_j) { jResp.put_J(j); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description"); CurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue"); SubType = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges"); while (j < count_j) { jResp.put_J(j); v_Type = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue"); j = j + 1; } j = 0; count_j = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedPackage"); while (j < count_j) { jResp.put_J(j); BaseServiceChargeCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode"); BaseServiceChargeMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue"); TransportationChargesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode"); TransportationChargesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue"); ServiceOptionsChargesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode"); ServiceOptionsChargesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue"); TotalChargesCurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode"); TotalChargesMonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue"); Weight = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].Weight"); UnitOfMeasurementCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code"); UnitOfMeasurementDescription = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description"); BillingWeightWeight = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight"); SimpleRateCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code"); k = 0; count_k = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedPackage[j].Accessorial"); while (k < count_k) { jResp.put_K(k); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description"); k = k + 1; } k = 0; count_k = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges"); while (k < count_k) { jResp.put_K(k); Code = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code"); Description = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description"); CurrencyCode = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode"); MonetaryValue = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue"); SubType = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType"); k = k + 1; } k = 0; count_k = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges"); while (k < count_k) { jResp.put_K(k); nullVal = jResp.IsNullOf(L"RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]"); k = k + 1; } k = 0; count_k = jResp.SizeOfArray(L"RateResponse.RatedShipment[i].RatedPackage[j].RateModifier"); while (k < count_k) { jResp.put_K(k); ModifierType = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType"); ModifierDesc = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc"); Amount = jResp.stringOf(L"RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount"); k = k + 1; } j = j + 1; } i = i + 1; } } |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.