CF_USPS_Rate is a quick solution to get shipping rates from USPS-real time. The custom tag supports both US domestic shipping and international shipping originating from US. Shipping rates result is presented in query structure, so developers can extract and manipulate data from it easily.
In order to use this custom tag, you must have USPS UserID. You can register for free from: http://www.uspswebtools.com/registration/
Features
- Real-time rates from USPS, fast operation
- Get rates for both domestic and international shipping
- Works using CFMX built-in XML Parser. No 3rd party application needed. No CFX tags. Shared hosting friendly.
Just copy this custom tag in your ColdFusion working directory, and you're set
Usage
| <cf_usps_rate |
demomode="true,false, required" |
| |
userid="your USPS userid, required" |
| |
password="your USPS password, leave blank if you don't get one from USPS" |
| |
result="resulted query name, required" |
| |
CountryDest="destination country, default is: United States (Domestic Mail)" |
| |
ZipOrig="origination zip code (US). Required for domestic shipping." |
| |
ZipDest="destination zip code (US). Required for domestic shipping." |
| |
Weight="weight of the package" |
| |
WeightUnit"kg|pound" |
| |
Service="Express,First Class,Priority,Parcel,BPM,Library,Media,All. Required for domestic shipping" |
| |
Size="Regular,Large,Oversize. Required for domestic shipping" |
| |
Container="For domestic shpping: Flat Rate Envelope,Flat Rate Box. Optional" "For international shipping: package,postcards or aerogrammes,matter for the blind,envelope. Required" |
| |
Machinable="true,false. Optional"> |
Explanation:
1. Upon registering with USPS, they will create a userid for you, and set it to test mode. While your account is in testmode, set "demomode=true". USPS test mode will only allow several combination of weight,zips,service and all. Use the default values from example page to make sure the custom tag works (it should work anyway)
After you have successfuly install and test the custom tag, ask USPS to set your account to production mode. Follow the process as found in USPS welcome email. After USPS has set your account to production, set "demomode=false"
2. Password is optional. By default USPS will not send password, so you can leave this attribute to blank. 3. Domestic shipping or international shipping is determined by "CountryDest" If CountryDest="United States (Domestic Mail)" then domestic shipping is enabled, else the system will be set to international shipping. Country list can be taken from USPS website, or from the example given in this custom tag. 4. International shipping will be calculated from US origin. 5. ZipOrig and ZipDest is required for domestic (US) shipping. 6. Note on weight: the custom tag rounds up weight (without decimal). This's to make sure USPS accept the weight. 7. For doemstic shipping, combination of service, weight, size, container and machinable may resulting error from USPS. Make sure you set above values correctly. Refer to USPS documentation. 8. Result Upon successful call, the custom tag will generate a query with the following fields: Service,Rate,Restrictions,Prohibitions,Observations,CustomForms,ExpressMail,AreasServed,SvcCommitments,MaxDimensions,MaxWeight
For domestic shipping, please check the following fields: Service, Rate and Restrictions. For international shipping you will have to check all fields.
|