class Jet::Client::Orders

Orders client

Constants

STATUSES

Public Class Methods

new(client) click to toggle source
# File lib/jet/client/orders.rb, line 13
def initialize(client)
  @client = client
end

Public Instance Methods

acknowledge_order(order_id, body = {}) click to toggle source
# File lib/jet/client/orders.rb, line 30
def acknowledge_order(order_id, body = {})
  @client.rest_put_with_token("/orders/#{order_id}/acknowledge", body)
end
check_for_tagged_orders(status, tag, with_tag = true) click to toggle source
# File lib/jet/client/orders.rb, line 43
def check_for_tagged_orders(status, tag, with_tag = true)
  query_status = STATUSES[status]
  query_with_tag = with_tag ? true : false
  @client.rest_get_with_token("/orders/#{query_status}/#{tag}/#{query_with_tag}")
end
get_order(order_url) click to toggle source
# File lib/jet/client/orders.rb, line 22
def get_order(order_url)
  @client.rest_get_with_token(order_url)
end
get_order_by_id(order_id) click to toggle source
# File lib/jet/client/orders.rb, line 26
def get_order_by_id(order_id)
  @client.rest_get_with_token("/orders/withoutShipmentDetail/#{order_id}")
end
get_orders(status = :ready, params = {}) click to toggle source
# File lib/jet/client/orders.rb, line 17
def get_orders(status = :ready, params = {})
  query_status = STATUSES[status]
  @client.rest_get_with_token("/orders/#{query_status}", params)
end
ship_order(order_id, body = {}) click to toggle source
# File lib/jet/client/orders.rb, line 34
def ship_order(order_id, body = {})
  @client.rest_put_with_token("/orders/#{order_id}/shipped", body)
end
tag_order(order_id, tag) click to toggle source
# File lib/jet/client/orders.rb, line 38
def tag_order(order_id, tag)
  body = { tag: tag } if tag
  @client.rest_put_with_token("/orders/#{order_id}/tag", body)
end