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 Deletes a product and all related SKUs.
-
#delete_sku(product_id, sku_id, opts = {}) ⇒ nil
Delete SKU 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(opts = {}) ⇒ ProductsImportCsvCreateResponseBody
Import Products using CSV Import products into the repository using a CSV file.
-
#import_skus_using_csv(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 products in one asynchronous operation.
-
#update_products_metadata_in_bulk(opts = {}) ⇒ ProductsMetadataUpdateInBulkResponseBody
Update Products’ Metadata in Bulk Updates metadata parameters for a list of products.
-
#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 Deletes a product and all related SKUs. This operation cannot be undone. If the force parameter is set to false or not set at all, the product and all related SKUs will be moved to the bin.
158 159 160 161 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 158 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 Deletes a product SKU. This operation cannot be undone. If the force parameter is set to false or not set at all, the SKU will be moved to the bin.
219 220 221 222 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 219 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.
279 280 281 282 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 279 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.
338 339 340 341 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 338 def get_sku(sku_id, opts = {}) data, _status_code, _headers = get_sku_with_http_info(sku_id, opts) data end |
#import_products_using_csv(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.
397 398 399 400 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 397 def import_products_using_csv(opts = {}) data, _status_code, _headers = import_products_using_csv_with_http_info(opts) data end |
#import_skus_using_csv(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.
462 463 464 465 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 462 def import_skus_using_csv(opts = {}) data, _status_code, _headers = import_skus_using_csv_with_http_info(opts) data end |
#list_products(opts = {}) ⇒ ProductsListResponseBody
List Products Retrieve a list of products.
531 532 533 534 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 531 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.
604 605 606 607 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 604 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.
674 675 676 677 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 674 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 products in one asynchronous operation. The request can include up to **10 MB** of data. The response returns a unique asynchronous action ID. Use this ID in the query paramater of the GET Async Action endpoint to check, e.g.: - The status of your request (in queue, in progress, done, or failed) - Resources that failed to be updated - The report file with details about the update If a product object is not found, it is upserted. This is shown in the report file in the GET Async Action endpoint. The upserted resources have value false in the found column and true in the updated column. This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
739 740 741 742 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 739 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 Updates metadata parameters for a list of products. Every resource in the list will receive the metadata defined in the request. The request can include up to **10 MB** of data. The response returns a unique asynchronous action ID. Use this ID in the query paramater of the GET Async Action endpoint to check, e.g.: - The status of your request (in queue, in progress, done, or failed) - Resources that failed to be updated - The report file with details about the update If a product object is not found, it is upserted. This is shown in the report file in the GET Async Action endpoint. The upserted resources have value false in the found column and true in the updated column. This API request starts a process that affects Voucherify data in bulk. In the case of small jobs (like bulk update), the request is put into a queue and processed when every other bulk request placed in the queue prior to this request is finished.
803 804 805 806 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 803 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.
869 870 871 872 |
# File 'lib/VoucherifySdk/api/products_api.rb', line 869 def update_sku(product_id, sku_id, opts = {}) data, _status_code, _headers = update_sku_with_http_info(product_id, sku_id, opts) data end |