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

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Returns the “default value” for a type. Read more
Deserialize this value from the given Serde deserializer. Read more
This method tests for self and other values to be equal, and is used by ==. Read more
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason. Read more
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more