QuickBooks API

Overview

These public interfaces are used in QuickBooks components. They are provided for implementing advanced functionality in your scripts. In order for you to use these interfaces in your project, you have to reference CozyRoc.SSISPlus.dll and CozyRoc.Intuit.dll libraries. Also include CozyRoc.SqlServer.SSIS and CozyRoc.Intuit.QuickBooks namespaces.

IConnection / IQbConnection

When you call QuickBooks Connection Manager AcquireConnection method, it returns object implementing IConnection interface. This is the interface used for interaction with QuickBooks service.

Connect method

Connects to QuickBooks service. The method result is IService object.

Close method

Closes the connection to QuickBooks service. Use always after you finish working with the service.

IsConnected method

Returns true if connected to the service.

GetService method

Get IService object.

GetObjectList method

Gets objects list for specific operation. These are the method parameters:

  • operation (uint) – It can be one of the options listed in the following table.

    Value Description
    0 Return objects, which can be read.
    1 Return objects, which support record creation.
    2 Return objects, which can be updated.
    3 Return objects, which permit record removal.
    4 Return objects, which permit record void.

GetCompositeObjectList method (1.6 SR-1)

Gets specified object composite objects list. These are the method parameters:

  • root (string) – object name.
  • operation (uint) – It can be one of the options listed in the following table.

    Value Description
    0 Return objects, which can be read.
    1 Return objects, which support record creation.
    2 Return objects, which can be updated.

GetObject method

Get object used to manage QuickBooks object. The method returns IObject object. These are the method parameters:

  • name (string) – object name.

DeploymentType property (string) (1.6 SR-3)

Select QuickBooks deployment type. This property has the options listed in the following table.

Value Description
0 QuickBooks Online deployment.
1 QuickBooks deployed on premise (default).

ServerHost property (string)

Specify the name or IP address of the QuickBooks service.

ServerLogin property (string)

Specify login to access the QuickBooks service.

ServerKey property (string)

Specify key to access the QuickBooks service.

ApplicationID property (string)

Specify application identifier to access the QuickBooks service.

ServerTimeout property (int)

Specify the number of seconds before timing out session connect. The default value of this property is 100 seconds.

RetainSameConnection property (bool)

Specify if all clients should use the same connection. This property has the options listed in the following table.

Value Description
True All clients use same connection (default).
False Every client uses different connection.

ProxyHost property (string)

Specify the name or IP address of the proxy server.

ProxyPort property (int)

Specify the port number on the proxy server to use for the connection.

ProxyUser property (string)

Specify user name to access the proxy server.

ProxyPassword property (string)

Specify password to access the proxy server.

IField / IQbField

This interface is used to retrieve QuickBooks object field information.

Name property (string)

Returns field name.

IsKey property (bool)

Returns true if field is object key.

FieldType property (DataType)

Returns field type.

Length property (int)

Returns field length.

Precision property (int)

Returns field precision.

Scale property (int)

Returns field scale.

IObject / IQbObject

This interface is used for QuickBooks object management.

GetFields method

Get object fields. The method returns array of IField objects.

NewObject method

Constructs new in-memory QuickBooks object instance. This property has the options listed in the following table.

Value Description
0 Return instance of result object.
1 Return instance of create object.
2 Return instance of update object.

SetFieldValue method

Sets field value in object instance. These are the method parameters:

  • instance (object) – object instance.
  • field (string) – field name.
  • value (object) – field value.

GetFieldValue method

Returns field value from object instance. These are the method parameters:

  • instance (object) – object instance.
  • field (string) – field name.

GetData method

Retrieves objects from QuickBooks service. The method returns array of QuickBooks objects. These are the method parameters:

  • query (string) – If data is retrieved from regular QuickBooks object, the query parameter should contain XML string of QuickBooks query. If data is retrieved from composite object, the query parameter should contain object key. Multiple keys are separated with semicolon (;).
  • fields (string array) – list of fields to retrieve.
  • iterator (ref string) – contains current start iteration position. After data is retrieved, the parameter will contain next iteration position.
  • batchSize (int) – number of records to retrieve in one batch.

Create method

Creates records in object. The method returns array of IStatus objects for each input object. These are the method parameters:

  • list (object array) – array of QuickBooks objects to create.

Update method

Updates existing records in object. The method returns array of IStatus objects for each input object. These are the method parameters:

  • list (object array) – array of QuickBooks objects with update data.

UpdateComposite method

Updates composite object. These are the method parameters:

  • instance (object) – QuickBooks object instance.
  • key (string) – composite object key. Multiple keys are separated with semicolon (;).
  • list (object array) – array of QuickBooks objects with update data.

Delete method

Deletes records in object. The method returns array of IStatus objects for each input object. These are the method parameters:

  • list (string array) – array of QuickBooks object identifiers to delete.

Void method

Voids records in object. The method returns array of IStatus objects for each input object. These are the method parameters:

  • list (string array) – array of QuickBooks object identifiers to void.

Name property (string)

Returns the QuickBooks object name.

IStatus / IQbStatus

This interface is used for reporting back status.

ID property (string)

Returns the QuickBooks object identifier.

EditSequence property (string)

Returns the QuickBooks edit sequence identifier.

Code property (int)

Returns the QuickBooks error code. If zero, there is no error.

Message property (string)

Returns the QuickBooks status message.

IService / IQbService

This interface is used for low-level processing with the QuickBooks service.

Execute method

Executes QBXML message. The method returns QBXMLMsgsRs object. These are the method parameters:

  • qbxml (QBXML)QBXML object.

ApplicationType property (QbApplicationTypes)

Returns the QuickBooks application type. It can be one of the options listed in the following table.

Value Description
Online QuickBooks Online Edition.
US QuickBooks US Edition.
CA QuickBooks Canada Edition.
UK QuickBooks UK Edition.
AU QuickBooks Australia Edition.

ApplicationVersion property (string)

Returns the QuickBooks application version.