README.md in seko-0.0.5 vs README.md in seko-0.0.6

- old
+ new

@@ -41,36 +41,57 @@ #### Configuration config/initializers/seko.rb ```ruby Seko.configure( token: 'SekoAPIToKeN' - supplier_code: 'DEFSUPLJLTD001', - supplier_description: 'Default Supplier LARSSON & JENNINGS LTD', + supplier_code: 'DEFSUPTCLTD001', + supplier_description: 'Default Supplier TEST COMPANY LTD', supplier_uom: 1, warehouses: { us: 'US123', uk: 'UK123' } ) ``` +#### Basics + +In order to communicate with Seko(SupplyStream) you need to instantiate an instance of the `Seko::Client` class using the token configured in the configuration step above. + +```ruby +client = Seko::Client.new(Seko.config[:token]) +``` + +#### Testing vs. Live Mode + +In order to use the live endpoint and corresponding live account with Seko you should pass it in as an argument to the client since the default is test mode. + +```ruby +client = Seko::Client.new(Seko.config[:token], { test_mode: false }) +``` + + #### Submit Product ```ruby client = Seko::Client.new(Seko.config[:token]) response = client.submit_product(upc: "123456", description: 'A test product') ``` -#### Submit Receipt +This will post product information to Supply Stream. However, your account representative will need to apply stock levels. +#### Send Return Request + ```ruby line_items = [ { upc: "123456", quantity: 10 } ] warehouse = Seko.config[:warehouses][:us] client = Seko::Client.new(Seko.config[:token]) -response = client.submit_receipt(line_item_array, warehouse) +response = client.send_return_request(line_item_array, warehouse) ``` +Once a return return request is submited, also know as an Advanced Shipment Notice(ASN), the warehouse will either send a push notification with a Goods Received Notice(GRN) or you can check the GRN status below by using the GUID generated by this request. + #### Submit Company ```ruby company_hash = { code: 'IND001', @@ -78,38 +99,48 @@ } client = Seko::Client.new(Seko.config[:token]) response = client.submit_company(company_hash) ``` +Useful for submitting companies to place wholesale orders. + #### Get Stock ```ruby client = Seko::Client.new(Seko.config[:token]) response = client.get_inventory ``` +Getting inventory will return inventory for all Warehouses configured. Pass in the warehouse identifier to filter the results by warehouse. + #### Check GRN ```ruby client = Seko::Client.new(Seko.config[:token]) response = client.check_grn('5b2dcd8e-52c3-4e27-a712-eaacda2dd8fe') ``` +Check the status of a Return Request(ASN) submitted. + #### Order Status ```ruby client = Seko::Client.new(Seko.config[:token]) response = client.order_status('5b2dcd8e-52c3-4e27-a712-eaacda2dd8fe') ``` +Check the status of an order. + #### Order Tracking ```ruby client = Seko::Client.new(Seko.config[:token]) response = client.order_tracking('5b2dcd8e-52c3-4e27-a712-eaacda2dd8fe') ``` +Get the tracking information for a given order. + #### Cancel Order ```ruby Seko::Order::CANCEL_CODES # => { @@ -122,9 +153,11 @@ # } client = Seko::Client.new(Seko.config[:token]) response = client.cancel_order('5b2dcd8e-52c3-4e27-a712-eaacda2dd8fe', '001') ``` + +Cancels a placed order, only works if the order isn't already shipped. #### Stock Movements ```ruby client = Seko::Client.new(Seko.config[:token])