Chilkat Examples

ChilkatHOME.NET Core C#Android™AutoItCC#C++Chilkat2-PythonCkPythonClassic ASPDataFlexDelphi ActiveXDelphi DLLGoJavaLianjaMono C#Node.jsObjective-CPHP ActiveXPHP ExtensionPerlPowerBuilderPowerShellPureBasicRubySQL ServerSwift 2Swift 3,4,5...TclUnicode CUnicode C++VB.NETVBScriptVisual Basic 6.0Visual FoxProXojo Plugin

Tcl Web API Examples

Primary Categories

ABN AMRO
AWS Secrets Manager
AWS Security Token Service
AWS Translate
Activix CRM
Adyen
Alibaba Cloud OSS
Amazon Cognito
Amazon DynamoDB
Amazon MWS
Amazon Pay
Amazon Rekognition
Amazon SP-API
Amazon Voice ID
Aruba Fatturazione
Azure Maps
Azure Monitor
Azure OAuth2
Azure Storage Accounts
Backblaze S3
Banco Inter
Belgian eHealth Platform
Bitfinex v2 REST
Bluzone
BrickLink
Bunny CDN
CallRail
CardConnect
Cerved
ClickBank
Clickatell
Cloudfare
Constant Contact
DocuSign
Duo Auth MFA
ETrade
Ecwid
Egypt ITIDA
Egypt eReceipt
Etsy
Facebook
Faire
Frame.io
GeoOp
GetHarvest
Global Payments
Google People
Google Search Console
Google Translate
Google Vision
Hungary NAV Invoicing
IBM Text to Speech
Ibanity
IntakeQ
JCC Cyprus
Jira
Lightspeed
MYOB
Magento
Mailgun
Malaysia MyInvois

Mastercard
MedTunnel
MercadoLibre
MessageMedia
Microsoft Calendar
Microsoft Group
Microsoft Tasks and Plans
Microsoft Teams
Moody's
Okta OAuth/OIDC
OneLogin OIDC
OneNote
OpenAI ChatGPT
PRODA
PayPal
Paynow.pl
Peoplevox
Populi
QuickBooks
Rabobank
Refinitiv
Royal Mail OBA
SCiS Schools Catalogue
SII Chile
SMSAPI
SOAP finkok.com
Salesforce
SendGrid
Shippo
Shopify
Shopware
Shopware 6
SimpleTexting
Square
Stripe
SugarCRM
TicketBAI
TikTok Shop
Trello
Twilio
Twitter API v2
Twitter v1
UPS
UniPin
VoiceBase
Vonage
WaTrend
Walmart v3
Wasabi
WhatsApp
WiX
WooCommerce
WordPress
Xero
Yahoo Mail
Yapily
Yousign
ZATCA
Zendesk
Zoom
_Miscellaneous_
eBay
effectconnect
hacienda.go.cr

 

 

 

(Tcl) UPS Rate Request

See more UPS Examples

Simple UPS Rate Example

For more information, see https://developer.ups.com/api/reference?loc=en_US#operation/Rate

Chilkat Tcl Extension Downloads

Chilkat Tcl Extension Downloads

load ./chilkat.dll

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

set http [new_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"
#         }
#       }
#     }
#   }
# }

set json [new_CkJsonObject]

CkJsonObject_UpdateString $json "RateRequest.Request.TransactionReference.CustomerContext" "CustomerContext"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Name" "ShipperName"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.ShipperNumber" "ShipperNumber"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.AddressLine[0]" "ShipperAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.AddressLine[1]" "ShipperAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.AddressLine[2]" "ShipperAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.City" "TIMONIUM"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.StateProvinceCode" "MD"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.PostalCode" "21093"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Shipper.Address.CountryCode" "US"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Name" "ShipToName"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.AddressLine[0]" "ShipToAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.AddressLine[1]" "ShipToAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.AddressLine[2]" "ShipToAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.City" "Alpharetta"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.StateProvinceCode" "GA"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.PostalCode" "30005"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipTo.Address.CountryCode" "US"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Name" "ShipFromName"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.AddressLine[0]" "ShipFromAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.AddressLine[1]" "ShipFromAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.AddressLine[2]" "ShipFromAddressLine"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.City" "TIMONIUM"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.StateProvinceCode" "MD"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.PostalCode" "21093"
CkJsonObject_UpdateString $json "RateRequest.Shipment.ShipFrom.Address.CountryCode" "US"
CkJsonObject_UpdateString $json "RateRequest.Shipment.PaymentDetails.ShipmentCharge.Type" "01"
CkJsonObject_UpdateString $json "RateRequest.Shipment.PaymentDetails.ShipmentCharge.BillShipper.AccountNumber" "ShipperNumber"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Service.Code" "03"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Service.Description" "Ground"
CkJsonObject_UpdateString $json "RateRequest.Shipment.NumOfPieces" "1"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.PackagingType.Code" "02"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.PackagingType.Description" "Packaging"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Code" "IN"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.Dimensions.UnitOfMeasurement.Description" "Inches"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.Dimensions.Length" "5"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.Dimensions.Width" "5"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.Dimensions.Height" "5"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Code" "LBS"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.PackageWeight.UnitOfMeasurement.Description" "Pounds"
CkJsonObject_UpdateString $json "RateRequest.Shipment.Package.PackageWeight.Weight" "1"

# Load the OAuth2 access token obtained via client credentials as shown 
# in this UPS OAuth2 Client Credentials example.

set jsonToken [new_CkJsonObject]

set success [CkJsonObject_LoadFile $jsonToken "qa_data/tokens/ups_oauth2_token.json"]
if {$success != 1} then {
    puts "Failed to load ups_oauth2_token.json"
    delete_CkHttp $http
    delete_CkJsonObject $json
    delete_CkJsonObject $jsonToken
    exit
}

# 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.
CkHttp_put_AuthToken $http [CkJsonObject_stringOf $jsonToken "access_token"]
CkHttp_SetRequestHeader $http "Content-Type" "application/json"
CkHttp_SetRequestHeader $http "transId" "string"
CkHttp_SetRequestHeader $http "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.
CkHttp_SetUrlVar $http "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.
CkHttp_SetUrlVar $http "requestoption" "Rate"

# resp is a CkHttpResponse
set resp [CkHttp_PostJson3 $http "https://wwwcie.ups.com/api/rating/{$version}/{$requestoption}?additionalinfo=string" "application/json" $json]
if {[CkHttp_get_LastMethodSuccess $http] == 0} then {
    puts [CkHttp_lastErrorText $http]
    delete_CkHttp $http
    delete_CkJsonObject $json
    delete_CkJsonObject $jsonToken
    exit
}

set sbResponseBody [new_CkStringBuilder]

CkHttpResponse_GetBodySb $resp $sbResponseBody

set jResp [new_CkJsonObject]

CkJsonObject_LoadSb $jResp $sbResponseBody
CkJsonObject_put_EmitCompact $jResp 0

puts "Response Body:"
puts [CkJsonObject_emit $jResp]

# ----------------------------------------------------------------------------------------------------------
# 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.
# ----------------------------------------------------------------------------------------------------------

set respStatusCode [CkHttpResponse_get_StatusCode $resp]
puts "Response Status Code = $respStatusCode"
if {$respStatusCode >= 400} then {
    puts "Response Header:"
    puts [CkHttpResponse_header $resp]
    puts "Failed."
    delete_CkHttpResponse $resp

    delete_CkHttp $http
    delete_CkJsonObject $json
    delete_CkJsonObject $jsonToken
    delete_CkStringBuilder $sbResponseBody
    delete_CkJsonObject $jResp
    exit
}

delete_CkHttpResponse $resp

# Sample JSON response:
# (Sample code for parsing the JSON response is shown below)

# {
#   "RateResponse": {
#     "Response": {
#       "ResponseStatus": {
#         "Code": "s",
#         "Description": "string"
#       },
#       "Alert": [
#         {
#           "Code": "string",
#           "Description": "string"
#         }
#       ],
#       "AlertDetail": [
#         {
#           "Code": "string",
#           "Description": "string",
#           "ElementLevelInformation": {
#             "Level": "s",
#             "ElementIdentifier": [
#               {
#                 "Code": null,
#                 "Value": null
#               }
#             ]
#           }
#         }
#       ],
#       "TransactionReference": {
#         "CustomerContext": "string"
#       }
#     },
#     "RatedShipment": [
#       {
#         "Disclaimer": [
#           {
#             "Code": "st",
#             "Description": "string"
#           }
#         ],
#         "Service": {
#           "Code": "str",
#           "Description": "string"
#         },
#         "RateChart": "s",
#         "RatedShipmentAlert": [
#           {
#             "Code": "string",
#             "Description": "string"
#           }
#         ],
#         "BillableWeightCalculationMethod": "st",
#         "RatingMethod": "st",
#         "BillingWeight": {
#           "UnitOfMeasurement": {
#             "Code": "str",
#             "Description": "string"
#           },
#           "Weight": "strin"
#         },
#         "TransportationCharges": {
#           "CurrencyCode": "str",
#           "MonetaryValue": "stringstringstri"
#         },
#         "BaseServiceCharge": {
#           "CurrencyCode": "str",
#           "MonetaryValue": "stringstringstri"
#         },
#         "ItemizedCharges": [
#           {
#             "Code": "str",
#             "Description": "string",
#             "CurrencyCode": "str",
#             "MonetaryValue": "string",
#             "SubType": "string"
#           }
#         ],
#         "FRSShipmentData": {
#           "TransportationCharges": {
#             "GrossCharge": {
#               "CurrencyCode": "str",
#               "MonetaryValue": "string"
#             },
#             "DiscountAmount": {
#               "CurrencyCode": "str",
#               "MonetaryValue": "string"
#             },
#             "DiscountPercentage": "st",
#             "NetCharge": {
#               "CurrencyCode": "str",
#               "MonetaryValue": "string"
#             }
#           },
#           "FreightDensityRate": {
#             "Density": "strin",
#             "TotalCubicFeet": "string"
#           },
#           "HandlingUnits": [
#             {
#               "Quantity": "string",
#               "Type": {
#                 "Code": null,
#                 "Description": null
#               },
#               "Dimensions": {
#                 "UnitOfMeasurement": null,
#                 "Length": null,
#                 "Width": null,
#                 "Height": null
#               },
#               "AdjustedHeight": {
#                 "Value": null,
#                 "UnitOfMeasurement": null
#               }
#             }
#           ]
#         },
#         "ServiceOptionsCharges": {
#           "CurrencyCode": "str",
#           "MonetaryValue": "string"
#         },
#         "TaxCharges": [
#           {
#             "Type": "string",
#             "MonetaryValue": "string"
#           }
#         ],
#         "TotalCharges": {
#           "CurrencyCode": "str",
#           "MonetaryValue": "string"
#         },
#         "TotalChargesWithTaxes": {
#           "CurrencyCode": "str",
#           "MonetaryValue": "string"
#         },
#         "NegotiatedRateCharges": {
#           "ItemizedCharges": [
#             {
#               "Code": "str",
#               "Description": "string",
#               "CurrencyCode": "str",
#               "MonetaryValue": "string",
#               "SubType": "string"
#             }
#           ],
#           "TaxCharges": [
#             {
#               "Type": "string",
#               "MonetaryValue": "string"
#             }
#           ],
#           "TotalCharge": {
#             "CurrencyCode": "string",
#             "MonetaryValue": "string"
#           },
#           "TotalChargesWithTaxes": {
#             "CurrencyCode": "string",
#             "MonetaryValue": "string"
#           }
#         },
#         "RatedPackage": [
#           {
#             "BaseServiceCharge": {
#               "CurrencyCode": "str",
#               "MonetaryValue": "string"
#             },
#             "TransportationCharges": {
#               "CurrencyCode": "string",
#               "MonetaryValue": "string"
#             },
#             "ServiceOptionsCharges": {
#               "CurrencyCode": "string",
#               "MonetaryValue": "string"
#             },
#             "TotalCharges": {
#               "CurrencyCode": "string",
#               "MonetaryValue": "string"
#             },
#             "Weight": "string",
#             "BillingWeight": {
#               "UnitOfMeasurement": {
#                 "Code": null,
#                 "Description": null
#               },
#               "Weight": "string"
#             },
#             "Accessorial": [
#               {
#                 "Code": null,
#                 "Description": null
#               }
#             ],
#             "ItemizedCharges": [
#               {
#                 "Code": null,
#                 "Description": null,
#                 "CurrencyCode": null,
#                 "MonetaryValue": null,
#                 "SubType": null
#               }
#             ],
#             "NegotiatedCharges": {
#               "ItemizedCharges": [
#                 null
#               ]
#             },
#             "SimpleRate": {
#               "Code": "st"
#             },
#             "RateModifier": [
#               {
#                 "ModifierType": null,
#                 "ModifierDesc": null,
#                 "Amount": null
#               }
#             ]
#           }
#         ],
#         "TimeInTransit": {
#           "PickupDate": "stringst",
#           "DocumentsOnlyIndicator": "string",
#           "PackageBillType": "st",
#           "ServiceSummary": {
#             "Service": {
#               "Description": "string"
#             },
#             "GuaranteedIndicator": "string",
#             "Disclaimer": "string",
#             "EstimatedArrival": {
#               "Arrival": {
#                 "Date": null,
#                 "Time": null
#               },
#               "BusinessDaysInTransit": "strin",
#               "Pickup": {
#                 "Date": null,
#                 "Time": null
#               },
#               "DayOfWeek": "string",
#               "CustomerCenterCutoff": "string",
#               "DelayCount": "str",
#               "HolidayCount": "st",
#               "RestDays": "st",
#               "TotalTransitDays": "strin"
#             },
#             "SaturdayDelivery": "string",
#             "SaturdayDeliveryDisclaimer": "string",
#             "SundayDelivery": "string",
#             "SundayDeliveryDisclaimer": "string"
#           },
#           "AutoDutyCode": "st",
#           "Disclaimer": "string"
#         },
#         "ScheduledDeliveryDate": "string",
#         "RoarRatedIndicator": "string"
#       }
#     ]
#   }
# }

# Sample code for parsing the JSON response...
# Use the following online tool to generate parsing code from sample JSON:
# Generate Parsing Code from JSON

set Code [CkJsonObject_stringOf $jResp "RateResponse.Response.ResponseStatus.Code"]
set Description [CkJsonObject_stringOf $jResp "RateResponse.Response.ResponseStatus.Description"]
set CustomerContext [CkJsonObject_stringOf $jResp "RateResponse.Response.TransactionReference.CustomerContext"]
set i 0
set count_i [CkJsonObject_SizeOfArray $jResp "RateResponse.Response.Alert"]
while {$i < $count_i} {
    CkJsonObject_put_I $jResp $i
    set Code [CkJsonObject_stringOf $jResp "RateResponse.Response.Alert[i].Code"]
    set Description [CkJsonObject_stringOf $jResp "RateResponse.Response.Alert[i].Description"]
    set i [expr $i + 1]
}
set i 0
set count_i [CkJsonObject_SizeOfArray $jResp "RateResponse.Response.AlertDetail"]
while {$i < $count_i} {
    CkJsonObject_put_I $jResp $i
    set Code [CkJsonObject_stringOf $jResp "RateResponse.Response.AlertDetail[i].Code"]
    set Description [CkJsonObject_stringOf $jResp "RateResponse.Response.AlertDetail[i].Description"]
    set Level [CkJsonObject_stringOf $jResp "RateResponse.Response.AlertDetail[i].ElementLevelInformation.Level"]
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Code [CkJsonObject_stringOf $jResp "RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Code"]
        set Value [CkJsonObject_stringOf $jResp "RateResponse.Response.AlertDetail[i].ElementLevelInformation.ElementIdentifier[j].Value"]
        set j [expr $j + 1]
    }
    set i [expr $i + 1]
}
set i 0
set count_i [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment"]
while {$i < $count_i} {
    CkJsonObject_put_I $jResp $i
    set ServiceCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].Service.Code"]
    set ServiceDescription [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].Service.Description"]
    set RateChart [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RateChart"]
    set BillableWeightCalculationMethod [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BillableWeightCalculationMethod"]
    set RatingMethod [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatingMethod"]
    set UnitOfMeasurementCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Code"]
    set UnitOfMeasurementDescription [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BillingWeight.UnitOfMeasurement.Description"]
    set Weight [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BillingWeight.Weight"]
    set CurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TransportationCharges.CurrencyCode"]
    set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TransportationCharges.MonetaryValue"]
    set BaseServiceChargeCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BaseServiceCharge.CurrencyCode"]
    set BaseServiceChargeMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].BaseServiceCharge.MonetaryValue"]
    set GrossChargeCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.CurrencyCode"]
    set GrossChargeMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.GrossCharge.MonetaryValue"]
    set DiscountAmountCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.CurrencyCode"]
    set DiscountAmountMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountAmount.MonetaryValue"]
    set DiscountPercentage [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.DiscountPercentage"]
    set NetChargeCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.CurrencyCode"]
    set NetChargeMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.TransportationCharges.NetCharge.MonetaryValue"]
    set Density [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.Density"]
    set TotalCubicFeet [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.FreightDensityRate.TotalCubicFeet"]
    set ServiceOptionsChargesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ServiceOptionsCharges.CurrencyCode"]
    set ServiceOptionsChargesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ServiceOptionsCharges.MonetaryValue"]
    set TotalChargesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TotalCharges.CurrencyCode"]
    set TotalChargesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TotalCharges.MonetaryValue"]
    set TotalChargesWithTaxesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TotalChargesWithTaxes.CurrencyCode"]
    set TotalChargesWithTaxesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TotalChargesWithTaxes.MonetaryValue"]
    set TotalChargeCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.CurrencyCode"]
    set TotalChargeMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalCharge.MonetaryValue"]
    set TotalChargesWithTaxesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.CurrencyCode"]
    set TotalChargesWithTaxesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TotalChargesWithTaxes.MonetaryValue"]
    set PickupDate [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.PickupDate"]
    set DocumentsOnlyIndicator [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.DocumentsOnlyIndicator"]
    set PackageBillType [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.PackageBillType"]
    set ServiceDescription [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Service.Description"]
    set GuaranteedIndicator [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.GuaranteedIndicator"]
    set Disclaimer [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.Disclaimer"]
    set Date [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Date"]
    set Time [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Arrival.Time"]
    set BusinessDaysInTransit [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.BusinessDaysInTransit"]
    set PickupDate [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Date"]
    set PickupTime [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.Pickup.Time"]
    set DayOfWeek [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DayOfWeek"]
    set CustomerCenterCutoff [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.CustomerCenterCutoff"]
    set DelayCount [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.DelayCount"]
    set HolidayCount [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.HolidayCount"]
    set RestDays [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.RestDays"]
    set TotalTransitDays [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.EstimatedArrival.TotalTransitDays"]
    set SaturdayDelivery [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDelivery"]
    set SaturdayDeliveryDisclaimer [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SaturdayDeliveryDisclaimer"]
    set SundayDelivery [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDelivery"]
    set SundayDeliveryDisclaimer [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.ServiceSummary.SundayDeliveryDisclaimer"]
    set AutoDutyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.AutoDutyCode"]
    set TimeInTransitDisclaimer [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TimeInTransit.Disclaimer"]
    set ScheduledDeliveryDate [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ScheduledDeliveryDate"]
    set RoarRatedIndicator [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RoarRatedIndicator"]
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].Disclaimer"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].Disclaimer[j].Code"]
        set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].Disclaimer[j].Description"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedShipmentAlert"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedShipmentAlert[j].Code"]
        set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedShipmentAlert[j].Description"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].ItemizedCharges"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ItemizedCharges[j].Code"]
        set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ItemizedCharges[j].Description"]
        set CurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ItemizedCharges[j].CurrencyCode"]
        set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ItemizedCharges[j].MonetaryValue"]
        set SubType [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].ItemizedCharges[j].SubType"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Quantity [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Quantity"]
        set TypeCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Code"]
        set TypeDescription [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Type.Description"]
        set UnitOfMeasurement [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.UnitOfMeasurement"]
        set Length [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Length"]
        set Width [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Width"]
        set Height [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].Dimensions.Height"]
        set AdjustedHeightValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.Value"]
        set AdjustedHeightUnitOfMeasurement [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].FRSShipmentData.HandlingUnits[j].AdjustedHeight.UnitOfMeasurement"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].TaxCharges"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set v_Type [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TaxCharges[j].Type"]
        set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].TaxCharges[j].MonetaryValue"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Code"]
        set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].Description"]
        set CurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].CurrencyCode"]
        set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].MonetaryValue"]
        set SubType [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.ItemizedCharges[j].SubType"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set v_Type [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].Type"]
        set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].NegotiatedRateCharges.TaxCharges[j].MonetaryValue"]
        set j [expr $j + 1]
    }
    set j 0
    set count_j [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedPackage"]
    while {$j < $count_j} {
        CkJsonObject_put_J $jResp $j
        set BaseServiceChargeCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.CurrencyCode"]
        set BaseServiceChargeMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].BaseServiceCharge.MonetaryValue"]
        set TransportationChargesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.CurrencyCode"]
        set TransportationChargesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].TransportationCharges.MonetaryValue"]
        set ServiceOptionsChargesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.CurrencyCode"]
        set ServiceOptionsChargesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ServiceOptionsCharges.MonetaryValue"]
        set TotalChargesCurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.CurrencyCode"]
        set TotalChargesMonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].TotalCharges.MonetaryValue"]
        set Weight [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].Weight"]
        set UnitOfMeasurementCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Code"]
        set UnitOfMeasurementDescription [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.UnitOfMeasurement.Description"]
        set BillingWeightWeight [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].BillingWeight.Weight"]
        set SimpleRateCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].SimpleRate.Code"]
        set k 0
        set count_k [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedPackage[j].Accessorial"]
        while {$k < $count_k} {
            CkJsonObject_put_K $jResp $k
            set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Code"]
            set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].Accessorial[k].Description"]
            set k [expr $k + 1]
        }
        set k 0
        set count_k [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges"]
        while {$k < $count_k} {
            CkJsonObject_put_K $jResp $k
            set Code [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Code"]
            set Description [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].Description"]
            set CurrencyCode [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].CurrencyCode"]
            set MonetaryValue [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].MonetaryValue"]
            set SubType [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].ItemizedCharges[k].SubType"]
            set k [expr $k + 1]
        }
        set k 0
        set count_k [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges"]
        while {$k < $count_k} {
            CkJsonObject_put_K $jResp $k
            set nullVal [CkJsonObject_IsNullOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].NegotiatedCharges.ItemizedCharges[k]"]
            set k [expr $k + 1]
        }
        set k 0
        set count_k [CkJsonObject_SizeOfArray $jResp "RateResponse.RatedShipment[i].RatedPackage[j].RateModifier"]
        while {$k < $count_k} {
            CkJsonObject_put_K $jResp $k
            set ModifierType [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierType"]
            set ModifierDesc [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].ModifierDesc"]
            set Amount [CkJsonObject_stringOf $jResp "RateResponse.RatedShipment[i].RatedPackage[j].RateModifier[k].Amount"]
            set k [expr $k + 1]
        }
        set j [expr $j + 1]
    }
    set i [expr $i + 1]
}

delete_CkHttp $http
delete_CkJsonObject $json
delete_CkJsonObject $jsonToken
delete_CkStringBuilder $sbResponseBody
delete_CkJsonObject $jResp

 

© 2000-2024 Chilkat Software, Inc. All Rights Reserved.