Sample code for 30+ languages & platforms
PowerBuilder

UPS Rate Request

See more UPS Examples

Simple UPS Rate Example

Chilkat PowerBuilder Downloads

PowerBuilder
integer li_rc
integer li_Success
oleobject loo_Http
oleobject loo_Json
oleobject loo_JsonToken
oleobject loo_Resp
oleobject loo_SbResponseBody
oleobject loo_JResp
integer li_RespStatusCode
string ls_Level
integer j
integer li_Count_j
string ls_Value
string ls_ServiceCode
string ls_ServiceDescription
string ls_RateChart
string ls_BillableWeightCalculationMethod
string ls_RatingMethod
string ls_UnitOfMeasurementCode
string ls_UnitOfMeasurementDescription
string ls_Weight
string ls_CurrencyCode
string ls_MonetaryValue
string ls_BaseServiceChargeCurrencyCode
string ls_BaseServiceChargeMonetaryValue
string ls_GrossChargeCurrencyCode
string ls_GrossChargeMonetaryValue
string ls_DiscountAmountCurrencyCode
string ls_DiscountAmountMonetaryValue
string ls_DiscountPercentage
string ls_NetChargeCurrencyCode
string ls_NetChargeMonetaryValue
string ls_Density
string ls_TotalCubicFeet
string ls_ServiceOptionsChargesCurrencyCode
string ls_ServiceOptionsChargesMonetaryValue
string ls_TotalChargesCurrencyCode
string ls_TotalChargesMonetaryValue
string ls_TotalChargesWithTaxesCurrencyCode
string ls_TotalChargesWithTaxesMonetaryValue
string ls_TotalChargeCurrencyCode
string ls_TotalChargeMonetaryValue
string ls_PickupDate
string ls_DocumentsOnlyIndicator
string ls_PackageBillType
string ls_GuaranteedIndicator
string ls_Disclaimer
string ls_Date
string ls_Time
string ls_BusinessDaysInTransit
string ls_PickupTime
string ls_DayOfWeek
string ls_CustomerCenterCutoff
string ls_DelayCount
string ls_HolidayCount
string ls_RestDays
string ls_TotalTransitDays
string ls_SaturdayDelivery
string ls_SaturdayDeliveryDisclaimer
string ls_SundayDelivery
string ls_SundayDeliveryDisclaimer
string ls_AutoDutyCode
string ls_TimeInTransitDisclaimer
string ls_ScheduledDeliveryDate
string ls_RoarRatedIndicator
string ls_SubType
string ls_Quantity
string ls_TypeCode
string ls_TypeDescription
string ls_UnitOfMeasurement
string ls_Length
string ls_Width
string ls_Height
string ls_AdjustedHeightValue
string ls_AdjustedHeightUnitOfMeasurement
string ls_V_Type
string ls_TransportationChargesCurrencyCode
string ls_TransportationChargesMonetaryValue
string ls_BillingWeightWeight
string ls_SimpleRateCode
integer k
integer li_Count_k
integer li_NullVal
string ls_ModifierType
string ls_ModifierDesc
string ls_Amount
string ls_Code
string ls_Description
string ls_CustomerContext
integer i
integer li_Count_i

li_Success = 0

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Http = create oleobject
li_rc = loo_Http.ConnectToNewObject("Chilkat.Http")
if li_rc < 0 then
    destroy loo_Http
    MessageBox("Error","Connecting to COM object failed")
    return
end if

// 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"
//         }
//       }
//     }
//   }
// }

loo_Json = create oleobject
li_rc = loo_Json.ConnectToNewObject("Chilkat.JsonObject")

loo_Json.UpdateString("RateRequest.Request.TransactionReference.CustomerContext","CustomerContext")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Name","ShipperName")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.ShipperNumber","ShipperNumber")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[0]","ShipperAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[1]","ShipperAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.AddressLine[2]","ShipperAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.City","TIMONIUM")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.StateProvinceCode","MD")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.PostalCode","21093")
loo_Json.UpdateString("RateRequest.Shipment.Shipper.Address.CountryCode","US")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Name","ShipToName")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[0]","ShipToAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[1]","ShipToAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.AddressLine[2]","ShipToAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.City","Alpharetta")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.StateProvinceCode","GA")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.PostalCode","30005")
loo_Json.UpdateString("RateRequest.Shipment.ShipTo.Address.CountryCode","US")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Name","ShipFromName")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[0]","ShipFromAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[1]","ShipFromAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.AddressLine[2]","ShipFromAddressLine")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.City","TIMONIUM")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.StateProvinceCode","MD")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.PostalCode","21093")
loo_Json.UpdateString("RateRequest.Shipment.ShipFrom.Address.CountryCode","US")
loo_Json.UpdateString("RateRequest.Shipment.PaymentDetails.ShipmentCharge.Type","01")
loo_Json.UpdateString("RateRequest.Shipment.PaymentDetails.ShipmentCharge.BillShipper.AccountNumber","ShipperNumber")
loo_Json.UpdateString("RateRequest.Shipment.Service.Code","03")
loo_Json.UpdateString("RateRequest.Shipment.Service.Description","Ground")
loo_Json.UpdateString("RateRequest.Shipment.NumOfPieces","1")
loo_Json.UpdateString("RateRequest.Shipment.Package.PackagingType.Code","02")
loo_Json.UpdateString("RateRequest.Shipment.Package.PackagingType.Description","Packaging")
loo_Json.UpdateString("RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Code","IN")
loo_Json.UpdateString("RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Description","Inches")
loo_Json.UpdateString("RateRequest.Shipment.Package.Dimensions.Length","5")
loo_Json.UpdateString("RateRequest.Shipment.Package.Dimensions.Width","5")
loo_Json.UpdateString("RateRequest.Shipment.Package.Dimensions.Height","5")
loo_Json.UpdateString("RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Code","LBS")
loo_Json.UpdateString("RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Description","Pounds")
loo_Json.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.

loo_JsonToken = create oleobject
li_rc = loo_JsonToken.ConnectToNewObject("Chilkat.JsonObject")

li_Success = loo_JsonToken.LoadFile("qa_data/tokens/ups_oauth2_token.json")
if li_Success <> 1 then
    Write-Debug "Failed to load ups_oauth2_token.json"
    destroy loo_Http
    destroy loo_Json
    destroy loo_JsonToken
    return
end if

// 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.
loo_Http.AuthToken = loo_JsonToken.StringOf("access_token")
loo_Http.SetRequestHeader("Content-Type","application/json")
loo_Http.SetRequestHeader("transId","string")
loo_Http.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.
loo_Http.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.
loo_Http.SetUrlVar("requestoption","Rate")

loo_Resp = create oleobject
li_rc = loo_Resp.ConnectToNewObject("Chilkat.HttpResponse")

li_Success = loo_Http.HttpJson("POST","https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string",loo_Json,"application/json",loo_Resp)
if li_Success = 0 then
    Write-Debug loo_Http.LastErrorText
    destroy loo_Http
    destroy loo_Json
    destroy loo_JsonToken
    destroy loo_Resp
    return
end if

loo_SbResponseBody = create oleobject
li_rc = loo_SbResponseBody.ConnectToNewObject("Chilkat.StringBuilder")

loo_Resp.GetBodySb(loo_SbResponseBody)

loo_JResp = create oleobject
li_rc = loo_JResp.ConnectToNewObject("Chilkat.JsonObject")

loo_JResp.LoadSb(loo_SbResponseBody)
loo_JResp.EmitCompact = 0

Write-Debug "Response Body:"
Write-Debug loo_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.
// ----------------------------------------------------------------------------------------------------------

li_RespStatusCode = loo_Resp.StatusCode
Write-Debug "Response Status Code = " + string(li_RespStatusCode)
if li_RespStatusCode >= 400 then
    Write-Debug "Response Header:"
    Write-Debug loo_Resp.Header
    Write-Debug "Failed."
    destroy loo_Http
    destroy loo_Json
    destroy loo_JsonToken
    destroy loo_Resp
    destroy loo_SbResponseBody
    destroy loo_JResp
    return
end if

// 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

ls_Code = loo_JResp.StringOf("RateResponse.Response.ResponseStatus.Code")
ls_Description = loo_JResp.StringOf("RateResponse.Response.ResponseStatus.Description")
ls_CustomerContext = loo_JResp.StringOf("RateResponse.Response.TransactionReference.CustomerContext")
i = 0
li_Count_i = loo_JResp.SizeOfArray("RateResponse.Response.Alert")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Code = loo_JResp.StringOf("RateResponse.Response.Alert[i].Code")
    ls_Description = loo_JResp.StringOf("RateResponse.Response.Alert[i].Description")
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("RateResponse.Response.AlertDetail")
do while i < li_Count_i
    loo_JResp.I = i
    ls_Code = loo_JResp.StringOf("RateResponse.Response.AlertDetail[i].Code")
    ls_Description = loo_JResp.StringOf("RateResponse.Response.AlertDetail[i].Description")
    ls_Level = loo_JResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Code = loo_JResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code")
        ls_Value = loo_JResp.StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value")
        j = j + 1
    loop
    i = i + 1
loop
i = 0
li_Count_i = loo_JResp.SizeOfArray("RateResponse.RatedShipment")
do while i < li_Count_i
    loo_JResp.I = i
    ls_ServiceCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].Service.Code")
    ls_ServiceDescription = loo_JResp.StringOf("RateResponse.RatedShipment[i].Service.Description")
    ls_RateChart = loo_JResp.StringOf("RateResponse.RatedShipment[i].RateChart")
    ls_BillableWeightCalculationMethod = loo_JResp.StringOf("RateResponse.RatedShipment[i].BillableWeightCalculationMethod")
    ls_RatingMethod = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatingMethod")
    ls_UnitOfMeasurementCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code")
    ls_UnitOfMeasurementDescription = loo_JResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description")
    ls_Weight = loo_JResp.StringOf("RateResponse.RatedShipment[i].BillingWeight.Weight")
    ls_CurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode")
    ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue")
    ls_BaseServiceChargeCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode")
    ls_BaseServiceChargeMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue")
    ls_GrossChargeCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode")
    ls_GrossChargeMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue")
    ls_DiscountAmountCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode")
    ls_DiscountAmountMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue")
    ls_DiscountPercentage = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage")
    ls_NetChargeCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode")
    ls_NetChargeMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue")
    ls_Density = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density")
    ls_TotalCubicFeet = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet")
    ls_ServiceOptionsChargesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode")
    ls_ServiceOptionsChargesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue")
    ls_TotalChargesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].TotalCharges.CurrencyCode")
    ls_TotalChargesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].TotalCharges.MonetaryValue")
    ls_TotalChargesWithTaxesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode")
    ls_TotalChargesWithTaxesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue")
    ls_TotalChargeCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode")
    ls_TotalChargeMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue")
    ls_TotalChargesWithTaxesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode")
    ls_TotalChargesWithTaxesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue")
    ls_PickupDate = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.PickupDate")
    ls_DocumentsOnlyIndicator = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator")
    ls_PackageBillType = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.PackageBillType")
    ls_ServiceDescription = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description")
    ls_GuaranteedIndicator = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator")
    ls_Disclaimer = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer")
    ls_Date = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date")
    ls_Time = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time")
    ls_BusinessDaysInTransit = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit")
    ls_PickupDate = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date")
    ls_PickupTime = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time")
    ls_DayOfWeek = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek")
    ls_CustomerCenterCutoff = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff")
    ls_DelayCount = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount")
    ls_HolidayCount = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount")
    ls_RestDays = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays")
    ls_TotalTransitDays = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays")
    ls_SaturdayDelivery = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery")
    ls_SaturdayDeliveryDisclaimer = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer")
    ls_SundayDelivery = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery")
    ls_SundayDeliveryDisclaimer = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer")
    ls_AutoDutyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode")
    ls_TimeInTransitDisclaimer = loo_JResp.StringOf("RateResponse.RatedShipment[i].TimeInTransit.Disclaimer")
    ls_ScheduledDeliveryDate = loo_JResp.StringOf("RateResponse.RatedShipment[i].ScheduledDeliveryDate")
    ls_RoarRatedIndicator = loo_JResp.StringOf("RateResponse.RatedShipment[i].RoarRatedIndicator")
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].Disclaimer")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Code")
        ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Description")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedShipmentAlert")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code")
        ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].ItemizedCharges")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Code")
        ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Description")
        ls_CurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode")
        ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue")
        ls_SubType = loo_JResp.StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].SubType")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Quantity = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity")
        ls_TypeCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code")
        ls_TypeDescription = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description")
        ls_UnitOfMeasurement = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement")
        ls_Length = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length")
        ls_Width = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width")
        ls_Height = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height")
        ls_AdjustedHeightValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value")
        ls_AdjustedHeightUnitOfMeasurement = loo_JResp.StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].TaxCharges")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_V_Type = loo_JResp.StringOf("RateResponse.RatedShipment[i].TaxCharges[j].Type")
        ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code")
        ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description")
        ls_CurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode")
        ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue")
        ls_SubType = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_V_Type = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type")
        ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue")
        j = j + 1
    loop
    j = 0
    li_Count_j = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage")
    do while j < li_Count_j
        loo_JResp.J = j
        ls_BaseServiceChargeCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode")
        ls_BaseServiceChargeMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue")
        ls_TransportationChargesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode")
        ls_TransportationChargesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue")
        ls_ServiceOptionsChargesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode")
        ls_ServiceOptionsChargesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue")
        ls_TotalChargesCurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode")
        ls_TotalChargesMonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue")
        ls_Weight = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Weight")
        ls_UnitOfMeasurementCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code")
        ls_UnitOfMeasurementDescription = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description")
        ls_BillingWeightWeight = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight")
        ls_SimpleRateCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code")
        k = 0
        li_Count_k = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial")
        do while k < li_Count_k
            loo_JResp.K = k
            ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code")
            ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description")
            k = k + 1
        loop
        k = 0
        li_Count_k = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges")
        do while k < li_Count_k
            loo_JResp.K = k
            ls_Code = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code")
            ls_Description = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description")
            ls_CurrencyCode = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode")
            ls_MonetaryValue = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue")
            ls_SubType = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType")
            k = k + 1
        loop
        k = 0
        li_Count_k = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges")
        do while k < li_Count_k
            loo_JResp.K = k
            li_NullVal = loo_JResp.IsNullOf("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]")
            k = k + 1
        loop
        k = 0
        li_Count_k = loo_JResp.SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier")
        do while k < li_Count_k
            loo_JResp.K = k
            ls_ModifierType = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType")
            ls_ModifierDesc = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc")
            ls_Amount = loo_JResp.StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount")
            k = k + 1
        loop
        j = j + 1
    loop
    i = i + 1
loop


destroy loo_Http
destroy loo_Json
destroy loo_JsonToken
destroy loo_Resp
destroy loo_SbResponseBody
destroy loo_JResp