Item

Struct Item 

Source
pub struct Item {
Show 35 fields pub id: Option<String>, pub sync_token: Option<String>, pub meta_data: Option<MetaData>, pub active: Option<bool>, pub asset_account_ref: Option<NtRef>, pub description: Option<String>, pub domain: Option<String>, pub expense_account_ref: Option<NtRef>, pub fully_qualified_name: Option<String>, pub income_account_ref: Option<NtRef>, pub inv_start_date: Option<NaiveDate>, pub sales_tax_included: Option<bool>, pub sales_tax_code_ref: Option<NtRef>, pub class_ref: Option<NtRef>, pub source: Option<String>, pub purchase_tax_included: Option<bool>, pub reorder_point: Option<f64>, pub purchase_dec: Option<String>, pub pref_vendor_ref: Option<NtRef>, pub purchase_tax_code_ref: Option<NtRef>, pub purchase_cost: Option<f64>, pub parent_ref: Option<NtRef>, pub tax_classification_ref: Option<NtRef>, pub item_category_type: Option<String>, pub item_type: Option<ItemType>, pub level: Option<i64>, pub name: Option<String>, pub purchase_desc: Option<String>, pub qty_on_hand: Option<i64>, pub sku: Option<String>, pub sparse: Option<bool>, pub sub_item: Option<bool>, pub taxable: Option<bool>, pub track_qty_on_hand: Option<bool>, pub unit_price: Option<f64>,
}
Expand description

Item

Represents a product or service that can be purchased or sold. Items determine posting accounts (income, expense, inventory) and pricing.

Creation requirements:

  • QBCreatable::can_create() returns true when:
    • name and expense_account_ref are present, and
    • for ItemType::Inventory: income_account_ref, asset_account_ref, inv_start_date, and qty_on_hand are present
    • for ItemType::Service: income_account_ref is present
    • for ItemType::NonInventory: no additional fields beyond name and expense_account_ref
    • if item_type is None: asset_account_ref must be present

Update semantics:

  • QBFullUpdatable::can_full_update() returns true when has_read() is true (ID + sync token) and name is present.

API reference: https://developer.intuit.com/app/developer/qbo/docs/api/accounting/all-entities/item

Fields§

§id: Option<String>§sync_token: Option<String>§meta_data: Option<MetaData>§active: Option<bool>

If true, the object is currently enabled for use by QuickBooks.

§asset_account_ref: Option<NtRef>

Reference to the Inventory Asset account that tracks the current value of the inventory. If the same account is used for all inventory items, the current balance of this account will represent the current total value of the inventory. Query the Account name list resource to determine the appropriate Account object for this reference. Use Account.id and Account.name from that object for AssetAccountRef.value and AssetAccountRef.name, respectively.

Required for Inventory item types.

§description: Option<String>

Description of the item.

  • max character: maximum of 4000 chars
§domain: Option<String>

Documentation unavailable.

§expense_account_ref: Option<NtRef>

Reference to the expense account used to pay the vendor for this item. Must be an account with account type of Cost of Goods Sold. Query the Account name list resource to determine the appropriate Account object for this reference. Use Account.id and Account.name from that object for ExpenseAccountRef.value and ExpenseAccountRef.name, respectively.

For France locales:

  • This is an optional field.
  • This is the purchase account id, If not provided it defaults to the default purchase account: 605100 and 601100 are the default expense accounts used for Service and Product type of item, respectively.

Required for Inventory, NonInventory, and Service item types

§fully_qualified_name: Option<String>

Fully qualified name of the entity. The fully qualified name prepends the topmost parent, followed by each sub element separated by colons. Takes the form of Item:SubItem. Returned from an existing object and not input on a new object. Limited to 5 levels.

  • filterable
  • read only
  • system defined
§income_account_ref: Option<NtRef>§inv_start_date: Option<NaiveDate>§sales_tax_included: Option<bool>§sales_tax_code_ref: Option<NtRef>§class_ref: Option<NtRef>§source: Option<String>§purchase_tax_included: Option<bool>§reorder_point: Option<f64>§purchase_dec: Option<String>§pref_vendor_ref: Option<NtRef>§purchase_tax_code_ref: Option<NtRef>§purchase_cost: Option<f64>§parent_ref: Option<NtRef>§tax_classification_ref: Option<NtRef>§item_category_type: Option<String>

Classification that specifies the use of this item. Available when endpoint is evoked with the minorversion=3 query parameter. Read-only after object is created. Valid values include: Product and Service.

Applicable for France companies only.

§item_type: Option<ItemType>§level: Option<i64>§name: Option<String>§purchase_desc: Option<String>§qty_on_hand: Option<i64>§sku: Option<String>§sparse: Option<bool>§sub_item: Option<bool>§taxable: Option<bool>§track_qty_on_hand: Option<bool>§unit_price: Option<f64>

Trait Implementations§

Source§

impl Clone for Item

Source§

fn clone(&self) -> Item

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Item

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Item

Source§

fn default() -> Item

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for Item
where Item: Default,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for Item

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for Item

Source§

fn eq(&self, other: &Item) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl QBCreatable for Item

Source§

impl QBFullUpdatable for Item

Source§

impl QBItem for Item

Source§

fn id(&self) -> Option<&String>

Source§

fn clone_id(&self) -> Option<String>

Source§

fn sync_token(&self) -> Option<&String>

Source§

fn meta_data(&self) -> Option<&MetaData>

Source§

fn name() -> &'static str

Source§

fn qb_id() -> &'static str

Source§

fn has_read(&self) -> bool

Source§

impl QBToRef for Item

Source§

impl Serialize for Item

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Item

Auto Trait Implementations§

§

impl Freeze for Item

§

impl RefUnwindSafe for Item

§

impl Send for Item

§

impl Sync for Item

§

impl Unpin for Item

§

impl UnwindSafe for Item

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> QBReadable for T
where T: QBItem,

Source§

fn can_read(&self) -> bool

Source§

impl<T> QBToAttachableRef for T
where T: QBToRef,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> QBQueryable for T
where T: QBItem,