Class: StickyIoRestfulApiV2025731::ProductsController

Inherits:
BaseController
  • Object
show all
Defined in:
lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb

Overview

ProductsController

Constant Summary

Constants inherited from BaseController

BaseController::GLOBAL_ERRORS

Instance Attribute Summary

Attributes inherited from BaseController

#config, #http_call_back

Instance Method Summary collapse

Methods inherited from BaseController

#initialize, #new_parameter, #new_request_builder, #new_response_handler, user_agent, user_agent_parameters

Constructor Details

This class inherits a constructor from StickyIoRestfulApiV2025731::BaseController

Instance Method Details

#add_custom_field_values(body, domain, v2_ext, product_id) ⇒ ApiResponse

Attach an existing product’s custom fields and assign values for them to the product. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | custom_fields | Required | - | Array | Array of custom fields. | custom_fields.*.id | Required | - | Integer | The custom field ID. | custom_fields.*.value | Required | - | String | The custom field desired value. parameter: TODO: type description here here

Parameters:

  • body (AddCustomFieldValuesRequestAddCustomFieldValues1)

    Required

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 850

def add_custom_field_values(body,
                            domain,
                            v2_ext,
                            product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}products/{product_id}/custom_fields',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AddCustomFieldValues.method(:from_hash))
                .is_api_response(true))
    .execute
end

#add_product(body, domain, v2_ext) ⇒ ApiResponse

Create a new standard, bundle, or variant product. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type

| Description                            |

| ———————————– | ———– | ——- | ———— | ————————————– | | name | Required | - | String

| The product name. |

| sku | Required | - | String

| The product SKU identifier |

| category_id | Required | - | Integer

| The product category ID. |

| price | Required | - | Numeric

| The product price. |

| cost_of_goods | Required | - | Numeric

| The cost of goods sold. |

| restocking_fee | Required | - | Numeric

| The restocking fee. |

| max_quantity | Required | - | Integer

| The maximum quantity allowed per order for the product. |

| description | Optional | - | String

| the product description. |

| tax_code | Optional | - | String

| User-defined product tax code. |

| is_taxable | Optional | - | Integer Flag | A flag that determines whether or not the product is taxable. | | is_delivery_confirm | Optional | - | Integer Flag | A flag that determines whether or not delivery confirmation is required. | | is_signature_confirm | Optional | - | Integer Flag | A flag that determines whether or not signature confirmation is required. | | is_qty_preserved | Optional | - | Integer Flag | A flag that determines whether or not quantity is preserved upon rebill. | | is_collections_enabled | Optional | - | Integer Flag | A flag that determines whether or not this product is eligible for collections. | | weight | Optional | - | Numeric

| The product weight. |

| weight_unit_id | Optional | - | Integer

| The product weight unit ID. |

| bundle | Optional | - | Object

| (Bundle products only) A product bundle configuration object. |

| bundle.type_id | Conditional | - | Integer

| The product bundle type ID. |

| bundle.price_type_id | Conditional | - | Integer

| The product bundle price type ID. |

| bundle.max_items | Conditional | - | Integer

| The maximum items allowed in a bundle. |

| bundle.children | Optional | - | Array

| An array of product bundle children objects (pre-built bundles). |

| bundle.children.*.product_id | Conditional | - | Integer

| The child product ID. |

| bundle.children.*.quantity | Conditional | - | Integer

| The child product quantity. |

| shipping_restrictions | Optional | - | Array

| An array of shipping restriction objects. |

| shipping_restrictions.*.country_id | Conditional | - | Integer

| The shipping restriction country ID. |

| shipping_restrictions.*.values | Conditional | - | Array

| An array of shipping restriction values. |

| shipping_restrictions.*.values.* | Conditional | - | String

| Shipping restriction value. |

| auto_create_variants | Optional | - | Integer Flag | A flag that determines whether or not to create variants based on the provided attributes. | | attributes | Optional | - | Array

| An array of product variant attributes. |

| attributes.*.name | Conditional | - | String

| Variant attribute name. |

| attributes.*.options | Conditional | - | Array

| An array of variant attribute options. |

| attributes.*.options.* | Conditional | - | String

| Variant attribute option name. |

| paired_product_ids | Optional | - | Array

| An array of paired product IDs. |

| paired_product_ids.* | Conditional | - | Integer

| Paired product ID. |

**Response Data**\ Response parameters contained within the ‘data` field object: | Field | Data Type | Description

|

| —————————– | ———— | ———————————————————— | | id | Integer | The product ID. | | is_trial_product | Integer Flag | A flag that determines whether or not the product is a trial product. | | is_shippable | Integer Flag | A flag that determines whether or not the product is shippable. | | tax_code | String | User-defined tax-code. | | is_licensed | Integer Flag | A flag that determines whether or not the product is a license product. | | name | String | The product name. | | description | String | The product description. | | sku | String | The product SKU identifier. | | price | Numeric | The product base price. | | weight | Numeric | The product weight. | | declared_value | Numeric | The product declared value. | | restocking_fee | Numeric | The product restocking fee. | | cost_of_goods | Numeric | The cost of goods sold. | | max_quantity | Integer | The maximum quantity allowed for purchase per order. | | created_at | Object | Nullable creation timestamp object. | | created_at.date | String | The creation timestamp. | | created_at.timezone_type | Integer | The creation timezone type ID. | | created_at.timezone | String | The creation timezone. | | updated_at | Object | Nullable last updated timestamp object. | | updated_at.date | String | The last updated timestamp. | | updated_at.timezone_type | Integer | The last updated timezone type ID. | | updated_at.timezone | String | The last updated timezone. | | custom_fields | Array | An array of custom field objects. | | vertical | Object | The vertical object associated with the product. | | vertical.id | Integer | The vertical ID. | | vertical.name | String | The vertical name. | | category_id | Integer | The category ID. | | category | Object | The image ID. | | category.id | Integer | The category object associated with the product. | | category.name | String | The category name. | | category.description | String | The category description. | | is_bundle | Integer Flag | A flag that determines whether or not the product is a bundle. | | is_custom_bundle | Integer Flag | A flag that determines whether or not the product is a custom bundle. | | shipping_restrictions | Array | An array of shipping restriction objects. | | paired_product_ids | Array | An array of paired product IDs. | | weight_unit | Object | The weight unit type object. | | weight_unit.id | Integer | The weight unit type ID. | | weight_unit.name | String | The weight unit type name. | | weight_unit.abbreviation | String | The weight unit type abbreviation. | | bundle_type | Object | The bundle type object. | | bundle_type.id | Integer | The bundle type ID. | | bundle_type.name | String | The bundle type name. | | price_type | Object | The bundle price type object. | | price_type.id | Integer | The bundle price type ID. | | price_type.name | String | The bundle price type name. | | bundle_children | Array | An array of bundle children objects. | | bundle_children.*.quantity | Integer | The bundle child quantity. | | bundle_children.*.id | Integer | The bundle child product ID. | | bundle_children.*.product_id | Integer | The bundle child product ID. | | bundle_children.*.name | String | The bundle child product name. | | attributes | Array | An array of product variant attributes. | | variants | Array | An array of product variant objects. | | is_variant_enabled | Integer Flag | A flag that determines whether or not the product has variants. | | images | Array | An array of image objects. | here

Parameters:

  • body (AddProductRequest)

    Required parameter: TODO: type description

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 308

def add_product(body,
                domain,
                v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::POST,
                                 '/.{domain}{v2_ext}products',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(AddProductPrebuiltFixedPriceBundle.method(:from_hash))
                .is_api_response(true))
    .execute
end

#change_recurring_product(body, domain, v2_ext, subscription_id) ⇒ ApiResponse

Changes the recurring parameters for a recurring product. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | | ——————————— | ——– | — | ———— | ————————————– | | product_id | Required | - | Integer | The Recurring Product ID. | | variant_id | Optional | - | Integer | The Recurring Product variant ID. | | allow_product_swap | Optional | - | Boolean

| Determines if the Recurring Product can be swapped with variants.
             |

| children | Optional | - | Array | List of children products for the Recurring Product. | | children.product_id | Optional | - | Integer | The children product ID. | | children.quantity | Optional | - | Integer

| The children product quantity.                     |

description here here

Parameters:

  • body (ChangeRecurringProductRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • subscription_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 36

def change_recurring_product(body,
                             domain,
                             v2_ext,
                             subscription_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}subscriptions/{subscription_id}/product',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(subscription_id, key: 'subscription_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(ChangeRecurringProductWithChildren.method(:from_hash))
                .is_api_response(true)
                .local_error('404',
                             'Not Found',
                             ChangeRecurringProductInvalidIdException)
                .local_error('422',
                             'Unprocessable Entity',
                             ChangeRecurringProductProductNotAvailableOfferException))
    .execute
end

#delete_custom_field_values(domain, v2_ext, product_id, custom_field_id) ⇒ ApiResponse

Delete an existing custom field from the list attached to the product here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

  • custom_field_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 936

def delete_custom_field_values(domain,
                               v2_ext,
                               product_id,
                               custom_field_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}products/{product_id}/custom_fields/{custom_field_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(custom_field_id, key: 'custom_field_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DeleteCustomFieldValues.method(:from_hash))
                .is_api_response(true))
    .execute
end

#delete_product(domain, v2_ext, product_id) ⇒ ApiResponse

Delete a product. **Response Data**\ No data is returned. Look for a standard standard ‘SUCCESS` indicator in the `status` field. here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 767

def delete_product(domain,
                   v2_ext,
                   product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::DELETE,
                                 '/.{domain}{v2_ext}products/{product_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(DeleteProduct.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_assigned_product_license_keys(domain, v2_ext, product_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 971

def get_assigned_product_license_keys(domain,
                                      v2_ext,
                                      product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}products/{product_id}/licenses/assigned',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/x-www-form-urlencoded', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetAssignedProductLicenseKeys.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_available_products(domain, v2_ext, subscription_id) ⇒ ApiResponse

Get options for next recurring product. **Response Data**\ Response parameters expected in each trial workflow object contained within the ‘data` field array: | Field | Data Type | Description

|

| ————————————— | ———— | ————————————– | | id | Integer | The product ID.

|

| name | String | The product name.

|

| is_bundle | Boolean | True if the product is in bundle. | | is_custom_bundle | Boolean | True if the product is in a custom bundle. | | children | Array | List of children products for the Recurring Product. | | children.product_id | Integer | The children product ID. | | children.quantity | Integer | The children product quantity. | here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • subscription_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 99

def get_available_products(domain,
                           v2_ext,
                           subscription_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}subscriptions/{subscription_id}/products',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(subscription_id, key: 'subscription_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetAvailableProductsWithBundles.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_product(domain, v2_ext, product_id) ⇒ ApiResponse

Fetch a single product object. **Response Data**\ Response parameters contained within the ‘data` field object: | Field | Data Type | Description

|

| —————————– | ———— | ———————————————————— | | id | Integer | The product ID. | | is_trial_product | Integer Flag | A flag that determines whether or not the product is a trial product. | | is_shippable | Integer Flag | A flag that determines whether or not the product is shippable. | | tax_code | String | User-defined tax-code. | | is_licensed | Integer Flag | A flag that determines whether or not the product is a license product. | | name | String | The product name. | | description | String | The product description. | | sku | String | The product SKU identifier. | | price | Numeric | The product base price. | | weight | Numeric | The product weight. | | declared_value | Numeric | The product declared value. | | restocking_fee | Numeric | The product restocking fee. | | cost_of_goods | Numeric | The cost of goods sold. | | max_quantity | Integer | The maximum quantity allowed for purchase per order. | | created_at | Object | Nullable creation timestamp object. | | created_at.date | String | The creation timestamp. | | created_at.timezone_type | Integer | The creation timezone type ID. | | created_at.timezone | String | The creation timezone. | | updated_at | Object | Nullable last updated timestamp object. | | updated_at.date | String | The last updated timestamp. | | updated_at.timezone_type | Integer | The last updated timezone type ID. | | updated_at.timezone | String | The last updated timezone. | | custom_fields | Array | An array of custom field objects. | | vertical | Object | The vertical object associated with the product. | | vertical.id | Integer | The vertical ID. | | vertical.name | String | The vertical name. | | category_id | Integer | The category ID. | | category | Object | The image ID. | | category.id | Integer | The category object associated with the product. | | category.name | String | The category name. | | category.description | String | The category description. | | is_bundle | Integer Flag | A flag that determines whether or not the product is a bundle. | | is_custom_bundle | Integer Flag | A flag that determines whether or not the product is a custom bundle. | | shipping_restrictions | Array | An array of shipping restriction objects. | | paired_product_ids | Array | An array of paired product IDs. | | weight_unit | Object | The weight unit type object. | | weight_unit.id | Integer | The weight unit type ID. | | weight_unit.name | String | The weight unit type name. | | weight_unit.abbreviation | String | The weight unit type abbreviation. | | bundle_type | Object | The bundle type object. | | bundle_type.id | Integer | The bundle type ID. | | bundle_type.name | String | The bundle type name. | | price_type | Object | The bundle price type object. | | price_type.id | Integer | The bundle price type ID. | | price_type.name | String | The bundle price type name. | | bundle_children | Array | An array of bundle children objects. | | bundle_children.*.quantity | Integer | The bundle child quantity. | | bundle_children.*.id | Integer | The bundle child product ID. | | bundle_children.*.product_id | Integer | The bundle child product ID. | | bundle_children.*.name | String | The bundle child product name. | | attributes | Array | An array of product variant attributes. | | variants | Array | An array of product variant objects. | | is_variant_enabled | Integer Flag | A flag that determines whether or not the product has variants. | | images | Array | An array of image objects. | here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 518

def get_product(domain,
                v2_ext,
                product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}products/{product_id}',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetProduct.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_product_custom_fields(domain, v2_ext) ⇒ ApiResponse

Fetch a list of all custom fields created for products **Response Data**\ Response parameters expected in custom field object contained within the ‘data` field array: | Field | Data Type | Description | - | - | - | | id | Integer | The custom field ID. | field_type_id | Integer | The custom field’s field type ID. | name | String | The custom field name. | token_key | String | The custom field email token field. | is_multi | Integer Flag | Allow for multiple options to be selected. | options | Array | Array of option objects associated with the custom field. | options.*.id | Integer | The option ID. | options.*.value | String | The option value. | type_id | Integer | The custom field’s type ID.

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 811

def get_product_custom_fields(domain,
                              v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}custom_fields/products',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetProductCustomFields.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_products(domain, v2_ext) ⇒ ApiResponse

Fetch a list of products. **Response Data**\ Response parameters contained within the ‘data` field array: | Field | Data Type | Description

|

| ———————— | ———— | ———————————————————— | | id | Integer | The product ID. | | is_trial_product | Integer Flag | A flag that determines whether or not the product is a trial product. | | is_shippable | Integer Flag | A flag that determines whether or not the product is shippable. | | tax_code | String | User-defined tax-code. | | is_licensed | Integer Flag | A flag that determines whether or not the product is a license product. | | name | String | The product name. | | description | String | The product description. | | sku | String | The product SKU identifier. | | price | Numeric | The product base price. | | weight | Numeric | The product weight. | | declared_value | Numeric | The product declared value. | | restocking_fee | Numeric | The product restocking fee. | | cost_of_goods | Numeric | The cost of goods sold. | | max_quantity | Integer | The maximum quantity allowed for purchase per order. | | created_at | Object | Nullable creation timestamp object. | | created_at.date | String | The creation timestamp. | | created_at.timezone_type | Integer | The creation timezone type ID. | | created_at.timezone | String | The creation timezone. | | updated_at | Object | Nullable last updated timestamp object. | | updated_at.date | String | The last updated timestamp. | | updated_at.timezone_type | Integer | The last updated timezone type ID. | | updated_at.timezone | String | The last updated timezone. | | custom_fields | Array | An array of custom field objects. | | vertical | Object | The vertical object associated with the product. | | vertical.id | Integer | The vertical ID. | | vertical.name | String | The vertical name. | | category_id | Integer | The category ID. | | category | Object | The image ID. | | category.id | Integer | The category object associated with the product. | | category.name | String | The category name. | | category.description | String | The category description. | | is_bundle | Integer Flag | A flag that determines whether or not the product is a bundle. | | is_custom_bundle | Integer Flag | A flag that determines whether or not the product is a custom bundle. | | is_variant_enabled | Integer Flag | A flag that determines whether or not the product has variants. | | images | Array | An array of image objects. |

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 393

def get_products(domain,
                 v2_ext)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}products',
                                 Server::SERVER_1)
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetProducts.method(:from_hash))
                .is_api_response(true))
    .execute
end

#get_unassigned_product_license_keys(domain, v2_ext, product_id) ⇒ ApiResponse

TODO: type endpoint description here here

Parameters:

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 1003

def get_unassigned_product_license_keys(domain,
                                        v2_ext,
                                        product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::GET,
                                 '/.{domain}{v2_ext}products/{product_id}/licenses/unassigned',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(GetUnassignedProductLicenseKeys.method(:from_hash))
                .is_api_response(true))
    .execute
end

#update_custom_field_values(body, domain, v2_ext, product_id) ⇒ ApiResponse

**Note: Any Custom Field Values that are NOT included in the Update payload WILL be DELETED** Update custom fields list that attached to the product . **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type | Description | - | - | - | - | - | | custom_fields | Required | - | Array | Array of custom fields. | custom_fields.*.id | Required | - | Integer | The custom field ID. | custom_fields.*.value | Required | - | String | The custom field desired value. Required parameter: TODO: type description here here

Parameters:

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 898

def update_custom_field_values(body,
                               domain,
                               v2_ext,
                               product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}products/{product_id}/custom_fields',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateCustomFieldValues.method(:from_hash))
                .is_api_response(true))
    .execute
end

#update_product(body, domain, v2_ext, product_id) ⇒ ApiResponse

Update an existing product. **Request Data**\ Request parameters expected during this API call: | Field | Requirement | Default | Data Type

| Description                            |

| ———————————– | ———– | ——- | ———— | ————————————– | | name | Optional | - | String

| The product name. |

| sku | Optional | - | String

| The product SKU identifier |

| category_id | Optional | - | Integer

| The product category ID. |

| price | Optional | - | Numeric

| The product price. |

| cost_of_goods | Optional | - | Numeric

| The cost of goods sold. |

| restocking_fee | Optional | - | Numeric

| The restocking fee. |

| max_quantity | Optional | - | Integer

| The maximum quantity allowed per order for the product. |

| description | Optional | - | String

| the product description. |

| tax_code | Optional | - | String

| User-defined product tax code. |

| is_taxable | Optional | - | Integer Flag | A flag that determines whether or not the product is taxable. | | is_delivery_confirm | Optional | - | Integer Flag | A flag that determines whether or not delivery confirmation is required. | | is_signature_confirm | Optional | - | Integer Flag | A flag that determines whether or not signature confirmation is required. | | is_qty_preserved | Optional | - | Integer Flag | A flag that determines whether or not quantity is preserved upon rebill. | | is_collections_enabled | Optional | - | Integer Flag | A flag that determines whether or not this product is eligible for collections. | | weight | Optional | - | Numeric

| The product weight. |

| weight_unit_id | Optional | - | Integer

| The product weight unit ID. |

| bundle | Optional | - | Object

| (Bundle products only) A product bundle configuration object. |

| bundle.type_id | Conditional | - | Integer

| The product bundle type ID. |

| bundle.price_type_id | Conditional | - | Integer

| The product bundle price type ID. |

| bundle.max_items | Conditional | - | Integer

| The maximum items allowed in a bundle. |

| bundle.children | Optional | - | Array

| An array of product bundle children objects (pre-built bundles). |

| bundle.children.*.product_id | Conditional | - | Integer

| The child product ID. |

| bundle.children.*.quantity | Conditional | - | Integer

| The child product quantity. |

| shipping_restrictions | Optional | - | Array

| An array of shipping restriction objects. |

| shipping_restrictions.*.country_id | Conditional | - | Integer

| The shipping restriction country ID. |

| shipping_restrictions.*.values | Conditional | - | Array

| An array of shipping restriction values. |

| shipping_restrictions.*.values.* | Conditional | - | String

| Shipping restriction value. |

| auto_create_variants | Optional | - | Integer Flag | A flag that determines whether or not to create variants based on the provided attributes. | | attributes | Optional | - | Array

| An array of product variant attributes. |

| attributes.*.name | Conditional | - | String

| Variant attribute name. |

| attributes.*.options | Conditional | - | Array

| An array of variant attribute options. |

| attributes.*.options.* | Conditional | - | String

| Variant attribute option name. |

| paired_product_ids | Optional | - | Array

| An array of paired product IDs. |

| paired_product_ids.* | Conditional | - | Integer

| Paired product ID. |

**Response Data**\ Response parameters contained within the ‘data` field object: | Field | Data Type | Description

|

| —————————– | ———— | ———————————————————— | | id | Integer | The product ID. | | is_trial_product | Integer Flag | A flag that determines whether or not the product is a trial product. | | is_shippable | Integer Flag | A flag that determines whether or not the product is shippable. | | tax_code | String | User-defined tax-code. | | is_licensed | Integer Flag | A flag that determines whether or not the product is a license product. | | name | String | The product name. | | description | String | The product description. | | sku | String | The product SKU identifier. | | price | Numeric | The product base price. | | weight | Numeric | The product weight. | | declared_value | Numeric | The product declared value. | | restocking_fee | Numeric | The product restocking fee. | | cost_of_goods | Numeric | The cost of goods sold. | | max_quantity | Integer | The maximum quantity allowed for purchase per order. | | created_at | Object | Nullable creation timestamp object. | | created_at.date | String | The creation timestamp. | | created_at.timezone_type | Integer | The creation timezone type ID. | | created_at.timezone | String | The creation timezone. | | updated_at | Object | Nullable last updated timestamp object. | | updated_at.date | String | The last updated timestamp. | | updated_at.timezone_type | Integer | The last updated timezone type ID. | | updated_at.timezone | String | The last updated timezone. | | custom_fields | Array | An array of custom field objects. | | vertical | Object | The vertical object associated with the product. | | vertical.id | Integer | The vertical ID. | | vertical.name | String | The vertical name. | | category_id | Integer | The category ID. | | category | Object | The image ID. | | category.id | Integer | The category object associated with the product. | | category.name | String | The category name. | | category.description | String | The category description. | | is_bundle | Integer Flag | A flag that determines whether or not the product is a bundle. | | is_custom_bundle | Integer Flag | A flag that determines whether or not the product is a custom bundle. | | shipping_restrictions | Array | An array of shipping restriction objects. | | paired_product_ids | Array | An array of paired product IDs. | | weight_unit | Object | The weight unit type object. | | weight_unit.id | Integer | The weight unit type ID. | | weight_unit.name | String | The weight unit type name. | | weight_unit.abbreviation | String | The weight unit type abbreviation. | | bundle_type | Object | The bundle type object. | | bundle_type.id | Integer | The bundle type ID. | | bundle_type.name | String | The bundle type name. | | price_type | Object | The bundle price type object. | | price_type.id | Integer | The bundle price type ID. | | price_type.name | String | The bundle price type name. | | bundle_children | Array | An array of bundle children objects. | | bundle_children.*.quantity | Integer | The bundle child quantity. | | bundle_children.*.id | Integer | The bundle child product ID. | | bundle_children.*.product_id | Integer | The bundle child product ID. | | bundle_children.*.name | String | The bundle child product name. | | attributes | Array | An array of product variant attributes. | | variants | Array | An array of product variant objects. | | is_variant_enabled | Integer Flag | A flag that determines whether or not the product has variants. | | images | Array | An array of image objects. | description here here

Parameters:

  • body (UpdateProductRequest)

    Required parameter: TODO: type

  • domain (String)

    Required parameter: TODO: type description here

  • v2_ext (String)

    Required parameter: TODO: type description here

  • product_id (String)

    Required parameter: TODO: type description

Returns:

  • (ApiResponse)

    Complete http response with raw body and status code.



728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
# File 'lib/sticky_io_restful_api_v2025731/controllers/products_controller.rb', line 728

def update_product(body,
                   domain,
                   v2_ext,
                   product_id)
  @api_call
    .request(new_request_builder(HttpMethodEnum::PUT,
                                 '/.{domain}{v2_ext}products/{product_id}',
                                 Server::SERVER_1)
               .header_param(new_parameter('application/json', key: 'Content-Type'))
               .body_param(new_parameter(body)
                            .is_required(true))
               .template_param(new_parameter(domain, key: 'domain')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(v2_ext, key: 'v2_ext')
                                .is_required(true)
                                .should_encode(true))
               .template_param(new_parameter(product_id, key: 'product_id')
                                .is_required(true)
                                .should_encode(true))
               .header_param(new_parameter('application/json', key: 'accept'))
               .body_serializer(proc do |param| param.to_json unless param.nil? end)
               .auth(Single.new('basic')))
    .response(new_response_handler
                .deserializer(APIHelper.method(:custom_type_deserializer))
                .deserialize_into(UpdateProduct.method(:from_hash))
                .is_api_response(true))
    .execute
end