katana_public_api_client.api.variant.create_variant¶
katana_public_api_client.api.variant.create_variant
¶
Classes¶
Functions¶
asyncio(*, client, body)
async
¶
Create a variant
Creates a new variant object. Note that you can create variants for both products and materials. In order for Katana to know which one you are creating, you have to specify either product_id or material_id, not both.
Parameters:
-
body(CreateVariantRequest) –Request payload for creating a new product or material variant with specific SKU and configuration attributes Example: {'sku': 'KNF-PRO-12PC-WD', 'sales_price': 399.99, 'purchase_price': 200.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-12PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 10, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '12-piece'}, {'config_name': 'Handle Material', 'config_value': 'Wood'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '5 years'}, {'field_name': 'Care Instructions', 'field_value': 'Hand wash only'}]}.
Raises:
-
UnexpectedStatus–If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
-
TimeoutException–If the request takes longer than Client.timeout.
Returns:
-
DetailedErrorResponse | ErrorResponse | Variant | None–Union[DetailedErrorResponse, ErrorResponse, Variant]
Source code in katana_public_api_client/api/variant/create_variant.py
asyncio_detailed(*, client, body)
async
¶
Create a variant
Creates a new variant object. Note that you can create variants for both products and materials. In order for Katana to know which one you are creating, you have to specify either product_id or material_id, not both.
Parameters:
-
body(CreateVariantRequest) –Request payload for creating a new product or material variant with specific SKU and configuration attributes Example: {'sku': 'KNF-PRO-12PC-WD', 'sales_price': 399.99, 'purchase_price': 200.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-12PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 10, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '12-piece'}, {'config_name': 'Handle Material', 'config_value': 'Wood'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '5 years'}, {'field_name': 'Care Instructions', 'field_value': 'Hand wash only'}]}.
Raises:
-
UnexpectedStatus–If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
-
TimeoutException–If the request takes longer than Client.timeout.
Returns:
-
Response[DetailedErrorResponse | ErrorResponse | Variant]–Response[Union[DetailedErrorResponse, ErrorResponse, Variant]]
Source code in katana_public_api_client/api/variant/create_variant.py
sync(*, client, body)
¶
Create a variant
Creates a new variant object. Note that you can create variants for both products and materials. In order for Katana to know which one you are creating, you have to specify either product_id or material_id, not both.
Parameters:
-
body(CreateVariantRequest) –Request payload for creating a new product or material variant with specific SKU and configuration attributes Example: {'sku': 'KNF-PRO-12PC-WD', 'sales_price': 399.99, 'purchase_price': 200.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-12PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 10, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '12-piece'}, {'config_name': 'Handle Material', 'config_value': 'Wood'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '5 years'}, {'field_name': 'Care Instructions', 'field_value': 'Hand wash only'}]}.
Raises:
-
UnexpectedStatus–If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
-
TimeoutException–If the request takes longer than Client.timeout.
Returns:
-
DetailedErrorResponse | ErrorResponse | Variant | None–Union[DetailedErrorResponse, ErrorResponse, Variant]
Source code in katana_public_api_client/api/variant/create_variant.py
sync_detailed(*, client, body)
¶
Create a variant
Creates a new variant object. Note that you can create variants for both products and materials. In order for Katana to know which one you are creating, you have to specify either product_id or material_id, not both.
Parameters:
-
body(CreateVariantRequest) –Request payload for creating a new product or material variant with specific SKU and configuration attributes Example: {'sku': 'KNF-PRO-12PC-WD', 'sales_price': 399.99, 'purchase_price': 200.0, 'product_id': 101, 'material_id': None, 'supplier_item_codes': ['SUP-KNF-12PC-002'], 'internal_barcode': 'INT-KNF-002', 'registered_barcode': '789123456790', 'lead_time': 10, 'minimum_order_quantity': 1, 'config_attributes': [{'config_name': 'Piece Count', 'config_value': '12-piece'}, {'config_name': 'Handle Material', 'config_value': 'Wood'}], 'custom_fields': [{'field_name': 'Warranty Period', 'field_value': '5 years'}, {'field_name': 'Care Instructions', 'field_value': 'Hand wash only'}]}.
Raises:
-
UnexpectedStatus–If the server returns an undocumented status code and Client.raise_on_unexpected_status is True.
-
TimeoutException–If the request takes longer than Client.timeout.
Returns:
-
Response[DetailedErrorResponse | ErrorResponse | Variant]–Response[Union[DetailedErrorResponse, ErrorResponse, Variant]]