-
Notifications
You must be signed in to change notification settings - Fork 52
/
params.json
1 lines (1 loc) · 5.6 KB
/
params.json
1
{"name":"Stamps","body":"Stamps\r\n==========\r\n\r\nStamps is Stamps.com backed library for creating postage labels,\r\ncalculate the shipping cost of packages, standardize domestic\r\naddresses via USPS CASS certified Address Matching Software, and track\r\nshipments.\r\n\r\nMain Features\r\n----------\r\n\r\n1. Create postage stamp labels in png and pdf formats.\r\n\r\n2. Standardizes shipping address that complies with the USPS address\r\nformatting guidelines.\r\n\r\n3. Validates city, state, and postal code combinations.\r\n\r\n4. Calculate shipping rates based on distance and package weight.\r\n\r\n5. Request USPS carrier pick ups.\r\n\r\n6. Track shipment history.\r\n\r\n7. Purchase postage.\r\n\r\nPre-requisites\r\n----------\r\nRegister for the Stamps.com [Developer\r\nProgram](http://developer.stamps.com/developer) to receive a free\r\ntest account.\r\n\r\nSample Workflow\r\n----------\r\n\r\n1. Standardize Shipping Address - Ship-to addresses must be\r\nstandardized based on USPS rules for proper address conventions before\r\na shipping label can be issued.\r\n\r\n2. Get Rates - allow users to view and select the best shipping\r\nservice for their needs.\r\n\r\n3. Generate the Shipping Label - after choosing a shipping\r\nservice and ship-to address is standardized, the `Stamps.create` method\r\nwill generate the indicium required to ship the item. If\r\nthe customer changes their mind, they may want to select an option\r\nthat initiates a `Stamps.cancel`. `Stamps.cancel` refunds postage and\r\nvoids the shipping label.\r\n\r\n4. Print the Shipping Label - Call the returned URL to obtain the shipping label image.\r\nA URL is returned by the `Stamps.create` call in the :url item. The\r\nintegration will connect to this URL to retrieve their shipping label\r\nand customs forms for printing.\r\n\r\nGetting Started\r\n----------\r\nOnce you have a test account with integration id, we can simple pass\r\nthem to the configure block:\r\n\r\n # Authenticate you stamps.com credentials\r\n Stamps.configure do |config|\r\n config.integration_id = 'XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXXX'\r\n config.username = 'STAMPS USERNAME'\r\n config.password = 'STAMPS PASSWORD'\r\n end\r\n\r\nNow we can now be able to retrieve information about our account:\r\n\r\n Stamps.account\r\n\r\nStandardized Shipping Address\r\n----------\r\nStandardizes shipping address that complies with the USPS address\r\nformatting guidelines\r\n\r\n standardized_address = Stamps.clean_address(\r\n :address => {\r\n :full_name => 'The White House',\r\n :address1 => '1600 Pennsylvania Avenue, NW',\r\n :city => 'Washington',\r\n :state => 'DC',\r\n :zip_code => '20500'\r\n })\r\n\r\nGet Rates\r\n----------\r\nTo get a list of rates for all available USPS services based on the\r\nZIP Code or the foreign country being shipped to for a given package\r\nweight and size.\r\n\r\n rates = Stamps.get_rates(\r\n :from_zip_code => '45440',\r\n :to_zip_code => '20500',\r\n :weight_lb => '0.5',\r\n :ship_date => '2011-04-07'\r\n )\r\n\r\nCreating a shipping label\r\n----------\r\nTo generate the postage based on the shipping information provided in the request.\r\nThe `create!` method will return a URL that references either an image of the\r\ndomestic shipping label or a multi-page PDF document for international\r\nlabels with customs forms.\r\n\r\n stamp = Stamps.create!(\r\n :tracking_number => true,\r\n :rate => rates.first,\r\n :to => standardized_address,\r\n :from => {\r\n :full_name => 'Littlelines',\r\n :address1 => '50 Chestnut Street',\r\n :address2 => 'Suite 234',\r\n :city => 'Beavervcreek',\r\n :state => 'OH',\r\n :zip_code => '45440'\r\n },\r\n :memo => 'Thanks for shopping with us!'\r\n )\r\n\r\nNow we can view or print the postage label:\r\n\r\n stamp.url\r\n\r\nGeneral Configuration\r\n----------\r\nIf you want to see the data logged to and from the api:\r\n\r\n Stamps.configure do |config|\r\n config.log_messages = true\r\n end\r\n\r\nBy default Stamps will return responses as a Hash. To make Stamps\r\nreturn a Hashie instead:\r\n\r\n Stamps.configure do |config|\r\n config.format = :hashie\r\n end\r\n\r\nA return address can be specified in the configuration block as\r\nwell. This address will be used when the :from address is not specified\r\nwhen creating new stamps\r\n\r\n Stamps.configure do |config|\r\n config.return_address = {\r\n :full_name => 'Littlelines',\r\n :address1 => '50 Chestnut Street',\r\n :address2 => 'Suite 234',\r\n :city => 'Beavercreek',\r\n :state => 'OH',\r\n :zip_code => '45440',\r\n :phone_number => '9375545027'\r\n }\r\n end\r\n\r\nInstallation Steps\r\n----------\r\nFirst install the gem:\r\n\r\n gem install stamps\r\n\r\nAdd it to your Gemfile:\r\n\r\n gem 'stamps'\r\n\r\nDevelopment\r\n-----------\r\n\r\n* Source hosted at [GitHub](https://github.com/mattsears/stamps).\r\n* Report Issues/Questions/Feature requests on [GitHub Issues](https://github.com/mattsears/stamps/issues).\r\n\r\nPull requests are very welcome! Make sure your patches are well tested. Please create a topic branch for every separate change\r\nyou make.\r\n\r\nAuthor\r\n------\r\n[Matt Sears](https://github.com/mattsears)\r\n","tagline":"Print stamps with Ruby! ","google":"","note":"Don't delete this file! It's used internally to help with page regeneration."}