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
(Lianja) UPS Rate RequestSee more UPS ExamplesSimple UPS Rate Example For more information, see https://developer.ups.com/api/reference?loc=en_US#operation/Rate
// This example assumes the Chilkat API to have been previously unlocked. // See Global Unlock Sample for sample code. loHttp = createobject("CkHttp") // 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" // } // } // } // } // } loJson = createobject("CkJsonObject") loJson.UpdateString("RateRequest.Request.TransactionReference.CustomerContext","CustomerContext") loJson.UpdateString("RateRequest.Shipment.Shipper.Name","ShipperName") loJson.UpdateString("RateRequest.Shipment.Shipper.ShipperNumber","ShipperNumber") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[0]","ShipperAddressLine") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[1]","ShipperAddressLine") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[2]","ShipperAddressLine") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.City","TIMONIUM") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.StateProvinceCode","MD") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.PostalCode","21093") loJson.UpdateString("RateRequest.Shipment.Shipper.Address.CountryCode","US") loJson.UpdateString("RateRequest.Shipment.ShipTo.Name","ShipToName") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[0]","ShipToAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[1]","ShipToAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[2]","ShipToAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.City","Alpharetta") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.StateProvinceCode","GA") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.PostalCode","30005") loJson.UpdateString("RateRequest.Shipment.ShipTo.Address.CountryCode","US") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Name","ShipFromName") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[0]","ShipFromAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[1]","ShipFromAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[2]","ShipFromAddressLine") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.City","TIMONIUM") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.StateProvinceCode","MD") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.PostalCode","21093") loJson.UpdateString("RateRequest.Shipment.ShipFrom.Address.CountryCode","US") loJson.UpdateString("RateRequest.Shipment.PaymentDetails.ShipmentCharge.Type","01") loJson.UpdateString("RateRequest.Shipment.PaymentDetails.ShipmentCharge.BillShipper.AccountNumber","ShipperNumber") loJson.UpdateString("RateRequest.Shipment.Service.Code","03") loJson.UpdateString("RateRequest.Shipment.Service.Description","Ground") loJson.UpdateString("RateRequest.Shipment.NumOfPieces","1") loJson.UpdateString("RateRequest.Shipment.Package.PackagingType.Code","02") loJson.UpdateString("RateRequest.Shipment.Package.PackagingType.Description","Packaging") loJson.UpdateString("RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Code","IN") loJson.UpdateString("RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Description","Inches") loJson.UpdateString("RateRequest.Shipment.Package.Dimensions.Length","5") loJson.UpdateString("RateRequest.Shipment.Package.Dimensions.Width","5") loJson.UpdateString("RateRequest.Shipment.Package.Dimensions.Height","5") loJson.UpdateString("RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Code","LBS") loJson.UpdateString("RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Description","Pounds") loJson.UpdateString("RateRequest.Shipment.Package.PackageWeight.Weight","1") // Load the OAuth2 access token obtained via client credentials as shown // in this UPS OAuth2 Client Credentials example. loJsonToken = createobject("CkJsonObject") llSuccess = loJsonToken.LoadFile("qa_data/tokens/ups_oauth2_token.json") if (llSuccess <> .T.) then ? "Failed to load ups_oauth2_token.json" release loHttp release loJson release loJsonToken return endif // 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. loHttp.AuthToken = loJsonToken.StringOf("access_token") loHttp.SetRequestHeader("Content-Type","application/json") loHttp.SetRequestHeader("transId","string") loHttp.SetRequestHeader("transactionSrc","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. loHttp.SetUrlVar("version","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. loHttp.SetUrlVar("requestoption","Rate") loResp = loHttp.PostJson3("https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string","application/json",loJson) if (loHttp.LastMethodSuccess = .F.) then ? loHttp.LastErrorText release loHttp release loJson release loJsonToken return endif loSbResponseBody = createobject("CkStringBuilder") loResp.GetBodySb(loSbResponseBody) loJResp = createobject("CkJsonObject") loJResp.LoadSb(loSbResponseBody) loJResp.EmitCompact = .F. ? "Response Body:" ? loJResp.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. // ---------------------------------------------------------------------------------------------------------- lnRespStatusCode = loResp.StatusCode ? "Response Status Code = " + str(lnRespStatusCode) if (lnRespStatusCode >= 400) then ? "Response Header:" ? loResp.Header ? "Failed." release loResp release loHttp release loJson release loJsonToken release loSbResponseBody release loJResp return endif release loResp // 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 lcCode = loJResp.StringOf("RateResponse.Response.ResponseStatus.Code") lcDescription = loJResp.StringOf("RateResponse.Response.ResponseStatus.Description") lcCustomerContext = loJResp.StringOf("RateResponse.Response.TransactionReference.CustomerContext") i = 0 lnCount_i = loJResp.SizeOfArray("RateResponse.Response.Alert") do while i < lnCount_i loJResp.I = i lcCode = loJResp.StringOf("RateResponse.Response.Alert[i].Code") lcDescription = loJResp.StringOf("RateResponse.Response.Alert[i].Description") i = i + 1 enddo i = 0 lnCount_i = loJResp.SizeOfArray("RateResponse.Response.AlertDetail") do while i < lnCount_i loJResp.I = i lcCode = loJResp.StringOf("RateResponse.Response.AlertDetail[i].Code") lcDescription = loJResp.StringOf("RateResponse.Response.AlertDetail[i].Description") lcLevel = loJResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level") j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier") do while j < lnCount_j loJResp.J = j lcCode = loJResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code") lcValue = loJResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value") j = j + 1 enddo i = i + 1 enddo i = 0 lnCount_i = loJResp.SizeOfArray("RateResponse.RatedShipment") do while i < lnCount_i loJResp.I = i lcServiceCode = loJResp.StringOf("RateResponse.RatedShipment[i].Service.Code") lcServiceDescription = loJResp.StringOf("RateResponse.RatedShipment[i].Service.Description") lcRateChart = loJResp.StringOf("RateResponse.RatedShipment[i].RateChart") lcBillableWeightCalculationMethod = loJResp.StringOf("RateResponse.RatedShipment[i].BillableWeightCalculationMethod") lcRatingMethod = loJResp.StringOf("RateResponse.RatedShipment[i].RatingMethod") lcUnitOfMeasurementCode = loJResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code") lcUnitOfMeasurementDescription = loJResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description") lcWeight = loJResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.Weight") lcCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue") lcBaseServiceChargeCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode") lcBaseServiceChargeMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue") lcGrossChargeCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode") lcGrossChargeMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue") lcDiscountAmountCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode") lcDiscountAmountMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue") lcDiscountPercentage = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage") lcNetChargeCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode") lcNetChargeMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue") lcDensity = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density") lcTotalCubicFeet = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet") lcServiceOptionsChargesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode") lcServiceOptionsChargesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue") lcTotalChargesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].TotalCharges.CurrencyCode") lcTotalChargesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].TotalCharges.MonetaryValue") lcTotalChargesWithTaxesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode") lcTotalChargesWithTaxesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue") lcTotalChargeCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode") lcTotalChargeMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue") lcTotalChargesWithTaxesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode") lcTotalChargesWithTaxesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue") lcPickupDate = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.PickupDate") lcDocumentsOnlyIndicator = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator") lcPackageBillType = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.PackageBillType") lcServiceDescription = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description") lcGuaranteedIndicator = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator") lcDisclaimer = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer") lcDate = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date") lcTime = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time") lcBusinessDaysInTransit = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit") lcPickupDate = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date") lcPickupTime = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time") lcDayOfWeek = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek") lcCustomerCenterCutoff = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff") lcDelayCount = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount") lcHolidayCount = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount") lcRestDays = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays") lcTotalTransitDays = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays") lcSaturdayDelivery = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery") lcSaturdayDeliveryDisclaimer = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer") lcSundayDelivery = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery") lcSundayDeliveryDisclaimer = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer") lcAutoDutyCode = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode") lcTimeInTransitDisclaimer = loJResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.Disclaimer") lcScheduledDeliveryDate = loJResp.StringOf("RateResponse.RatedShipment[i].ScheduledDeliveryDate") lcRoarRatedIndicator = loJResp.StringOf("RateResponse.RatedShipment[i].RoarRatedIndicator") j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].Disclaimer") do while j < lnCount_j loJResp.J = j lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Description") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedShipmentAlert") do while j < lnCount_j loJResp.J = j lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].ItemizedCharges") do while j < lnCount_j loJResp.J = j lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Description") lcCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue") lcSubType = loJResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].SubType") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits") do while j < lnCount_j loJResp.J = j lcQuantity = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity") lcTypeCode = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code") lcTypeDescription = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description") lcUnitOfMeasurement = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement") lcLength = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length") lcWidth = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width") lcHeight = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height") lcAdjustedHeightValue = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value") lcAdjustedHeightUnitOfMeasurement = loJResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].TaxCharges") do while j < lnCount_j loJResp.J = j lcV_Type = loJResp.StringOf("RateResponse.RatedShipment[i].TaxCharges[j].Type") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges") do while j < lnCount_j loJResp.J = j lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description") lcCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue") lcSubType = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges") do while j < lnCount_j loJResp.J = j lcV_Type = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue") j = j + 1 enddo j = 0 lnCount_j = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage") do while j < lnCount_j loJResp.J = j lcBaseServiceChargeCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode") lcBaseServiceChargeMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue") lcTransportationChargesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode") lcTransportationChargesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue") lcServiceOptionsChargesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode") lcServiceOptionsChargesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue") lcTotalChargesCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode") lcTotalChargesMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue") lcWeight = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Weight") lcUnitOfMeasurementCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code") lcUnitOfMeasurementDescription = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description") lcBillingWeightWeight = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight") lcSimpleRateCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code") k = 0 lnCount_k = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial") do while k < lnCount_k loJResp.K = k lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description") k = k + 1 enddo k = 0 lnCount_k = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges") do while k < lnCount_k loJResp.K = k lcCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code") lcDescription = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description") lcCurrencyCode = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode") lcMonetaryValue = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue") lcSubType = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType") k = k + 1 enddo k = 0 lnCount_k = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges") do while k < lnCount_k loJResp.K = k llNullVal = loJResp.IsNullOf("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]") k = k + 1 enddo k = 0 lnCount_k = loJResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier") do while k < lnCount_k loJResp.K = k lcModifierType = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType") lcModifierDesc = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc") lcAmount = loJResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount") k = k + 1 enddo j = j + 1 enddo i = i + 1 enddo release loHttp release loJson release loJsonToken release loSbResponseBody release loJResp |
© 2000-2024 Chilkat Software, Inc. All Rights Reserved.