pub struct CatalogItemVariation {Show 21 fields
pub item_id: Option<String>,
pub name: Option<String>,
pub sku: Option<String>,
pub upc: Option<String>,
pub ordinal: Option<i32>,
pub pricing_type: Option<CatalogPricingType>,
pub price_money: Option<Money>,
pub location_overrides: Option<Vec<ItemVariationLocationOverrides>>,
pub track_inventory: Option<bool>,
pub inventory_alert_type: Option<InventoryAlertType>,
pub inventory_alert_threshold: Option<i64>,
pub user_data: Option<String>,
pub service_duration: Option<i64>,
pub available_for_booking: Option<bool>,
pub item_option_values: Option<Vec<CatalogItemOptionValueForItemVariation>>,
pub measurement_unit_id: Option<String>,
pub sellable: Option<bool>,
pub stockable: Option<bool>,
pub image_ids: Option<Vec<String>>,
pub team_member_ids: Option<Vec<String>>,
pub stockable_conversion: Option<CatalogStockConversion>,
}
Expand description
An item variation (i.e., product) in the Catalog object model.
Each item may have a maximum of 250 item variations.
Fields§
§item_id: Option<String>
The ID of the CatalogItem
associated with this item variation.
name: Option<String>
The item variation’s name. This is a searchable attribute for use in applicable query filters, and its value length is of Unicode code points.
Max Length 255
sku: Option<String>
The item variation’s SKU, if any. This is a searchable attribute for use in applicable query filters.
upc: Option<String>
The universal product code (UPC) of the item variation, if any. This is a searchable attribute for use in applicable query filters.
The value of this attribute should be a number of 12-14 digits long. This restriction is enforced on the Square Seller Dashboard, Square Point of Sale or Retail Point of Sale apps, where this attribute shows in the GTIN field. If a non-compliant UPC value is assigned to this attribute using the API, the value is not editable on the Seller Dashboard, Square Point of Sale or Retail Point of Sale apps unless it is updated to fit the expected format.
ordinal: Option<i32>
Read only The order in which this item variation should be displayed. This value is
read-only. On writes, the ordinal for each item variation within a parent CatalogItem
is
set according to the item variations’s position. On reads, the value is not guaranteed to be
sequential or unique.
pricing_type: Option<CatalogPricingType>
Indicates whether the item variation’s price is fixed or determined at the time of sale.
price_money: Option<Money>
The item variation’s price, if fixed pricing is used.
location_overrides: Option<Vec<ItemVariationLocationOverrides>>
Per-location price and inventory overrides.
track_inventory: Option<bool>
If true
, inventory tracking is active for the variation.
inventory_alert_type: Option<InventoryAlertType>
Indicates whether the item variation displays an alert when its inventory quantity is less
than or equal to its inventory_alert_threshold
.
inventory_alert_threshold: Option<i64>
If the inventory quantity for the variation is less than or equal to this value and
inventory_alert_type
is LOW_QUANTITY
, the variation displays an alert in the merchant
dashboard.
This value is always an integer.
user_data: Option<String>
Arbitrary user metadata to associate with the item variation. This attribute value length is of Unicode code points.
Max Length 255
service_duration: Option<i64>
If the CatalogItem
that owns this item variation is of type APPOINTMENTS_SERVICE
, then
this is the duration of the service in milliseconds. For example, a 30 minute appointment
would have the value 1800000
, which is equal to 30 (minutes) * 60 (seconds per minute) *
1000 (milliseconds per second).
available_for_booking: Option<bool>
If the CatalogItem
that owns this item variation is of type APPOINTMENTS_SERVICE
, a bool
representing whether this service is available for booking.
item_option_values: Option<Vec<CatalogItemOptionValueForItemVariation>>
List of item option values associated with this item variation. Listed in the same order as the item options of the parent item.
measurement_unit_id: Option<String>
ID of the CatalogMeasurementUnit
that is used to measure the quantity sold of this item
variation. If left unset, the item will be sold in whole quantities.
sellable: Option<bool>
Whether this variation can be sold.
stockable: Option<bool>
Whether stock is counted directly on this variation (TRUE) or only on its components (FALSE).
image_ids: Option<Vec<String>>
The IDs of images associated with this CatalogItemVariation
instance. These images will be
shown to customers in Square Online Store.
team_member_ids: Option<Vec<String>>
Tokens of employees that can perform the service represented by this variation. Only valid
for variations of type APPOINTMENTS_SERVICE
.
stockable_conversion: Option<CatalogStockConversion>
The rule of conversion of the CatalogStockConversion type that describes how this non-stockable sellable/receivable item variation is converted to/from the stockable item variation sharing the same parent item.
Trait Implementations§
Source§impl Clone for CatalogItemVariation
impl Clone for CatalogItemVariation
Source§fn clone(&self) -> CatalogItemVariation
fn clone(&self) -> CatalogItemVariation
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for CatalogItemVariation
impl Debug for CatalogItemVariation
Source§impl Default for CatalogItemVariation
impl Default for CatalogItemVariation
Source§fn default() -> CatalogItemVariation
fn default() -> CatalogItemVariation
Source§impl<'de> Deserialize<'de> for CatalogItemVariation
impl<'de> Deserialize<'de> for CatalogItemVariation
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CatalogItemVariation
impl PartialEq for CatalogItemVariation
Source§impl Serialize for CatalogItemVariation
impl Serialize for CatalogItemVariation
impl Eq for CatalogItemVariation
impl StructuralPartialEq for CatalogItemVariation
Auto Trait Implementations§
impl Freeze for CatalogItemVariation
impl RefUnwindSafe for CatalogItemVariation
impl Send for CatalogItemVariation
impl Sync for CatalogItemVariation
impl Unpin for CatalogItemVariation
impl UnwindSafe for CatalogItemVariation
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.