Sample code for 30+ languages & platforms
Xbase++

UPS Rate Request

See more UPS Examples

Simple UPS Rate Example

Chilkat Xbase++ Downloads

Xbase++
LOCAL nSuccess
LOCAL oHttp
LOCAL oJson
LOCAL oJsonToken
LOCAL oResp
LOCAL oSbResponseBody
LOCAL oJResp
LOCAL nRespStatusCode
LOCAL cLevel
LOCAL j
LOCAL nCount_j
LOCAL cValue
LOCAL cServiceCode
LOCAL cServiceDescription
LOCAL cRateChart
LOCAL cBillableWeightCalculationMethod
LOCAL cRatingMethod
LOCAL cUnitOfMeasurementCode
LOCAL cUnitOfMeasurementDescription
LOCAL cWeight
LOCAL cCurrencyCode
LOCAL cMonetaryValue
LOCAL cBaseServiceChargeCurrencyCode
LOCAL cBaseServiceChargeMonetaryValue
LOCAL cGrossChargeCurrencyCode
LOCAL cGrossChargeMonetaryValue
LOCAL cDiscountAmountCurrencyCode
LOCAL cDiscountAmountMonetaryValue
LOCAL cDiscountPercentage
LOCAL cNetChargeCurrencyCode
LOCAL cNetChargeMonetaryValue
LOCAL cDensity
LOCAL cTotalCubicFeet
LOCAL cServiceOptionsChargesCurrencyCode
LOCAL cServiceOptionsChargesMonetaryValue
LOCAL cTotalChargesCurrencyCode
LOCAL cTotalChargesMonetaryValue
LOCAL cTotalChargesWithTaxesCurrencyCode
LOCAL cTotalChargesWithTaxesMonetaryValue
LOCAL cTotalChargeCurrencyCode
LOCAL cTotalChargeMonetaryValue
LOCAL cPickupDate
LOCAL cDocumentsOnlyIndicator
LOCAL cPackageBillType
LOCAL cGuaranteedIndicator
LOCAL cDisclaimer
LOCAL cDate
LOCAL cTime
LOCAL cBusinessDaysInTransit
LOCAL cPickupTime
LOCAL cDayOfWeek
LOCAL cCustomerCenterCutoff
LOCAL cDelayCount
LOCAL cHolidayCount
LOCAL cRestDays
LOCAL cTotalTransitDays
LOCAL cSaturdayDelivery
LOCAL cSaturdayDeliveryDisclaimer
LOCAL cSundayDelivery
LOCAL cSundayDeliveryDisclaimer
LOCAL cAutoDutyCode
LOCAL cTimeInTransitDisclaimer
LOCAL cScheduledDeliveryDate
LOCAL cRoarRatedIndicator
LOCAL cSubType
LOCAL cQuantity
LOCAL cTypeCode
LOCAL cTypeDescription
LOCAL cUnitOfMeasurement
LOCAL cLength
LOCAL cWidth
LOCAL cHeight
LOCAL cAdjustedHeightValue
LOCAL cAdjustedHeightUnitOfMeasurement
LOCAL cV_Type
LOCAL cTransportationChargesCurrencyCode
LOCAL cTransportationChargesMonetaryValue
LOCAL cBillingWeightWeight
LOCAL cSimpleRateCode
LOCAL k
LOCAL nCount_k
LOCAL nNullVal
LOCAL cModifierType
LOCAL cModifierDesc
LOCAL cAmount
LOCAL cCode
LOCAL cDescription
LOCAL cCustomerContext
LOCAL i
LOCAL nCount_i

nSuccess := 0

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

oHttp := CreateObject("Chilkat.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"
//          }
//        }
//      }
//    }
//  }

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

oJsonToken := CreateObject("Chilkat.JsonObject")
nSuccess := oJsonToken:LoadFile("qa_data/tokens/ups_oauth2_token.json")
IF (nSuccess != 1)
    ? "Failed to load ups_oauth2_token.json"
    oHttp:destroy()
    oJson:destroy()
    oJsonToken:destroy()
    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.
oHttp:AuthToken := oJsonToken:StringOf("access_token")
oHttp:SetRequestHeader("Content-Type", "application/json")
oHttp:SetRequestHeader("transId", "string")
oHttp: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.
oHttp: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.
oHttp:SetUrlVar("requestoption", "Rate")

oResp := CreateObject("Chilkat.HttpResponse")
nSuccess := oHttp:HttpJson("POST", "https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string", oJson, "application/json", oResp)
IF (nSuccess == 0)
    ? oHttp:LastErrorText
    oHttp:destroy()
    oJson:destroy()
    oJsonToken:destroy()
    oResp:destroy()
    RETURN
ENDIF

oSbResponseBody := CreateObject("Chilkat.StringBuilder")
oResp:GetBodySb(oSbResponseBody)

oJResp := CreateObject("Chilkat.JsonObject")
oJResp:LoadSb(oSbResponseBody)
oJResp:EmitCompact := 0

? "Response Body:"
? oJResp: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.
//  ----------------------------------------------------------------------------------------------------------

nRespStatusCode := oResp:StatusCode
? "Response Status Code = " + Str(nRespStatusCode)
IF (nRespStatusCode >= 400)
    ? "Response Header:"
    ? oResp:Header
    ? "Failed."
    oHttp:destroy()
    oJson:destroy()
    oJsonToken:destroy()
    oResp:destroy()
    oSbResponseBody:destroy()
    oJResp:destroy()
    RETURN
ENDIF

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

cCode := oJResp:StringOf("RateResponse.Response.ResponseStatus.Code")
cDescription := oJResp:StringOf("RateResponse.Response.ResponseStatus.Description")
cCustomerContext := oJResp:StringOf("RateResponse.Response.TransactionReference.CustomerContext")
i := 0
nCount_i := oJResp:SizeOfArray("RateResponse.Response.Alert")
DO WHILE i < nCount_i
    oJResp:I := i
    cCode := oJResp:StringOf("RateResponse.Response.Alert[i].Code")
    cDescription := oJResp:StringOf("RateResponse.Response.Alert[i].Description")
    i := i + 1
ENDDO
i := 0
nCount_i := oJResp:SizeOfArray("RateResponse.Response.AlertDetail")
DO WHILE i < nCount_i
    oJResp:I := i
    cCode := oJResp:StringOf("RateResponse.Response.AlertDetail[i].Code")
    cDescription := oJResp:StringOf("RateResponse.Response.AlertDetail[i].Description")
    cLevel := oJResp:StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level")
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier")
    DO WHILE j < nCount_j
        oJResp:J := j
        cCode := oJResp:StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code")
        cValue := oJResp:StringOf("RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value")
        j := j + 1
    ENDDO
    i := i + 1
ENDDO
i := 0
nCount_i := oJResp:SizeOfArray("RateResponse.RatedShipment")
DO WHILE i < nCount_i
    oJResp:I := i
    cServiceCode := oJResp:StringOf("RateResponse.RatedShipment[i].Service.Code")
    cServiceDescription := oJResp:StringOf("RateResponse.RatedShipment[i].Service.Description")
    cRateChart := oJResp:StringOf("RateResponse.RatedShipment[i].RateChart")
    cBillableWeightCalculationMethod := oJResp:StringOf("RateResponse.RatedShipment[i].BillableWeightCalculationMethod")
    cRatingMethod := oJResp:StringOf("RateResponse.RatedShipment[i].RatingMethod")
    cUnitOfMeasurementCode := oJResp:StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code")
    cUnitOfMeasurementDescription := oJResp:StringOf("RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description")
    cWeight := oJResp:StringOf("RateResponse.RatedShipment[i].BillingWeight.Weight")
    cCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode")
    cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue")
    cBaseServiceChargeCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode")
    cBaseServiceChargeMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue")
    cGrossChargeCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode")
    cGrossChargeMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue")
    cDiscountAmountCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode")
    cDiscountAmountMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue")
    cDiscountPercentage := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage")
    cNetChargeCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode")
    cNetChargeMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue")
    cDensity := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density")
    cTotalCubicFeet := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet")
    cServiceOptionsChargesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode")
    cServiceOptionsChargesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue")
    cTotalChargesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].TotalCharges.CurrencyCode")
    cTotalChargesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].TotalCharges.MonetaryValue")
    cTotalChargesWithTaxesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode")
    cTotalChargesWithTaxesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue")
    cTotalChargeCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode")
    cTotalChargeMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue")
    cTotalChargesWithTaxesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode")
    cTotalChargesWithTaxesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue")
    cPickupDate := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.PickupDate")
    cDocumentsOnlyIndicator := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator")
    cPackageBillType := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.PackageBillType")
    cServiceDescription := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description")
    cGuaranteedIndicator := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator")
    cDisclaimer := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer")
    cDate := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date")
    cTime := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time")
    cBusinessDaysInTransit := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit")
    cPickupDate := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date")
    cPickupTime := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time")
    cDayOfWeek := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek")
    cCustomerCenterCutoff := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff")
    cDelayCount := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount")
    cHolidayCount := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount")
    cRestDays := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays")
    cTotalTransitDays := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays")
    cSaturdayDelivery := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery")
    cSaturdayDeliveryDisclaimer := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer")
    cSundayDelivery := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery")
    cSundayDeliveryDisclaimer := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer")
    cAutoDutyCode := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode")
    cTimeInTransitDisclaimer := oJResp:StringOf("RateResponse.RatedShipment[i].TimeInTransit.Disclaimer")
    cScheduledDeliveryDate := oJResp:StringOf("RateResponse.RatedShipment[i].ScheduledDeliveryDate")
    cRoarRatedIndicator := oJResp:StringOf("RateResponse.RatedShipment[i].RoarRatedIndicator")
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].Disclaimer")
    DO WHILE j < nCount_j
        oJResp:J := j
        cCode := oJResp:StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Code")
        cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].Disclaimer[j].Description")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedShipmentAlert")
    DO WHILE j < nCount_j
        oJResp:J := j
        cCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code")
        cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].ItemizedCharges")
    DO WHILE j < nCount_j
        oJResp:J := j
        cCode := oJResp:StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Code")
        cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].Description")
        cCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode")
        cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue")
        cSubType := oJResp:StringOf("RateResponse.RatedShipment[i].ItemizedCharges[j].SubType")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits")
    DO WHILE j < nCount_j
        oJResp:J := j
        cQuantity := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity")
        cTypeCode := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code")
        cTypeDescription := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description")
        cUnitOfMeasurement := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement")
        cLength := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length")
        cWidth := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width")
        cHeight := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height")
        cAdjustedHeightValue := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value")
        cAdjustedHeightUnitOfMeasurement := oJResp:StringOf("RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].TaxCharges")
    DO WHILE j < nCount_j
        oJResp:J := j
        cV_Type := oJResp:StringOf("RateResponse.RatedShipment[i].TaxCharges[j].Type")
        cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges")
    DO WHILE j < nCount_j
        oJResp:J := j
        cCode := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code")
        cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description")
        cCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode")
        cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue")
        cSubType := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges")
    DO WHILE j < nCount_j
        oJResp:J := j
        cV_Type := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type")
        cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue")
        j := j + 1
    ENDDO
    j := 0
    nCount_j := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedPackage")
    DO WHILE j < nCount_j
        oJResp:J := j
        cBaseServiceChargeCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode")
        cBaseServiceChargeMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue")
        cTransportationChargesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode")
        cTransportationChargesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue")
        cServiceOptionsChargesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode")
        cServiceOptionsChargesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue")
        cTotalChargesCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode")
        cTotalChargesMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue")
        cWeight := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Weight")
        cUnitOfMeasurementCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code")
        cUnitOfMeasurementDescription := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description")
        cBillingWeightWeight := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight")
        cSimpleRateCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code")
        k := 0
        nCount_k := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial")
        DO WHILE k < nCount_k
            oJResp:K := k
            cCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code")
            cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description")
            k := k + 1
        ENDDO
        k := 0
        nCount_k := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges")
        DO WHILE k < nCount_k
            oJResp:K := k
            cCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code")
            cDescription := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description")
            cCurrencyCode := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode")
            cMonetaryValue := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue")
            cSubType := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType")
            k := k + 1
        ENDDO
        k := 0
        nCount_k := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges")
        DO WHILE k < nCount_k
            oJResp:K := k
            nNullVal := oJResp:IsNullOf("RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]")
            k := k + 1
        ENDDO
        k := 0
        nCount_k := oJResp:SizeOfArray("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier")
        DO WHILE k < nCount_k
            oJResp:K := k
            cModifierType := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType")
            cModifierDesc := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc")
            cAmount := oJResp:StringOf("RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount")
            k := k + 1
        ENDDO
        j := j + 1
    ENDDO
    i := i + 1
ENDDO

oHttp:destroy()
oJson:destroy()
oJsonToken:destroy()
oResp:destroy()
oSbResponseBody:destroy()
oJResp:destroy()