Class: VoucherifySdk::OrdersApi

Inherits:
Object
  • Object
show all
Defined in:
lib/VoucherifySdk/api/orders_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ OrdersApi

Returns a new instance of OrdersApi.



19
20
21
# File 'lib/VoucherifySdk/api/orders_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/VoucherifySdk/api/orders_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#create_order(opts = {}) ⇒ OrdersCreateResponseBody

Create Order Creates an order object and triggers an order creation event. 📘 Upsert Mode If you pass an id or a source_id that already exists in the order database, Voucherify will return a related order object with updated fields.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



27
28
29
30
# File 'lib/VoucherifySdk/api/orders_api.rb', line 27

def create_order(opts = {})
  data, _status_code, _headers = create_order_with_http_info(opts)
  data
end

#create_order_export(opts = {}) ⇒ OrdersExportCreateResponseBody

Create Orders Export Creates a downloadable CSV file containing a list of orders. The parameters listed in the payload resembles headers in the CSV file. To include a parameter to the file, add it to the parameters.fields object in the request body. The available filters are all order object attributes. Additionally, any metadata defined in the metadata schema can be exported. Passing an empty JSON will generate a file containing three default fields: id, source_id, and status. The fields array is an array of strings containing the data in the export. These fields define the headers in the CSV file. The array can be a combination of any of the following available fields:

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



91
92
93
94
# File 'lib/VoucherifySdk/api/orders_api.rb', line 91

def create_order_export(opts = {})
  data, _status_code, _headers = create_order_export_with_http_info(opts)
  data
end

#get_order(order_id, opts = {}) ⇒ OrdersGetResponseBody

Get Order Retrieve an order.

Parameters:

  • order_id (String)

    Unique Voucherify order ID or order source ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Returns:



155
156
157
158
# File 'lib/VoucherifySdk/api/orders_api.rb', line 155

def get_order(order_id, opts = {})
  data, _status_code, _headers = get_order_with_http_info(order_id, opts)
  data
end

#import_orders(opts = {}) ⇒ OrdersImportCreateResponseBody

Import Orders

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

Returns:



214
215
216
217
# File 'lib/VoucherifySdk/api/orders_api.rb', line 214

def import_orders(opts = {})
  data, _status_code, _headers = import_orders_with_http_info(opts)
  data
end

#list_orders(opts = {}) ⇒ OrdersListResponseBody

List Orders Returns a list of orders.

Parameters:

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :limit (Integer)

    Limits the number of objects to be returned. The limit can range between 1 and 100 items. If no limit is set, it returns 10 items.

  • :page (Integer)

    Which page of results to return. The lowest value is 1.

  • :order (ParameterOrderListOrders)

    This is a property that controls the sorting direction of the results. Sort the results using one of the filtering options, where the dash - preceding a sorting option means sorting in a descending order.

Returns:



280
281
282
283
# File 'lib/VoucherifySdk/api/orders_api.rb', line 280

def list_orders(opts = {})
  data, _status_code, _headers = list_orders_with_http_info(opts)
  data
end

#update_order(order_id, opts = {}) ⇒ OrdersUpdateResponseBody

Update Order Updates the specified order by setting the values of the parameters passed in the request body. Any parameters not provided will be left unchanged.

Parameters:

  • order_id (String)

    Unique Voucherify order ID or order source ID.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :orders_update_request_body (OrdersUpdateRequestBody)

    Specify the parameters of the order that are to be updated.

Returns:



345
346
347
348
# File 'lib/VoucherifySdk/api/orders_api.rb', line 345

def update_order(order_id, opts = {})
  data, _status_code, _headers = update_order_with_http_info(order_id, opts)
  data
end