diff --git a/README.md b/README.md index b7c0843..b0931b1 100644 --- a/README.md +++ b/README.md @@ -3,8 +3,6 @@ [![Build Status](https://travis-ci.org/jasonwells/ruby-jet.svg)](https://travis-ci.org/jasonwells/ruby-jet) [![CircleCI](https://circleci.com/gh/jasonwells/ruby-jet.svg?style=shield)](https://circleci.com/gh/jasonwells/ruby-jet) [![Dependency Status](https://gemnasium.com/jasonwells/ruby-jet.svg)](https://gemnasium.com/jasonwells/ruby-jet) -[![Code Climate](https://codeclimate.com/github/jasonwells/ruby-jet/badges/gpa.svg)](https://codeclimate.com/github/jasonwells/ruby-jet) -[![Test Coverage](https://codeclimate.com/github/jasonwells/ruby-jet/badges/coverage.svg)](https://codeclimate.com/github/jasonwells/ruby-jet/coverage) [![Gem Version](https://badge.fury.io/rb/ruby-jet.svg)](https://badge.fury.io/rb/ruby-jet) [Jet API](https://developer.jet.com/) service calls implemented in Ruby. @@ -13,7 +11,7 @@ require 'Jet' - jet_client = Jet.client(merchant_id: "your_merch_id", api_user: "your_api_user", secret: "your_secret") + jet_client = Jet.client(merchant_id: 'your_merch_id', api_user: 'your_api_user', secret: 'your_secret') ## Products [Jet Products API](https://developer.jet.com/docs/merchant-sku) @@ -21,17 +19,18 @@ Product Attributes ```ruby -attrs = {product_title: 'My Product', - ASIN: '12345ABCDE', - brand: "My Product's Brand", - manufacturer: "My Product's Manufacturer", - main_image_url: 'https://c2.q-assets.com/images/products/p/asj/asj-077_1z.jpg', - bullets: [ "This is bullet line 1", - "This is bullet line 2", - ], - product_description: "This is a terrific product that everyone should own.", - multipack_quantity: 1, - } +attrs = { + product_title: 'My Product', + ASIN: '12345ABCDE', + brand: "My Product's Brand", + manufacturer: "My Product's Manufacturer", + main_image_url: 'https://c2.q-assets.com/images/products/p/asj/asj-077_1z.jpg', + bullets: [ 'This is bullet line 1', + 'This is bullet line 2', + ], + product_description: 'This is a terrific product that everyone should own.', + multipack_quantity: 1 +} ``` Call products.update_product to add a new product or update an existing one. @@ -56,11 +55,13 @@ response = jet_client.products.update_price('MyNewSku123', price: 30.95) Update the inventory ```ruby -response = jet_client.products.update_inventory('MyNewSku123', - fulfillment_nodes: [ - {fulfillment_node_id: 'node1234', quantity: 100}, - {fulfillment_node_id: 'node5678', quantity: 20} - ]) +response = jet_client.products.update_inventory( + 'MyNewSku123', + fulfillment_nodes: [ + { fulfillment_node_id: 'node1234', quantity: 100 }, + { fulfillment_node_id: 'node5678', quantity: 20 } + ] +) ``` ## Retrieve Orders @@ -102,45 +103,44 @@ order = jet_client.orders.get_order(order_url) ```ruby jet_order_id = order['merchant_order_id'] -response = jet_client.orders.acknowledge_order(jet_order_id, - acknowledgement_status: 'accepted', - alt_order_id: '232145', # optional - order_items: [ - { order_item_acknowledgement_status: 'fulfillable', - order_item_id: 'b81f073b18f548b892f6d4497af16297', - alt_order_item_id: '554443322' # optional - } - ] - ) +response = jet_client.orders.acknowledge_order( + jet_order_id, + acknowledgement_status: 'accepted', + alt_order_id: '232145', # optional + order_items: [ + { order_item_acknowledgement_status: 'fulfillable', + order_item_id: 'b81f073b18f548b892f6d4497af16297', + alt_order_item_id: '554443322' # optional + } + ] +) ``` Mark Order as shipped [Jet Ship Order API](https://developer.jet.com/docs/ship-order) ```ruby -response = jet_client.orders.ship_order(jet_order_id, - alt_order_id: '232145', # optional - shipments: [ - { alt_shipment_id: '11223344', #optional - shipment_tracking_number: '1Z12342452342', - response_shipment_date: 0.days.from_now, - response_shipment_method: 'ups_ground', - expected_delivery_date: 4.days.from_now, - ship_from_zip_code: '12061', - carrier_pick_up_date: 1.days.from_now, - carrier: 'UPS', - shipment_items: [ - { shipment_item_id: '76-s2507-i1810', - alt_shipment_item_id: '129900120', # optional - merchant_sku: 'MyNewSku123', - response_shipment_sku_quantity: 1 - } - ] - } - ] - ) +response = jet_client.orders.ship_order( + jet_order_id, + alt_order_id: '232145', # optional + shipments: [ + { + alt_shipment_id: '11223344', #optional + shipment_tracking_number: '1Z12342452342', + response_shipment_date: 0.days.from_now, + response_shipment_method: 'ups_ground', + expected_delivery_date: 4.days.from_now, + ship_from_zip_code: '12061', + carrier_pick_up_date: 1.days.from_now, + carrier: 'UPS', + shipment_items: [ + { shipment_item_id: '76-s2507-i1810', + alt_shipment_item_id: '129900120', # optional + merchant_sku: 'MyNewSku123', + response_shipment_sku_quantity: 1 + } + ] + } + ] +) ``` - - - - diff --git a/ruby-jet.gemspec b/ruby-jet.gemspec index d3e42b5..0761bc3 100644 --- a/ruby-jet.gemspec +++ b/ruby-jet.gemspec @@ -1,10 +1,10 @@ Gem::Specification.new do |gem| gem.name = 'ruby-jet' gem.version = '0.9.0' - gem.date = '2016-11-03' + gem.date = '2017-06-02' gem.summary = 'Jet API for Ruby' gem.description = 'Jet API service calls implemented in Ruby' - gem.authors = ['Jason Wells','Mike Ball'] + gem.authors = ['Jason Wells'] gem.email = ['flipstock@gmail.com', 'jason@iserveproducts.com'] gem.files = Dir.glob('lib/**/*.rb') + %w(LICENSE README.md) gem.homepage = 'https://github.com/jasonwells/ruby-jet'