From 4af4aac4d35f51cbd9679a606efec602e7e30547 Mon Sep 17 00:00:00 2001 From: Satyendra Date: Tue, 17 Jan 2017 19:22:08 +0530 Subject: [PATCH 1/2] add readme documentation --- README.md | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 97 insertions(+) diff --git a/README.md b/README.md index 49ab4aa..1ecdc8b 100644 --- a/README.md +++ b/README.md @@ -8,3 +8,100 @@ [![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. + + + +Getting started + +1)Add it to your Gemfile with: + + gem 'ruby-jet' + +2)Then run bundle install + + +3)Create Jet client object + + Example + + jet_client_attrs = { + merchant_id: "your jet merchant id", + api_user: "your jet api_user", + secret: "your jet secret" + } + + client = Jet.client(jet_client_attrs) + +4)Now you can call methods with client object like: + + token = client.token + +5)For the product related API, create object of product like: + + product_client = client.products + + now you can call all the product api methods with product_client object. + + example: + + product_client.update_inventory(merchant_sku, body) + product_client.get_inventory(merchant_sku) + ete... + +6)For the order related API, create object of order like: + + jet_order = client.orders + + now you can call all the product api methods with product_client object. + + example: + + jet_order.get_orders(status) + jet_order.get_order(order_url) + ete... + +7)Do same thing for all other APIS (Refunds, Returns and Taxonomy). + +8)Here is all APIS list: + + a)Product APIS + 1)update_inventory(merchant_sku, body) + 2)get_inventory(merchant_sku) + 3)update_product(merchant_sku, body) + 4)get_product(merchant_sku) + 5)update_price(merchant_sku, body) + 6)get_price(merchant_sku) + 7)update_image(merchant_sku, body) + 8)get_products(params) + + b)Order APIS + 1)get_orders(status) + 2)get_order(order_url) + 3)get_order_by_id(order_id) + 4)acknowledge_order(order_id, body) + 5)ship_order(order_id, body) + 6)get_directed_cancel + + c)File APIS + 1)upload_token + 2)file_upload(url, body) + 3)uploaded_files(url, file_type, file_name) + 4)jet_file_id(file_id) + + d)Returns + 1)get_returns(status = :created) + 2)get_return(return_url) + 3)get_return_by_id(return_id) + 4)complete_return(return_id, body) + + e)Refunds + 1)create_merchant_initiated_refund(order_id, alt_refund_id) + 2)check_refund_state(refund_authorization_id) + 3)check_for_created_refunds(status) + + + f)Taxonomy + 1)get_links(limit, offset, version) + 2)get_node(node_url) + 3)get_node_attributes(node_url) + From 42b6585d2c3425c670594c47bc3a5de2beb4fa6e Mon Sep 17 00:00:00 2001 From: cis-kamlesh Date: Tue, 17 Jan 2017 19:35:44 +0530 Subject: [PATCH 2/2] Update README.md --- README.md | 114 +++++++++++++++++++++++++++--------------------------- 1 file changed, 56 insertions(+), 58 deletions(-) diff --git a/README.md b/README.md index 1ecdc8b..04a8311 100644 --- a/README.md +++ b/README.md @@ -24,37 +24,36 @@ Getting started Example - jet_client_attrs = { - merchant_id: "your jet merchant id", - api_user: "your jet api_user", - secret: "your jet secret" - } + jet_client_attrs = { + merchant_id: "your jet merchant id", + api_user: "your jet api_user", + secret: "your jet secret" + } - client = Jet.client(jet_client_attrs) + client = Jet.client(jet_client_attrs) 4)Now you can call methods with client object like: - token = client.token + token = client.token 5)For the product related API, create object of product like: - product_client = client.products - - now you can call all the product api methods with product_client object. + product_client = client.products +now you can call all the product api methods with product_client object. example: - product_client.update_inventory(merchant_sku, body) - product_client.get_inventory(merchant_sku) - ete... + product_client.update_inventory(merchant_sku, body) + product_client.get_inventory(merchant_sku) + ete... 6)For the order related API, create object of order like: - jet_order = client.orders + jet_order = client.orders - now you can call all the product api methods with product_client object. +now you can call all the product api methods with product_client object. - example: + example: jet_order.get_orders(status) jet_order.get_order(order_url) @@ -62,46 +61,45 @@ Getting started 7)Do same thing for all other APIS (Refunds, Returns and Taxonomy). -8)Here is all APIS list: - - a)Product APIS - 1)update_inventory(merchant_sku, body) - 2)get_inventory(merchant_sku) - 3)update_product(merchant_sku, body) - 4)get_product(merchant_sku) - 5)update_price(merchant_sku, body) - 6)get_price(merchant_sku) - 7)update_image(merchant_sku, body) - 8)get_products(params) - - b)Order APIS - 1)get_orders(status) - 2)get_order(order_url) - 3)get_order_by_id(order_id) - 4)acknowledge_order(order_id, body) - 5)ship_order(order_id, body) - 6)get_directed_cancel - - c)File APIS - 1)upload_token - 2)file_upload(url, body) - 3)uploaded_files(url, file_type, file_name) - 4)jet_file_id(file_id) - - d)Returns - 1)get_returns(status = :created) - 2)get_return(return_url) - 3)get_return_by_id(return_id) - 4)complete_return(return_id, body) - - e)Refunds - 1)create_merchant_initiated_refund(order_id, alt_refund_id) - 2)check_refund_state(refund_authorization_id) - 3)check_for_created_refunds(status) - - - f)Taxonomy - 1)get_links(limit, offset, version) - 2)get_node(node_url) - 3)get_node_attributes(node_url) +8)Here is all APIS list + + a)Product APIS + 1)update_inventory(merchant_sku, body) + 2)get_inventory(merchant_sku) + 3)update_product(merchant_sku, body) + 4)get_product(merchant_sku) + 5)update_price(merchant_sku, body) + 6)get_price(merchant_sku) + 7)update_image(merchant_sku, body) + 8)get_products(params) + + b)Order APIS + 1)get_orders(status) + 2)get_order(order_url) + 3)get_order_by_id(order_id) + 4)acknowledge_order(order_id, body) + 5)ship_order(order_id, body) + 6)get_directed_cancel + + c)File APIS + 1)upload_token + 2)file_upload(url, body) + 3)uploaded_files(url, file_type, file_name) + 4)jet_file_id(file_id) + + d)Returns + 1)get_returns(status = :created) + 2)get_return(return_url) + 3)get_return_by_id(return_id) + 4)complete_return(return_id, body) + + e)Refunds + 1)create_merchant_initiated_refund(order_id, alt_refund_id) + 2)check_refund_state(refund_authorization_id) + 3)check_for_created_refunds(status) + + f)Taxonomy + 1)get_links(limit, offset, version) + 2)get_node(node_url) + 3)get_node_attributes(node_url)