Class: VoucherifySdk::ProductsApi
- Inherits:
-
Object
- Object
- VoucherifySdk::ProductsApi
- Defined in:
- lib/VoucherifySdk/api/products_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#create_product(opts = {}) ⇒ ProductsCreateResponseBody
Create Product Creates a product object.
-
#create_sku(product_id, opts = {}) ⇒ ProductsSkusCreateResponseBody
Create SKU This method adds product variants to a created product.
-
#delete_product(product_id, opts = {}) ⇒ nil
Delete Product This method deletes a product.
-
#delete_sku(product_id, sku_id, opts = {}) ⇒ nil
Delete SKU This method deletes a product SKU.
-
#get_product(product_id, opts = {}) ⇒ ProductsGetResponseBody
Get Product Retrieve product details.
-
#get_sku(sku_id, opts = {}) ⇒ SkusGetResponseBody
Get SKU Retrieve details of a SKU.
-
#import_products_using_csv(file, opts = {}) ⇒ ProductsImportCsvCreateResponseBody
Import Products using CSV Import products into the repository using a CSV file.
-
#import_skus_using_csv(file, opts = {}) ⇒ SkusImportCsvCreateResponseBody
Import SKUs using CSV Import SKUs into the repository using a CSV file.
-
#initialize(api_client = ApiClient.default) ⇒ ProductsApi
constructor
A new instance of ProductsApi.
-
#list_products(opts = {}) ⇒ ProductsListResponseBody
List Products Retrieve a list of products.
-
#list_skus_in_product(product_id, opts = {}) ⇒ ProductsSkusListResponseBody
List SKUs in Product Retrieve all SKUs for a given product.
-
#update_product(product_id, opts = {}) ⇒ ProductsUpdateResponseBody
Update Product Updates the specified product by setting the values of the parameters passed in the request body.
-
#update_products_in_bulk(opts = {}) ⇒ ProductsUpdateInBulkResponseBody
Update Products in bulk Update several products in one asynchronous operation.
-
#update_products_metadata_in_bulk(opts = {}) ⇒ ProductsMetadataUpdateInBulkResponseBody
Update Products’ Metadata in bulk Update several product metadata properties in one asynchronous operation.
-
#update_sku(product_id, sku_id, opts = {}) ⇒ ProductsSkusUpdateResponseBody
Update SKU Updates the specified SKU by setting the values of the parameters passed in the request body.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ProductsApi
Returns a new instance of ProductsApi.
19 20 21 |
# File 'lib/VoucherifySdk/api/products_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/products_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#create_product(opts = {}) ⇒ ProductsCreateResponseBody
Create Product Creates a product object. 📘 Upsert Mode If you pass an id or a source_id that already exists in the product database, Voucherify will return a related product object with updated fields.
27 28 29 30 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 27 def create_product(opts = {}) data, _status_code, _headers = create_product_with_http_info(opts) data end |
#create_sku(product_id, opts = {}) ⇒ ProductsSkusCreateResponseBody
Create SKU This method adds product variants to a created product. 📘 Upsert Mode If you pass an id or a source_id that already exists in the sku database, Voucherify will return a related sku object with updated fields.
92 93 94 95 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 92 def create_sku(product_id, opts = {}) data, _status_code, _headers = create_sku_with_http_info(product_id, opts) data end |
#delete_product(product_id, opts = {}) ⇒ nil
Delete Product This method deletes a product.
162 163 164 165 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 162 def delete_product(product_id, opts = {}) delete_product_with_http_info(product_id, opts) nil end |
#delete_sku(product_id, sku_id, opts = {}) ⇒ nil
Delete SKU This method deletes a product SKU.
227 228 229 230 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 227 def delete_sku(product_id, sku_id, opts = {}) delete_sku_with_http_info(product_id, sku_id, opts) nil end |
#get_product(product_id, opts = {}) ⇒ ProductsGetResponseBody
Get Product Retrieve product details.
295 296 297 298 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 295 def get_product(product_id, opts = {}) data, _status_code, _headers = get_product_with_http_info(product_id, opts) data end |
#get_sku(sku_id, opts = {}) ⇒ SkusGetResponseBody
Get SKU Retrieve details of a SKU.
358 359 360 361 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 358 def get_sku(sku_id, opts = {}) data, _status_code, _headers = get_sku_with_http_info(sku_id, opts) data end |
#import_products_using_csv(file, opts = {}) ⇒ ProductsImportCsvCreateResponseBody
Import Products using CSV Import products into the repository using a CSV file. This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
421 422 423 424 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 421 def import_products_using_csv(file, opts = {}) data, _status_code, _headers = import_products_using_csv_with_http_info(file, opts) data end |
#import_skus_using_csv(file, opts = {}) ⇒ SkusImportCsvCreateResponseBody
Import SKUs using CSV Import SKUs into the repository using a CSV file. The CSV file has to include headers in the first line. All properties which cannot be mapped to standard SKU fields will be added to the metadata object. You can find an example template [here](s3.amazonaws.com/helpscout.net/docs/assets/5902f1c12c7d3a057f88a36d/attachments/627b98d08c9b585083488a4c/Import_SKUS_template.csv). This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
490 491 492 493 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 490 def import_skus_using_csv(file, opts = {}) data, _status_code, _headers = import_skus_using_csv_with_http_info(file, opts) data end |
#list_products(opts = {}) ⇒ ProductsListResponseBody
List Products Retrieve a list of products.
563 564 565 566 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 563 def list_products(opts = {}) data, _status_code, _headers = list_products_with_http_info(opts) data end |
#list_skus_in_product(product_id, opts = {}) ⇒ ProductsSkusListResponseBody
List SKUs in Product Retrieve all SKUs for a given product.
648 649 650 651 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 648 def list_skus_in_product(product_id, opts = {}) data, _status_code, _headers = list_skus_in_product_with_http_info(product_id, opts) data end |
#update_product(product_id, opts = {}) ⇒ ProductsUpdateResponseBody
Update Product Updates the specified product by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged.
734 735 736 737 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 734 def update_product(product_id, opts = {}) data, _status_code, _headers = update_product_with_http_info(product_id, opts) data end |
#update_products_in_bulk(opts = {}) ⇒ ProductsUpdateInBulkResponseBody
Update Products in bulk Update several products in one asynchronous operation. In one request, it is possible to update a maximum of 100 records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an upsert occurs. This is reflected in the Get Async Action endpoint as follows: This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
803 804 805 806 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 803 def update_products_in_bulk(opts = {}) data, _status_code, _headers = update_products_in_bulk_with_http_info(opts) data end |
#update_products_metadata_in_bulk(opts = {}) ⇒ ProductsMetadataUpdateInBulkResponseBody
Update Products’ Metadata in bulk Update several product metadata properties in one asynchronous operation. In one request, it is possible to update a maximum of 100 records. In the response body, you get a unique async action identifier. If a requested product object is not found, then an upsert occurs. This is reflected in the Get Async Action endpoint as follows: This API request starts a process that affects Voucherify data in bulk. In case of small jobs (like bulk update) the request is put into a queue and processed once every other bulk request placed in the queue prior to this request is finished. However, when the job takes a longer time (like vouchers generation) then it is processed in small portions in a round-robin fashion. When there is a list of vouchers generation scheduled, then they will all have the IN_PROGRESS status shortly. This way, small jobs added just after scheduling big jobs of the same type will be processed in a short time window. The result will return the async ID. You can verify the status of your request via this API request.
867 868 869 870 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 867 def (opts = {}) data, _status_code, _headers = (opts) data end |
#update_sku(product_id, sku_id, opts = {}) ⇒ ProductsSkusUpdateResponseBody
Update SKU Updates the specified SKU by setting the values of the parameters passed in the request body. Any parameters not provided in the payload will be left unchanged. Fields other than the ones listed in the request body schema wont be modified. Even if provided, they will be silently skipped.
933 934 935 936 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 933 def update_sku(product_id, sku_id, opts = {}) data, _status_code, _headers = update_sku_with_http_info(product_id, sku_id, opts) data end |