Module: GmanClient::Api::Orders

Included in:
Gman::Client
Defined in:
lib/gman_client/api/orders.rb

Overview

Orders API

Instance Method Summary collapse

Instance Method Details

#order(uuid) ⇒ Object

Retrieve a single order

Parameters:

  • uuid (String)

    identifies the order



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/gman_client/api/orders.rb', line 10

def order(uuid)
  response = attempt(@retry_attempts) do
    request
      .api
      .v1
      .orders(uuid)
      .get
  end

  response.to_h
end

#orders(filter_params) ⇒ Object

Retrieves a number of orders

Parameters:

  • parameters (Hash)

    to filter the orders



25
26
27
28
29
30
31
32
33
34
35
# File 'lib/gman_client/api/orders.rb', line 25

def orders(filter_params)
  response = attempt(@retry_attempts) do
    request
      .api
      .v1
      .orders
      .get(params: filter_params)
  end

  response.map(&:to_h)
end