Class: VoucherifySdk::OrdersApi
- Inherits:
-
Object
- Object
- VoucherifySdk::OrdersApi
- Defined in:
- lib/VoucherifySdk/api/orders_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_order(opts = {}) ⇒ OrdersCreateResponseBody
Create Order Creates an order object and triggers an order creation event.
-
#create_order_export(opts = {}) ⇒ OrdersExportCreateResponseBody
Create Orders Export Creates a downloadable CSV file containing a list of orders.
-
#get_order(order_id, opts = {}) ⇒ OrdersGetResponseBody
Get Order Retrieve an order.
-
#import_orders(opts = {}) ⇒ OrdersImportCreateResponseBody
Import Orders 🚧 Historical orders This endpoint should only be used to import historical orders into Voucherify.
-
#initialize(api_client = ApiClient.default) ⇒ OrdersApi
constructor
A new instance of OrdersApi.
-
#list_orders(opts = {}) ⇒ OrdersListResponseBody
List Orders Returns a list of orders.
-
#update_order(order_id, opts = {}) ⇒ OrdersUpdateResponseBody
Update Order Updates the specified order by setting the values of the parameters passed in the request body.
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_client ⇒ Object
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.
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:
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.
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
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.
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.
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 |