4D Accounting SDK 2020 .NET Edition

Questions / Feedback?

Item Component

Properties   Methods   Events   Configuration Settings   Errors  

The Item component is used to add any of eight types of items to QuickBooks's item list. It may also get item data, and in some cases, may modify it as well.

Syntax

DPayments.DAccountingSDK.Item

Remarks

The Item component may be used to add or retrieve any of the following types of items: service, inventory, non-inventory, sales tax, discount, payment, subtotal, or other charge. To add an item to QuickBooks, first set the ItemType property to the appropriate value as well as ItemName. Then, you may set a variety of other properties and special fields, which differ depending on the type of item.

Service, Non-Inventory, and Other Charge Items

These types of items may be purchased from vendors, sold to customers, or both.

In case the item is purchased but not sold, or sold but not purchased, the Description, Price, PricePercent, and Account properties are used. The Account property is the only one required; it should specify an income account if the item is sold, or an expense account if the item is purchased.

Equivalently, you may specify PurchaseExpenseAccount, Cost, and Description. This will have the same effect, because QuickBooks does not distinguish between items that are purchased only and items that are sold only. However, QuickBooks data will always be returned in Description, Price, and Account.

In case the item is both sold and purchased, you should specify Description, Price, PricePercent, and Account for sales, and Description, Cost, PurchasePreferredVendor, and PurchaseExpenseAccount for purchase transactions. This will cause different default rates to appear on sales transactions (such as invoices) and purchase transactions (such as bills).

Example (Adding a service item)

Item1.ItemType = itService              '1
Item1.ItemName = "Accounting Services"
Item1.Description = "General accounting services"
Item1.Price = "70.00"                   '$70.00 per hour
Item1.AccountName = "Accounting:Labor"
Item1.Add()
Inventory Items

Inventory items are always both sold and purchased, so the interface is similar to that for non-inventory items that are sold and purchased. Set Description, Price, and Account for sales, and Description, Cost, and PurchasePreferredVendor for purchases. Instead of setting PurchaseExpenseAccount you must instead set two separate accounts: PurchaseCOGSAccount refers to your Cost Of Goods Sold account, and PurchaseAssetAccount refers to your Inventory Assets account.

Other details are also available as special fields: See Config for details on how to set or query the quantity on hand and on order, reorder point, and the inventory date.

Example

Item1.ItemType = itInventory                    '2
Item1.ItemName = "French Door"
Item1.Description = "Glass French Door"         'this will appear on invoices
Item1.Price = "245.00"                          'Charge $245.00 to customers
Item1.AccountName = "Construction:Materials"
Item1.Purchase.Description = "Glass French Door"  'this will appear on bills
Item1.Purchase.Cost = "160.00"
Item1.Purchase.PreferredVendorName = "Joe's Doors, Inc."
Item1.Purchase.COGSAccountName = "Cost Of Goods Sold"
Item1.Purchase.AssetAccountName = "Inventory Asset"
Item1.Add()
Other Items

Other types of items are considerably less complex.

To add a discount item to QuickBooks, set ItemName and the SalesTaxCode, as well as the Description, Price or PricePercent (here these properties refer to the rate of discount), as well as an Account.

To add a payment item to QuickBooks, set ItemName, Description, Account, and the PaymentMethod special field.

To add a sales tax item to QuickBooks, set ItemName, Description, and the TaxRate and TaxVendor special fields.

To add a subtotal item to QuickBooks, set ItemName and Description.

Example (Adding a sales tax item) Item1.ItemType = itSalesTax '6 Item1.ItemName = "San Jose, CA" Item1.Config("TaxRate=6.75") Item1.Config("TaxVendorName=San Jose Board of Taxation") Item1.Add()

Modifying Items

This functionality requires QuickBooks 2003. You must first set QBXMLVersion to "2.0" or higher before you may modify items.

Update functionality is limited to service, inventory, and non-inventory items. You may update the name, sales tax code, description(s), and price(s). However, with the exception of inventory, you may not change any of the accounts associated with items, nor can you convert items into other types of items.

In the case of inventory items, you may modify PurchaseCOGSAccount and PurchaseAssetAccount, but not the sales income account.

Getting Items

You may also use the component to get items from QuickBooks using their RefId or ItemName: simply call Get or GetByName.

It is not necessary to set ItemType before getting items from QuickBooks. Both Get and GetByName will get any type of item from QuickBooks, and will populate ItemType automatically. In case ItemType is itUnknown the SpecialItemType special field will contain QuickBooks's description of the type of item. In some cases (such as for inventory assembly items) properties such as Description, Account, etc. may contain relevant information.

Property List


The following is the full list of the properties of the component with short descriptions. Click on the links for further details.

AccountIdAn account for this item.
AccountNameAn account for this item.
DateSoldIndicates Date asset was sold.
DescriptionA description for the item.
InventoryQuantityOnHandThe quantity in stock for this inventory item.
InventoryReorderPointThe reorder point for this inventory item.
InventoryTotalValueThe total value of this inventory item.
ItemNameName of the item.
ItemTypeThe type of item.
LineItemsCollection of line items.
ParentIdReference to parent Item .
ParentNameReference to parent Item .
PriceThe price for this item.
PricePercentA price percent for this item.
PurchaseContains purchase information about an Inventory Item.
QBConnectionStringAn aggregate consisting of various QuickBooks connection properties.
QBRequestAggregateThe request aggregate.
QBRequestIdThe Id of the next message to be sent to QuickBooks.
QBRequestModeDefines whether the request is made online or stored offline.
QBResponseAggregateThe last QBXML response aggregate received from QuickBooks.
QBXMLVersionThe version of QBXML used in the outgoing message.
RefIdAn alphanumerical identifier generated by the server.
SalesTaxCodeIdWhether or not this item is taxable.
SalesTaxCodeNameWhether or not this item is taxable.
SalesTaxItemsSales tax items used for SalesTaxGroup Item transactions.

Method List


The following is the full list of the methods of the component with short descriptions. Click on the links for further details.

AddAdds the record into QuickBooks.
CheckRequestStatusChecks whether or not the specified request was processed by QuickBooks.
CloseQBConnectionCloses a persistent connection to QuickBooks.
ConfigSets or retrieves a configuration setting.
DeleteDeletes the record from QuickBooks.
GetGets a single record from QuickBooks.
GetByNameGets a single record from QuickBooks.
GetCustomFieldGets a custom field value from QuickBooks.
ImportQBXMLImports a QBXML response aggregate.
OpenQBConnectionOpens a persistent connection to QuickBooks.
ResetResets all properties to their defaults.
SetCustomFieldSets a custom field value within QuickBooks.
UpdateUpdates the item in QuickBooks.

Event List


The following is the full list of the events fired by the component with short descriptions. Click on the links for further details.

ErrorInformation about errors during data delivery.
SSLServerAuthenticationFired after the server presents its certificate to the client.
SSLStatusShows the progress of the secure connection.
StatusShows the progress of the QuickBooks connection.
WarningFired when a warning occurs.

Configuration Settings


The following is a list of configuration settings for the component with short descriptions. Click on the links for further details.

AssetAcquiredAsIndicates whether this item was new or used when the business acquired it.
AssetBookValueA reasonable estimate of the sales value of the fixed asset, as of the end of the year.
AssetCostBasisThe total cost of the fixed asset.
AssetDepreciationThe amount the fixed asset has lost in value since it was purchased, as of the end of the year.
AssetDescriptionDescription of the asset.
AssetLocationWhere the asset is located or has been placed into service.
AssetNotesAdditional information about the asset.
AssetNumberThe number used by the QuickBooks Fixed Asset Manager to identify this asset.
AssetPONumberThe purchase order number associated with this asset.
AssetSerialNumberThe serial number of the asset.
AssetWarrantyExpiresThe date when the warranty for this asset expires.
AuthFlagsConnection Flags (use for QuickBooks Simple Start).
EditSequenceAn identifier for this copy of the object.
EnforceMaxLengthIndicates whether to enforce max lengths for QB Fields.
FullNameThe name of the Item.
GetHighestVersionHighest QBXMLVersion supported by the installed instance of QuickBooks.
GetRequestProcessorDLLVersionReturns the version of the QB Request Processor that is installed on your system.
GetSupportedVersionsReturns a list of QBXMLVersions that are supported by QuickBooks.
InventoryAverageCostThe average purchase cost for this inventory item.
InventoryDateThe date when the item was converted into an inventory item.
InventoryQuantityOnOrderThe number of these items that have been ordered from vendors, but not received.
InventoryQuantityOnSalesOrderThe number of these items that have been ordered by customers, but not delivered.
IsActiveIndicates whether the object is currently enabled for use by QuickBooks.
IsReadOnlyThis causes the QuickBooks authorization dialog to display text informing the user that its access will be read-only.
PartNumberThe Manufacturer's Part Number for the Item.
PaymentMethodIdThe method of payment, i.e., 'Check', 'Credit Card', etc.
PaymentMethodNameThe method of payment, i.e., 'Check', 'Credit Card', etc.
PersonalDataPrefWhether the connecting application will require access to personal data such as SSN or credit card information.
QBConnectionModeThe mode of connection to QuickBooks.
QBFileStatusThe status of the company file as it pertains to accepting connections.
QBOpenCompanyFileThe file currently open in QuickBooks.
SalesExpenseAny expenses that were incurred during the sale of a fixed asset.
SendRawXMLSends specified XML to quickbooks without modification.
SpecialItemTypeThe type of the item when ItemType is Unknown.
SSLAcceptServerCertThe SSL certificate being used by the Remote Connector.
SSLAcceptServerCertFileThe SSL certificate file being used by the Remote Connector.
StopOnErrorSpecifies how QuickBooks is to proceed if an error occurs in processing of the current request.
SublevelThe number of ancestors this Item has.
TaxRateThe percentage rate of tax.
TaxVendorIdThe VENDOR or tax agency to whom taxes are due.
TaxVendorNameThe VENDOR or tax agency to whom taxes are due.
TimeCreatedThe time the object was created.
TimeModifiedThe time the object was created.
UnattendedModePrefWhether connecting while QuickBooks is closed is required or optional for the user.
UnitOfMeasureIdId of the units that the item is measured in.
UnitOfMeasureNameName of the units that the item is measured in.
VendorOrPayeeNameName of the vendor from whom this asset was purchased.
WarningCodesA comma-separated list of QuickBooks warning codes that should not result in an exception.
BuildInfoInformation about the product's build.
GUIAvailableTells the component whether or not a message loop is available for processing events.
LicenseInfoInformation about the current license.
UseInternalSecurityAPITells the component whether or not to use the system security libraries or an internal implementation.

 
 
Copyright (c) 2021 4D Payments Inc. - All rights reserved.
4D Accounting SDK 2020 .NET Edition - Version 20.0 [Build 7887]