Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Easypost and Stripe

Easypost and Stripe

A presentation I gave at the Ocala Ruby group about two awesome API services you should probably be using.

Jared Koumentis

August 07, 2014
Tweet

More Decks by Jared Koumentis

Other Decks in Programming

Transcript

  1. EasyPost Yup! Have you ever had to use the APIs

    from the actual shipping companies?
  2. EasyPost Yup! ! Have you ever had to use the

    APIs from the actual shipping companies?
  3. Make a shipment require 'EasyPost' EasyPost.api_key = '{YOUR API KEY}'

    shipment = EasyPost::Shipment.create( { to_address: { name: 'George Costanza', company: 'Vandelay Industries', street1: '1 E 161st St.', city: 'Bronx', state: 'NY', zip: '10451' }, from_address: { company: 'EasyPost', street1: '164 Townsend Street', street2: 'Unit 1', city: 'San Fransisco', state: 'CA', zip: '94107', phone: '415-528-7555' }, parcel: { length: 9, width: 6, height: 2, weight: 10 } } )
  4. Buy a Shipment shipmentBought = shipment.buy( :rate => shipment.lowest_rate(carriers =

    ['USPS'], services = ['First']) ) ##OR ! shipmentBought = shipment.buy(:rate => {:id => '{INSERT RATE ID HERE}'})