quickbooks

package module
v0.1.18 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 21, 2025 License: BSD-2-Clause Imports: 19 Imported by: 0

README

quickbooks-go

Build GoDoc Go Report Card

quickbooks-go is a Go library that provides access to Intuit's QuickBooks Online API.

NOTE: This library is incomplete. I implemented the minimum for my use case. Pull requests welcome :)

Example

Authorization flow

Before you can initialize the client, you'll need to obtain an authorization code. You can see an example of this from QuickBooks' OAuth Playground.

See auth_flow_test.go

clientId     := "<your-client-id>"
clientSecret := "<your-client-secret>"
realmId      := "<realm-id>"

qbClient, err := quickbooks.NewClient(clientId, clientSecret, realmId, false, "", nil)
if err != nil {
	log.Fatalln(err)
}

// To do first when you receive the authorization code from quickbooks callback
authorizationCode := "<received-from-callback>"
redirectURI := "https://developer.intuit.com/v2/OAuth2Playground/RedirectUrl"

bearerToken, err := qbClient.RetrieveBearerToken(authorizationCode, redirectURI)
if err != nil {
	log.Fatalln(err)
}
// Save the bearer token inside a db

// When the token expire, you can use the following function
bearerToken, err = qbClient.RefreshToken(bearerToken.RefreshToken)
if err != nil {
	log.Fatalln(err)
}

// Make a request!
info, err := qbClient.FindCompanyInfo()
if err != nil {
	log.Fatalln(err)
}

fmt.Println(info)

// Revoke the token, this should be done only if a user unsubscribe from your app
qbClient.RevokeToken(bearerToken.RefreshToken)

Re-using tokens

See reuse_token_test.go

clientId     := "<your-client-id>"
clientSecret := "<your-client-secret>"
realmId      := "<realm-id>"

token := quickbooks.BearerToken{
	RefreshToken:           "<saved-refresh-token>",
	AccessToken:            "<saved-access-token>",
}

qbClient, err := quickbooks.NewClient(clientId, clientSecret, realmId, false, "", &token)
if err != nil {
	log.Fatalln(err)
}

// Make a request!
info, err := qbClient.FindCompanyInfo()
if err != nil {
	log.Fatalln(err)
}

fmt.Println(info)

License

BSD-2-Clause

Documentation

Overview

Copyright (c) 2018, Randy Westlund. All rights reserved. This code is under the BSD-2-Clause license.

Index

Constants

View Source
const (
	QueryPageSize = 1000
)

Variables

This section is empty.

Functions

func BatchEntityExtractor added in v0.1.1

func BatchEntityExtractor[T any](
	resp *BatchItemResponse,
	getEntity func(BatchItemResponse) T,
) (T, bool)

func BatchQueryExtractor added in v0.1.1

func BatchQueryExtractor[T any](
	resp *BatchItemResponse,
	getSlice func(BatchQueryResponse) []T,
) []T

func CDCQueryExtractor added in v0.1.1

func CDCQueryExtractor[T any](
	res *ChangeDataCapture,
	getSlice func(q CDCQueryResponse) []T,
) []T

Types

type Account

type Account struct {
	CurrencyRef                   *ReferenceType       `json:",omitempty"`
	ParentRef                     *ReferenceType       `json:",omitempty"`
	TaxCodeRef                    *ReferenceType       `json:",omitempty"`
	MetaData                      ModificationMetaData `json:",omitempty"`
	CurrentBalanceWithSubAccounts json.Number          `json:",omitempty"`
	CurrentBalance                json.Number          `json:",omitempty"`
	AccountType                   AccountTypeEnum      `json:",omitempty"`
	Id                            string               `json:",omitempty"`
	Name                          string
	SyncToken                     string `json:",omitempty"`
	AcctNum                       string `json:",omitempty"`
	Description                   string `json:",omitempty"`
	Classification                string `json:",omitempty"`
	FullyQualifiedName            string `json:",omitempty"`
	TxnLocationType               string `json:",omitempty"`
	AccountSubType                string `json:",omitempty"`
	Active                        bool   `json:",omitempty"`
	SubAccount                    bool   `json:",omitempty"`
	Domain                        string `json:"domain,omitempty"`
	Status                        string `json:"status,omitempty"`
}

type AccountBasedExpenseLineDetail

type AccountBasedExpenseLineDetail struct {
	AccountRef ReferenceType
	TaxAmount  json.Number `json:",omitempty"`
	// TaxInclusiveAmt json.Number              `json:",omitempty"`
	ClassRef       ReferenceType      `json:",omitempty"`
	TaxCodeRef     ReferenceType      `json:",omitempty"`
	MarkupInfo     MarkupInfo         `json:",omitempty"`
	BillableStatus BillableStatusEnum `json:",omitempty"`
	CustomerRef    ReferenceType      `json:",omitempty"`
}

AccountBasedExpenseLineDetail ...

type AccountTypeEnum

type AccountTypeEnum string
const (
	BankAccountType                  AccountTypeEnum = "Bank"
	OtherCurrentAssetAccountType     AccountTypeEnum = "Other Current Asset"
	FixedAssetAccountType            AccountTypeEnum = "Fixed Asset"
	OtherAssetAccountType            AccountTypeEnum = "Other Asset"
	AccountsReceivableAccountType    AccountTypeEnum = "Accounts Receivable"
	EquityAccountType                AccountTypeEnum = "Equity"
	ExpenseAccountType               AccountTypeEnum = "Expense"
	OtherExpenseAccountType          AccountTypeEnum = "Other Expense"
	CostOfGoodsSoldAccountType       AccountTypeEnum = "Cost of Goods Sold"
	AccountsPayableAccountType       AccountTypeEnum = "Accounts Payable"
	CreditCardAccountType            AccountTypeEnum = "Credit Card"
	LongTermLiabilityAccountType     AccountTypeEnum = "Long Term Liability"
	OtherCurrentLiabilityAccountType AccountTypeEnum = "Other Current Liability"
	IncomeAccountType                AccountTypeEnum = "Income"
	OtherIncomeAccountType           AccountTypeEnum = "Other Income"
)

type Attachable

type Attachable struct {
	Id                       string               `json:"Id,omitempty"`
	SyncToken                string               `json:",omitempty"`
	FileName                 string               `json:",omitempty"`
	Note                     string               `json:",omitempty"`
	Category                 string               `json:",omitempty"`
	ContentType              ContentType          `json:",omitempty"`
	PlaceName                string               `json:",omitempty"`
	AttachableRef            []AttachableRef      `json:",omitempty"`
	Long                     string               `json:",omitempty"`
	Tag                      string               `json:",omitempty"`
	Lat                      string               `json:",omitempty"`
	MetaData                 ModificationMetaData `json:",omitempty"`
	FileAccessUri            string               `json:",omitempty"`
	Size                     json.Number          `json:",omitempty"`
	ThumbnailFileAccessUri   string               `json:",omitempty"`
	TempDownloadUri          string               `json:",omitempty"`
	ThumbnailTempDownloadUri string               `json:",omitempty"`
}

type AttachableRef

type AttachableRef struct {
	IncludeOnSend bool   `json:",omitempty"`
	LineInfo      string `json:",omitempty"`
	NoRefOnly     bool   `json:",omitempty"`
	// CustomField[0..n]
	Inactive  bool          `json:",omitempty"`
	EntityRef ReferenceType `json:",omitempty"`
}

type BatchError added in v0.1.15

type BatchError struct {
	Faults []BatchFault
}

func (BatchError) Error added in v0.1.15

func (e BatchError) Error() string

type BatchFault

type BatchFault struct {
	Message string
	Code    string `json:"code"`
	Detail  string
	Element string `json:"element"`
}

type BatchFaultResponse

type BatchFaultResponse struct {
	FaultType string       `json:"type"`
	Faults    []BatchFault `json:"Error"`
}

type BatchItemRequest

type BatchItemRequest struct {
	BID         string          `json:"bId"`
	OptionsData BatchOptions    `json:"optionsData,omitempty"`
	Operation   BatchOperations `json:"operation,omitempty"`
	Query       string          `json:",omitempty"`
}

type BatchItemResponse

type BatchItemResponse struct {
	BID             string             `json:"bId"`
	Account         Account            `json:",omitempty"`
	Attachable      Attachable         `json:",omitempty"`
	Bill            Bill               `json:",omitempty"`
	BillPayment     BillPayment        `json:",omitempty"`
	Class           Class              `json:",omitempty"`
	CreditMemo      CreditMemo         `json:",omitempty"`
	Customer        Customer           `json:",omitempty"`
	CustomerType    CustomerType       `json:",omitempty"`
	Deposit         Deposit            `json:",omitempty"`
	Employee        Employee           `json:",omitempty"`
	Estimate        Estimate           `json:",omitempty"`
	Invoice         Invoice            `json:",omitempty"`
	Item            Item               `json:",omitempty"`
	Payment         Payment            `json:",omitempty"`
	PaymentMethod   PaymentMethod      `json:",omitempty"`
	Purchase        Purchase           `json:",omitempty"`
	ReimburseCharge ReimburseCharge    `json:",omitempty"`
	TaxCode         TaxCode            `json:",omitempty"`
	TaxRate         TaxRate            `json:",omitempty"`
	Term            Term               `json:",omitempty"`
	TimeActivity    TimeActivity       `json:",omitempty"`
	Vendor          Vendor             `json:",omitempty"`
	VendorCredit    VendorCredit       `json:",omitempty"`
	Fault           BatchFaultResponse `json:",omitempty"`
	QueryResponse   BatchQueryResponse `json:"QueryResponse,omitempty"`
}

type BatchOperations

type BatchOperations string
const (
	Create BatchOperations = "create"
	Update BatchOperations = "update"
	Delete BatchOperations = "delete"
)

type BatchOptions

type BatchOptions string
const Void BatchOptions = "void"

type BatchQueryResponse added in v0.1.14

type BatchQueryResponse struct {
	Account         []Account         `json:",omitempty"`
	Attachable      []Attachable      `json:",omitempty"`
	Bill            []Bill            `json:",omitempty"`
	BillPayment     []BillPayment     `json:",omitempty"`
	Class           []Class           `json:",omitempty"`
	CreditMemo      []CreditMemo      `json:",omitempty"`
	Customer        []Customer        `json:",omitempty"`
	CustomerType    []CustomerType    `json:",omitempty"`
	Deposit         []Deposit         `json:",omitempty"`
	Employee        []Employee        `json:",omitempty"`
	Estimate        []Estimate        `json:",omitempty"`
	Invoice         []Invoice         `json:",omitempty"`
	Item            []Item            `json:",omitempty"`
	Payment         []Payment         `json:",omitempty"`
	PaymentMethod   []PaymentMethod   `json:",omitempty"`
	Purchase        []Purchase        `json:",omitempty"`
	ReimburseCharge []ReimburseCharge `json:",omitempty"`
	TaxCode         []TaxCode         `json:",omitempty"`
	TaxRate         []TaxRate         `json:",omitempty"`
	Term            []Term            `json:",omitempty"`
	TimeActivity    []TimeActivity    `json:",omitempty"`
	Vendor          []Vendor          `json:",omitempty"`
	VendorCredit    []VendorCredit    `json:",omitempty"`
	StartPosition   int               `json:"startPosition"`
	MaxResults      int               `json:"maxResults"`
	TotalCount      int               `json:"totalCount,omitempty"`
}

type BearerToken

type BearerToken struct {
	RefreshToken           string      `json:"refresh_token"`
	AccessToken            string      `json:"access_token"`
	TokenType              string      `json:"token_type"`
	IdToken                string      `json:"id_token"`
	ExpiresIn              json.Number `json:"expires_in"`
	XRefreshTokenExpiresIn json.Number `json:"x_refresh_token_expires_in"`
}

type Bill

type Bill struct {
	Line                    []Line
	LinkedTxn               []LinkedTxn `json:",omitempty"`
	VendorRef               ReferenceType
	CurrencyRef             ReferenceType        `json:",omitempty"`
	APAccountRef            *ReferenceType       `json:",omitempty"`
	SalesTermRef            *ReferenceType       `json:",omitempty"`
	DepartmentRef           *ReferenceType       `json:",omitempty"`
	RecurDataRef            *ReferenceType       `json:",omitempty"`
	TxnTaxDetail            *TxnTaxDetail        `json:",omitempty"`
	MetaData                ModificationMetaData `json:",omitempty"`
	TxnDate                 Date                 `json:",omitempty"`
	DueDate                 Date                 `json:",omitempty"`
	TotalAmt                json.Number          `json:",omitempty"`
	ExchangeRate            json.Number          `json:",omitempty"`
	HomeBalance             json.Number          `json:",omitempty"`
	Balance                 json.Number          `json:",omitempty"`
	Id                      string               `json:",omitempty"`
	SyncToken               string               `json:",omitempty"`
	TransactionLocationType string               `json:",omitempty"`
	DocNumber               string               `json:",omitempty"`
	PrivateNote             string               `json:",omitempty"`
	Domain                  string               `json:"domain,omitempty"`
	Status                  string               `json:"status,omitempty"`
}

type BillPayment

type BillPayment struct {
	Line               []Line
	LinkedTxn          []LinkedTxn `json:",omitempty"`
	VendorRef          ReferenceType
	CurrencyRef        ReferenceType         `json:",omitempty"`
	APAccountRef       *ReferenceType        `json:",omitempty"`
	DepartmentRef      *ReferenceType        `json:",omitempty"`
	CheckPayment       BillPaymentCheck      `json:",omitempty"`
	CreditCardPayment  BillPaymentCreditCard `json:",omitempty"`
	TxnDate            Date                  `json:",omitempty"`
	MetaData           ModificationMetaData  `json:",omitempty"`
	TotalAmt           json.Number
	ExchangeRate       json.Number `json:",omitempty"`
	PayType            BillPaymentTypeEnum
	Id                 string `json:",omitempty"`
	SyncToken          string `json:",omitempty"`
	DocNumber          string `json:",omitempty"`
	PrivateNote        string `json:",omitempty"`
	ProcessBillPayment bool   `json:",omitempty"`
	Domain             string `json:"domain,omitempty"`
	Status             string `json:"status,omitempty"`
}

type BillPaymentCheck

type BillPaymentCheck struct {
	BankAccountRef ReferenceType   `json:",omitempty"`
	PrintStatus    PrintStatusEnum `json:",omitempty"`
}

type BillPaymentCreditCard

type BillPaymentCreditCard struct {
	CCAccountRef ReferenceType `json:",omitempty"`
}

type BillPaymentTypeEnum

type BillPaymentTypeEnum string
const (
	CheckPaymentType      BillPaymentTypeEnum = "Check"
	CreditCardPaymentType BillPaymentTypeEnum = "CreditCard"
)

type BillableStatusEnum

type BillableStatusEnum string
const (
	BillableStatusType      BillableStatusEnum = "Billable"
	NotBillableStatusType   BillableStatusEnum = "NotBillable"
	HasBeenBilledStatusType BillableStatusEnum = "HasBeenBilled"
)

type CDCQueryResponse added in v0.1.14

type CDCQueryResponse struct {
	Account         []Account         `json:",omitempty"`
	Attachable      []Attachable      `json:",omitempty"`
	Bill            []Bill            `json:",omitempty"`
	BillPayment     []BillPayment     `json:",omitempty"`
	Class           []Class           `json:",omitempty"`
	Customer        []Customer        `json:",omitempty"`
	CustomerType    []CustomerType    `json:",omitempty"`
	Deposit         []Deposit         `json:",omitempty"`
	Employee        []Employee        `json:",omitempty"`
	Estimate        []Estimate        `json:",omitempty"`
	Invoice         []Invoice         `json:",omitempty"`
	Item            []Item            `json:",omitempty"`
	Payment         []Payment         `json:",omitempty"`
	PaymentMethod   []PaymentMethod   `json:",omitempty"`
	Purchase        []Purchase        `json:",omitempty"`
	ReimburseCharge []ReimburseCharge `json:",omitempty"`
	Term            []Term            `json:",omitempty"`
	Vendor          []Vendor          `json:",omitempty"`
	VendorCredit    []VendorCredit    `json:",omitempty"`
	StartPosition   int               `json:"startPosition"`
	MaxResults      int               `json:"maxResults"`
	TotalCount      int               `json:"totalCount,omitempty"`
}

type ChangeDataCapture

type ChangeDataCapture struct {
	CDCResponse []struct {
		QueryResponse []CDCQueryResponse `json:"QueryResponse"`
	} `json:"CDCResponse"`
	Time string `json:"time"`
}

type Class

type Class struct {
	ParentRef          ReferenceType        `json:",omitempty"`
	MetaDate           ModificationMetaData `json:",omitempty"`
	Id                 string               `json:",omitempty"`
	Name               string               `json:",omitempty"`
	FullyQualifiedName string               `json:",omitempty"`
	SyncToken          string               `json:",omitempty"`
	SubClass           bool                 `json:",omitempty"`
	Active             bool                 `json:",omitempty"`
	Domain             string               `json:"domain,omitempty"`
	Status             string               `json:"status,omitempty"`
}

type Client

type Client struct {
	Client *http.Client
	// contains filtered or unexported fields
}

Client is your handle to the QuickBooks API.

func NewClient

func NewClient(req ClientRequest) (c *Client, err error)

NewClient initializes a new QuickBooks client for interacting with their Online API

func (*Client) BatchRequest

func (c *Client) BatchRequest(ctx context.Context, params RequestParameters, batchRequests []BatchItemRequest) (*[]BatchItemResponse, error)

func (*Client) ChangeDataCapture

func (c *Client) ChangeDataCapture(ctx context.Context, params RequestParameters, entities []string, changedSince time.Time) (ChangeDataCapture, error)

func (*Client) CreateAccount

func (c *Client) CreateAccount(ctx context.Context, params RequestParameters, account *Account) (*Account, error)

CreateAccount creates the given account within QuickBooks

func (*Client) CreateAttachable

func (c *Client) CreateAttachable(ctx context.Context, params RequestParameters, attachable *Attachable) (*Attachable, error)

CreateAttachable creates the given Attachable on the QuickBooks server, returning the resulting Attachable object.

func (*Client) CreateBill

func (c *Client) CreateBill(ctx context.Context, params RequestParameters, bill *Bill) (*Bill, error)

CreateBill creates the given Bill on the QuickBooks server, returning the resulting Bill object.

func (*Client) CreateBillPayment

func (c *Client) CreateBillPayment(ctx context.Context, params RequestParameters, billPayment *BillPayment) (*BillPayment, error)

CreateBillPayment creates the given Bill on the QuickBooks server, returning the resulting Bill object.

func (*Client) CreateClass

func (c *Client) CreateClass(ctx context.Context, params RequestParameters, class *Class) (*Class, error)

CreateClass creates the given Class on the QuickBooks server, returning the resulting Class object.

func (*Client) CreateCreditMemo

func (c *Client) CreateCreditMemo(ctx context.Context, params RequestParameters, creditMemo *CreditMemo) (*CreditMemo, error)

CreateCreditMemo creates the given CreditMemo witin QuickBooks.

func (*Client) CreateCustomer

func (c *Client) CreateCustomer(ctx context.Context, params RequestParameters, customer *Customer) (*Customer, error)

CreateCustomer creates the given Customer on the QuickBooks server, returning the resulting Customer object.

func (*Client) CreateDeposit

func (c *Client) CreateDeposit(ctx context.Context, params RequestParameters, deposit *Deposit) (*Deposit, error)

CreateDeposit creates the given deposit within QuickBooks

func (*Client) CreateEmployee

func (c *Client) CreateEmployee(ctx context.Context, params RequestParameters, employee *Employee) (*Employee, error)

CreateEmployee creates the given employee within QuickBooks

func (*Client) CreateEstimate

func (c *Client) CreateEstimate(ctx context.Context, params RequestParameters, estimate *Estimate) (*Estimate, error)

CreateEstimate creates the given Estimate on the QuickBooks server, returning the resulting Estimate object.

func (*Client) CreateInvoice

func (c *Client) CreateInvoice(ctx context.Context, params RequestParameters, invoice *Invoice) (*Invoice, error)

CreateInvoice creates the given Invoice on the QuickBooks server, returning the resulting Invoice object.

func (*Client) CreateItem

func (c *Client) CreateItem(ctx context.Context, params RequestParameters, item *Item) (*Item, error)

func (*Client) CreatePayment

func (c *Client) CreatePayment(ctx context.Context, params RequestParameters, payment *Payment) (*Payment, error)

CreatePayment creates the given payment within QuickBooks.

func (*Client) CreatePaymentMethod

func (c *Client) CreatePaymentMethod(ctx context.Context, params RequestParameters, paymentMethod *PaymentMethod) (*PaymentMethod, error)

CreatePaymentMethod creates the given PaymentMethod on the QuickBooks server, returning the resulting PaymentMethod object.

func (*Client) CreatePurchase

func (c *Client) CreatePurchase(ctx context.Context, params RequestParameters, purchase *Purchase) (*Purchase, error)

CreatePurchase creates the given Purchase on the QuickBooks server, returning the resulting Purchase object.

func (*Client) CreateTerm

func (c *Client) CreateTerm(ctx context.Context, params RequestParameters, term *Term) (*Term, error)

CreateTerm creates the given Term on the QuickBooks server, returning the resulting Term object.

func (*Client) CreateTimeActivity

func (c *Client) CreateTimeActivity(ctx context.Context, params RequestParameters, timeActivity *TimeActivity) (*TimeActivity, error)

CreateTimeActivity creates the given TimeActivity on the QuickBooks server, returning the resulting TimeActivity object.

func (*Client) CreateVendor

func (c *Client) CreateVendor(ctx context.Context, params RequestParameters, vendor *Vendor) (*Vendor, error)

CreateVendor creates the given Vendor on the QuickBooks server, returning the resulting Vendor object.

func (*Client) CreateVendorCredit

func (c *Client) CreateVendorCredit(ctx context.Context, params RequestParameters, vendorCredit *VendorCredit) (*VendorCredit, error)

CreateVendorCredit creates the given VendorCredit on the QuickBooks server, returning the resulting VendorCredit object.

func (*Client) DeleteAttachable

func (c *Client) DeleteAttachable(ctx context.Context, params RequestParameters, attachable *Attachable) error

DeleteAttachable deletes the attachable

func (*Client) DeleteBill

func (c *Client) DeleteBill(ctx context.Context, params RequestParameters, bill *Bill) error

DeleteBill deletes the bill

func (*Client) DeleteBillPayment

func (c *Client) DeleteBillPayment(ctx context.Context, params RequestParameters, billPayment *BillPayment) error

DeleteBill deletes the bill

func (*Client) DeleteCreditMemo

func (c *Client) DeleteCreditMemo(ctx context.Context, params RequestParameters, creditMemo *CreditMemo) error

DeleteCreditMemo deletes the given credit memo.

func (*Client) DeleteDeposit

func (c *Client) DeleteDeposit(ctx context.Context, params RequestParameters, deposit *Deposit) error

func (*Client) DeleteEstimate

func (c *Client) DeleteEstimate(ctx context.Context, params RequestParameters, estimate *Estimate) error

DeleteEstimate deletes the estimate

func (*Client) DeleteInvoice

func (c *Client) DeleteInvoice(ctx context.Context, params RequestParameters, invoice *Invoice) error

DeleteInvoice deletes the invoice

If the invoice was already deleted, QuickBooks returns 400 :( The response looks like this: {"Fault":{"Error":[{"Message":"Object Not Found","Detail":"Object Not Found : Something you're trying to use has been made inactive. Check the fields with accounts, invoices, items, vendors or employees.","code":"610","element":""}],"type":"ValidationFault"},"time":"2018-03-20T20:15:59.571-07:00"}

This is slightly horrifying and not documented in their API. When this happens we just return success; the goal of deleting it has been accomplished, just not by us.

func (*Client) DeletePayment

func (c *Client) DeletePayment(ctx context.Context, params RequestParameters, payment *Payment) error

DeletePayment deletes the given payment from QuickBooks.

func (*Client) DeletePurchase

func (c *Client) DeletePurchase(ctx context.Context, params RequestParameters, purchase *Purchase) error

DeletePurchase deletes the purchase

func (*Client) DeleteTimeActivity

func (c *Client) DeleteTimeActivity(ctx context.Context, params RequestParameters, timeActivity *TimeActivity) error

DeleteTimeActivity deletes the timeActivity

func (*Client) DeleteVendorCredit

func (c *Client) DeleteVendorCredit(ctx context.Context, params RequestParameters, vendorCredit *VendorCredit) error

DeleteVendorCredit deletes the vendorCredit

func (*Client) FindAccountById

func (c *Client) FindAccountById(ctx context.Context, params RequestParameters, id string) (*Account, error)

FindAccountById returns an account with a given Id.

func (*Client) FindAccounts

func (c *Client) FindAccounts(ctx context.Context, params RequestParameters) ([]Account, error)

FindAccounts gets the full list of Accounts in the QuickBooks account.

func (*Client) FindAccountsByPage

func (c *Client) FindAccountsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Account, error)

func (*Client) FindAttachableById

func (c *Client) FindAttachableById(ctx context.Context, params RequestParameters, id string) (*Attachable, error)

FindAttachableById finds the attachable by the given id

func (*Client) FindAttachables

func (c *Client) FindAttachables(ctx context.Context, params RequestParameters) ([]Attachable, error)

FindAttachables gets the full list of Attachables in the QuickBooks attachable.

func (*Client) FindAuthorizationUrl

func (c *Client) FindAuthorizationUrl(scope string, state string, redirectUri string) (string, error)

FindAuthorizationUrl compiles the authorization url from the discovery api's auth endpoint.

Example: qbClient.FindAuthorizationUrl("com.intuit.quickbooks.accounting", "security_token", "https://developer.intuit.com/v2/OAuth2Playground/RedirectUrl")

You can find live examples from https://developer.intuit.com/app/developer/playground

func (*Client) FindBillById

func (c *Client) FindBillById(ctx context.Context, params RequestParameters, id string) (*Bill, error)

FindBillById finds the bill by the given id

func (*Client) FindBillPaymentById

func (c *Client) FindBillPaymentById(ctx context.Context, params RequestParameters, id string) (*BillPayment, error)

FindBillById finds the bill by the given id

func (*Client) FindBillPayments

func (c *Client) FindBillPayments(ctx context.Context, params RequestParameters) ([]BillPayment, error)

FindBills gets the full list of Bills in the QuickBooks account.

func (*Client) FindBillPaymentsByPage

func (c *Client) FindBillPaymentsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]BillPayment, error)

func (*Client) FindBills

func (c *Client) FindBills(ctx context.Context, params RequestParameters) ([]Bill, error)

FindBills gets the full list of Bills in the QuickBooks account.

func (*Client) FindBillsByPage

func (c *Client) FindBillsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Bill, error)

func (*Client) FindClassById

func (c *Client) FindClassById(ctx context.Context, params RequestParameters, id string) (*Class, error)

FindClassById finds the class by the given id

func (*Client) FindClasses

func (c *Client) FindClasses(ctx context.Context, params RequestParameters) ([]Class, error)

FindClasss gets the full list of Classs in the QuickBooks account.

func (*Client) FindClassesByPage

func (c *Client) FindClassesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Class, error)

func (*Client) FindCompanyInfo

func (c *Client) FindCompanyInfo(ctx context.Context, params RequestParameters) (*CompanyInfo, error)

FindCompanyInfo returns the QuickBooks CompanyInfo object. This is a good test to check whether you're connected.

func (*Client) FindCreditMemoById

func (c *Client) FindCreditMemoById(ctx context.Context, params RequestParameters, id string) (*CreditMemo, error)

FindCreditMemoById retrieves the given credit memo from QuickBooks.

func (*Client) FindCreditMemos

func (c *Client) FindCreditMemos(ctx context.Context, params RequestParameters) ([]CreditMemo, error)

FindCreditMemos retrieves the full list of credit memos from QuickBooks.

func (*Client) FindCustomerById

func (c *Client) FindCustomerById(ctx context.Context, params RequestParameters, id string) (*Customer, error)

FindCustomerById returns a customer with a given Id.

func (*Client) FindCustomerByName

func (c *Client) FindCustomerByName(ctx context.Context, params RequestParameters, name string) (*Customer, error)

FindCustomerByName gets a customer with a given name.

func (*Client) FindCustomerTypeById

func (c *Client) FindCustomerTypeById(ctx context.Context, params RequestParameters, id string) (*CustomerType, error)

FindCustomerTypeById returns a customerType with a given Id.

func (*Client) FindCustomerTypesByPage

func (c *Client) FindCustomerTypesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]CustomerType, error)

func (*Client) FindCustomers

func (c *Client) FindCustomers(ctx context.Context, params RequestParameters) ([]Customer, error)

FindCustomers gets the full list of Customers in the QuickBooks account.

func (*Client) FindCustomersByPage

func (c *Client) FindCustomersByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Customer, error)

func (*Client) FindDepositById

func (c *Client) FindDepositById(ctx context.Context, params RequestParameters, id string) (*Deposit, error)

FindDepositById returns an deposit with a given Id.

func (*Client) FindDeposits

func (c *Client) FindDeposits(ctx context.Context, params RequestParameters) ([]Deposit, error)

FindDeposits gets the full list of Deposits in the QuickBooks account.

func (*Client) FindDepositsByPage added in v0.1.5

func (c *Client) FindDepositsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Deposit, error)

func (*Client) FindEmployeeById

func (c *Client) FindEmployeeById(ctx context.Context, params RequestParameters, id string) (*Employee, error)

FindEmployeeById returns an employee with a given Id.

func (*Client) FindEmployees

func (c *Client) FindEmployees(ctx context.Context, params RequestParameters) ([]Employee, error)

FindEmployees gets the full list of Employees in the QuickBooks account.

func (*Client) FindEmployeesByPage

func (c *Client) FindEmployeesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Employee, error)

func (*Client) FindEstimateById

func (c *Client) FindEstimateById(ctx context.Context, params RequestParameters, id string) (*Estimate, error)

FindEstimateById finds the estimate by the given id

func (*Client) FindEstimates

func (c *Client) FindEstimates(ctx context.Context, params RequestParameters) ([]Estimate, error)

FindEstimates gets the full list of Estimates in the QuickBooks account.

func (*Client) FindEstimatesByPage

func (c *Client) FindEstimatesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Estimate, error)

func (*Client) FindInvoiceById

func (c *Client) FindInvoiceById(ctx context.Context, params RequestParameters, id string) (*Invoice, error)

FindInvoiceById finds the invoice by the given id

func (*Client) FindInvoices

func (c *Client) FindInvoices(ctx context.Context, params RequestParameters) ([]Invoice, error)

FindInvoices gets the full list of Invoices in the QuickBooks account.

func (*Client) FindInvoicesByPage

func (c *Client) FindInvoicesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Invoice, error)

func (*Client) FindItemById

func (c *Client) FindItemById(ctx context.Context, params RequestParameters, id string) (*Item, error)

FindItemById returns an item with a given Id.

func (*Client) FindItems

func (c *Client) FindItems(ctx context.Context, params RequestParameters) ([]Item, error)

FindItems gets the full list of Items in the QuickBooks account.

func (*Client) FindItemsByPage

func (c *Client) FindItemsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Item, error)

func (*Client) FindPaymentById

func (c *Client) FindPaymentById(ctx context.Context, params RequestParameters, id string) (*Payment, error)

FindPaymentById returns an payment with a given Id.

func (*Client) FindPaymentMethodById

func (c *Client) FindPaymentMethodById(ctx context.Context, params RequestParameters, id string) (*PaymentMethod, error)

FindPaymentMethodById finds the estimate by the given id

func (*Client) FindPaymentMethods

func (c *Client) FindPaymentMethods(ctx context.Context, params RequestParameters) ([]PaymentMethod, error)

FindPaymentMethods gets the full list of PaymentMethods in the QuickBooks account.

func (*Client) FindPaymentMethodsByPage

func (c *Client) FindPaymentMethodsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]PaymentMethod, error)

func (*Client) FindPayments

func (c *Client) FindPayments(ctx context.Context, params RequestParameters) ([]Payment, error)

FindPayments gets the full list of Payments in the QuickBooks account.

func (*Client) FindPaymentsByPage

func (c *Client) FindPaymentsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Payment, error)

func (*Client) FindPurchaseById

func (c *Client) FindPurchaseById(ctx context.Context, params RequestParameters, id string) (*Purchase, error)

FindPurchaseById finds the purchase by the given id

func (*Client) FindPurchases

func (c *Client) FindPurchases(ctx context.Context, params RequestParameters) ([]Purchase, error)

FindPurchases gets the full list of Purchases in the QuickBooks account.

func (*Client) FindPurchasesByPage

func (c *Client) FindPurchasesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Purchase, error)

func (*Client) FindReimburseChargeById

func (c *Client) FindReimburseChargeById(ctx context.Context, params RequestParameters, id string) (*ReimburseCharge, error)

FindReimburseChargeById finds the reimburseCharge by the given id

func (*Client) FindReimburseCharges

func (c *Client) FindReimburseCharges(ctx context.Context, params RequestParameters) ([]ReimburseCharge, error)

FindReimburseCharges gets the full list of ReimburseCharges in the QuickBooks account.

func (*Client) FindReimburseChargesByPage

func (c *Client) FindReimburseChargesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]ReimburseCharge, error)

func (*Client) FindTaxCodeById

func (c *Client) FindTaxCodeById(ctx context.Context, params RequestParameters, id string) (*TaxCode, error)

FindTaxCodeById finds the taxCode by the given id

func (*Client) FindTaxCodes

func (c *Client) FindTaxCodes(ctx context.Context, params RequestParameters) ([]TaxCode, error)

FindTaxCodes gets the full list of TaxCodes in the QuickBooks account.

func (*Client) FindTaxCodesByPage

func (c *Client) FindTaxCodesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]TaxCode, error)

func (*Client) FindTaxRateById

func (c *Client) FindTaxRateById(ctx context.Context, params RequestParameters, id string) (*TaxRate, error)

FindTaxRateById finds the taxRate by the given id

func (*Client) FindTaxRates

func (c *Client) FindTaxRates(ctx context.Context, params RequestParameters) ([]TaxRate, error)

FindTaxRates gets the full list of TaxRates in the QuickBooks account.

func (*Client) FindTaxRatesByPage

func (c *Client) FindTaxRatesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]TaxRate, error)

func (*Client) FindTermById

func (c *Client) FindTermById(ctx context.Context, params RequestParameters, id string) (*Term, error)

FindTermById finds the term by the given id

func (*Client) FindTerms

func (c *Client) FindTerms(ctx context.Context, params RequestParameters) ([]Term, error)

FindTerms gets the full list of Terms in the QuickBooks account.

func (*Client) FindTermsByPage

func (c *Client) FindTermsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Term, error)

func (*Client) FindTimeActivities

func (c *Client) FindTimeActivities(ctx context.Context, params RequestParameters) ([]TimeActivity, error)

FindTimeActivitys gets the full list of TimeActivitys in the QuickBooks account.

func (*Client) FindTimeActivitiesByPage

func (c *Client) FindTimeActivitiesByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]TimeActivity, error)

func (*Client) FindTimeActivityById

func (c *Client) FindTimeActivityById(ctx context.Context, params RequestParameters, id string) (*TimeActivity, error)

FindTimeActivityById finds the timeActivity by the given id

func (*Client) FindVendorById

func (c *Client) FindVendorById(ctx context.Context, params RequestParameters, id string) (*Vendor, error)

FindVendorById finds the vendor by the given id

func (*Client) FindVendorCreditById

func (c *Client) FindVendorCreditById(ctx context.Context, params RequestParameters, id string) (*VendorCredit, error)

FindVendorCreditById finds the vendorCredit by the given id

func (*Client) FindVendorCredits

func (c *Client) FindVendorCredits(ctx context.Context, params RequestParameters) ([]VendorCredit, error)

FindVendorCredits gets the full list of VendorCredits in the QuickBooks account.

func (*Client) FindVendorCreditsByPage

func (c *Client) FindVendorCreditsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]VendorCredit, error)

func (*Client) FindVendors

func (c *Client) FindVendors(ctx context.Context, params RequestParameters) ([]Vendor, error)

FindVendors gets the full list of Vendors in the QuickBooks account.

func (*Client) FindVendorsByPage

func (c *Client) FindVendorsByPage(ctx context.Context, params RequestParameters, startPosition, pageSize int) ([]Vendor, error)

func (*Client) GetAttachableDownloadURL added in v0.1.13

func (c *Client) GetAttachableDownloadURL(ctx context.Context, params RequestParameters, id string) (*url.URL, error)

DownloadAttachable downloads the attachable

func (*Client) QueryAccounts

func (c *Client) QueryAccounts(ctx context.Context, params RequestParameters, query string) ([]Account, error)

QueryAccounts accepts an SQL query and returns all accounts found using it

func (*Client) QueryAttachables

func (c *Client) QueryAttachables(ctx context.Context, params RequestParameters, query string) ([]Attachable, error)

QueryAttachables accepts an SQL query and returns all attachables found using it

func (*Client) QueryBillPayments

func (c *Client) QueryBillPayments(ctx context.Context, params RequestParameters, query string) ([]BillPayment, error)

QueryBills accepts an SQL query and returns all bills found using it

func (*Client) QueryBills

func (c *Client) QueryBills(ctx context.Context, params RequestParameters, query string) ([]Bill, error)

QueryBills accepts an SQL query and returns all bills found using it

func (*Client) QueryClasses

func (c *Client) QueryClasses(ctx context.Context, params RequestParameters, query string) ([]Class, error)

QueryClasss accepts an SQL query and returns all classs found using it

func (*Client) QueryCreditMemos

func (c *Client) QueryCreditMemos(ctx context.Context, params RequestParameters, query string) ([]CreditMemo, error)

QueryCreditMemos accepts n SQL query and returns all credit memos found using it.

func (*Client) QueryCustomerTypes

func (c *Client) QueryCustomerTypes(ctx context.Context, params RequestParameters, query string) ([]CustomerType, error)

QueryCustomerTypes accepts an SQL query and returns all customerTypes found using it

func (*Client) QueryCustomers

func (c *Client) QueryCustomers(ctx context.Context, params RequestParameters, query string) ([]Customer, error)

QueryCustomers accepts an SQL query and returns all customers found using it

func (*Client) QueryDeposits

func (c *Client) QueryDeposits(ctx context.Context, params RequestParameters, query string) ([]Deposit, error)

QueryDeposits accepts an SQL query and returns all deposits found using it

func (*Client) QueryEmployees

func (c *Client) QueryEmployees(ctx context.Context, params RequestParameters, query string) ([]Employee, error)

QueryEmployees accepts an SQL query and returns all employees found using it

func (*Client) QueryEstimates

func (c *Client) QueryEstimates(ctx context.Context, params RequestParameters, query string) ([]Estimate, error)

QueryEstimates accepts an SQL query and returns all estimates found using it

func (*Client) QueryInvoices

func (c *Client) QueryInvoices(ctx context.Context, params RequestParameters, query string) ([]Invoice, error)

QueryInvoices accepts an SQL query and returns all invoices found using it

func (*Client) QueryItems

func (c *Client) QueryItems(ctx context.Context, params RequestParameters, query string) ([]Item, error)

QueryItems accepts an SQL query and returns all items found using it

func (*Client) QueryPaymentMethods

func (c *Client) QueryPaymentMethods(ctx context.Context, params RequestParameters, query string) ([]PaymentMethod, error)

QueryPaymentMethods accepts an SQL query and returns all estimates found using it

func (*Client) QueryPayments

func (c *Client) QueryPayments(ctx context.Context, params RequestParameters, query string) ([]Payment, error)

QueryPayments accepts a SQL query and returns all payments found using it.

func (*Client) QueryPurchases

func (c *Client) QueryPurchases(ctx context.Context, params RequestParameters, query string) ([]Purchase, error)

QueryPurchases accepts an SQL query and returns all purchases found using it

func (*Client) QueryReimburseCharges

func (c *Client) QueryReimburseCharges(ctx context.Context, params RequestParameters, query string) ([]ReimburseCharge, error)

QueryReimburseCharges accepts an SQL query and returns all reimburseCharges found using it

func (*Client) QueryTaxCodes

func (c *Client) QueryTaxCodes(ctx context.Context, params RequestParameters, query string) ([]TaxCode, error)

QueryTaxCodes accepts an SQL query and returns all taxCodes found using it

func (*Client) QueryTaxRates

func (c *Client) QueryTaxRates(ctx context.Context, params RequestParameters, query string) ([]TaxRate, error)

QueryTaxRates accepts an SQL query and returns all taxRates found using it

func (*Client) QueryTerms

func (c *Client) QueryTerms(ctx context.Context, params RequestParameters, query string) ([]Term, error)

QueryTerms accepts an SQL query and returns all terms found using it

func (*Client) QueryTimeActivities

func (c *Client) QueryTimeActivities(ctx context.Context, params RequestParameters, query string) ([]TimeActivity, error)

QueryTimeActivitys accepts an SQL query and returns all timeActivitys found using it

func (*Client) QueryVendorCredits

func (c *Client) QueryVendorCredits(ctx context.Context, params RequestParameters, query string) ([]VendorCredit, error)

QueryVendorCredits accepts an SQL query and returns all vendorCredits found using it

func (*Client) QueryVendors

func (c *Client) QueryVendors(ctx context.Context, params RequestParameters, query string) ([]Vendor, error)

QueryVendors accepts an SQL query and returns all vendors found using it

func (*Client) RefreshToken

func (c *Client) RefreshToken(refreshToken string) (*BearerToken, error)

RefreshToken Call the refresh endpoint to generate new tokens

func (*Client) RetrieveBearerToken

func (c *Client) RetrieveBearerToken(authorizationCode, redirectURI string) (*BearerToken, error)

RetrieveBearerToken Method to retrieve access token (bearer token). This method can only be called once

func (*Client) RevokeToken

func (c *Client) RevokeToken(refreshToken string) error

RevokeToken Call the revoke endpoint to revoke tokens

func (*Client) SendEstimate

func (c *Client) SendEstimate(ctx context.Context, params RequestParameters, estimateId, emailAddress string) error

SendEstimate sends the estimate to the Estimate.BillEmail if emailAddress is left empty

func (*Client) SendInvoice

func (c *Client) SendInvoice(ctx context.Context, params RequestParameters, invoiceId, emailAddress string) error

SendInvoice sends the invoice to the Invoice.BillEmail if emailAddress is left empty

func (*Client) SparseUpdateCustomer

func (c *Client) SparseUpdateCustomer(ctx context.Context, params RequestParameters, customer *Customer) (*Customer, error)

SparseUpdateCustomer updates only fields included in the customer struct, other fields are left unmodified

func (*Client) SparseUpdateDeposit

func (c *Client) SparseUpdateDeposit(ctx context.Context, params RequestParameters, deposit *Deposit) (*Deposit, error)

SparseUpdateDeposit updates only fields included in the deposit struct, other fields are left unmodified

func (*Client) SparseUpdateEstimate

func (c *Client) SparseUpdateEstimate(ctx context.Context, params RequestParameters, estimate *Estimate) (*Estimate, error)

SparseUpdateEstimate updates only fields included in the estimate struct, other fields are left unmodified

func (*Client) SparseUpdateInvoice

func (c *Client) SparseUpdateInvoice(ctx context.Context, params RequestParameters, invoice *Invoice) (*Invoice, error)

SparseUpdateInvoice updates only fields included in the invoice struct, other fields are left unmodified

func (*Client) UpdateAccount

func (c *Client) UpdateAccount(ctx context.Context, params RequestParameters, account *Account) (*Account, error)

UpdateAccount full updates the account, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateAttachable

func (c *Client) UpdateAttachable(ctx context.Context, params RequestParameters, attachable *Attachable) (*Attachable, error)

UpdateAttachable updates the attachable

func (*Client) UpdateBill

func (c *Client) UpdateBill(ctx context.Context, params RequestParameters, bill *Bill) (*Bill, error)

UpdateBill full updates the bill, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateBillPayment

func (c *Client) UpdateBillPayment(ctx context.Context, params RequestParameters, billPayment *BillPayment) (*BillPayment, error)

UpdateBill full updates the bill, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateClass

func (c *Client) UpdateClass(ctx context.Context, params RequestParameters, class *Class) (*Class, error)

UpdateClass full updates the class, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateCompanyInfo

func (c *Client) UpdateCompanyInfo(ctx context.Context, params RequestParameters, companyInfo *CompanyInfo) (*CompanyInfo, error)

UpdateCompanyInfo updates the company info

func (*Client) UpdateCreditMemo

func (c *Client) UpdateCreditMemo(ctx context.Context, params RequestParameters, creditMemo *CreditMemo) (*CreditMemo, error)

UpdateCreditMemo updates the given credit memo.

func (*Client) UpdateCustomer

func (c *Client) UpdateCustomer(ctx context.Context, params RequestParameters, customer *Customer) (*Customer, error)

UpdateCustomer full updates the customer, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateDeposit

func (c *Client) UpdateDeposit(ctx context.Context, params RequestParameters, deposit *Deposit) (*Deposit, error)

UpdateDeposit full updates the deposit, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateEmployee

func (c *Client) UpdateEmployee(ctx context.Context, params RequestParameters, employee *Employee) (*Employee, error)

UpdateEmployee updates the employee

func (*Client) UpdateEstimate

func (c *Client) UpdateEstimate(ctx context.Context, params RequestParameters, estimate *Estimate) (*Estimate, error)

UpdateEstimate full updates the estimate, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateInvoice

func (c *Client) UpdateInvoice(ctx context.Context, params RequestParameters, invoice *Invoice) (*Invoice, error)

UpdateInvoice full updates the invoice, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateItem

func (c *Client) UpdateItem(ctx context.Context, params RequestParameters, item *Item) (*Item, error)

UpdateItem full updates the item, meaning that missing writable fields will be set to nil/null

func (*Client) UpdatePayment

func (c *Client) UpdatePayment(ctx context.Context, params RequestParameters, payment *Payment) (*Payment, error)

UpdatePayment full updates the payment, meaning that missing writable fields will be set to nil/null

func (*Client) UpdatePaymentMethod

func (c *Client) UpdatePaymentMethod(ctx context.Context, params RequestParameters, paymentMethod *PaymentMethod) (*PaymentMethod, error)

UpdatePaymentMethod full updates the payment method, meaning that missing writable fields will be set to nil/null

func (*Client) UpdatePurchase

func (c *Client) UpdatePurchase(ctx context.Context, params RequestParameters, purchase *Purchase) (*Purchase, error)

UpdatePurchase full updates the purchase, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateTerm

func (c *Client) UpdateTerm(ctx context.Context, params RequestParameters, term *Term) (*Term, error)

UpdateTerm full updates the term, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateTimeActivity

func (c *Client) UpdateTimeActivity(ctx context.Context, params RequestParameters, timeActivity *TimeActivity) (*TimeActivity, error)

UpdateTimeActivity full updates the time activity, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateVendor

func (c *Client) UpdateVendor(ctx context.Context, params RequestParameters, vendor *Vendor) (*Vendor, error)

UpdateVendor full updates the vendor, meaning that missing writable fields will be set to nil/null

func (*Client) UpdateVendorCredit

func (c *Client) UpdateVendorCredit(ctx context.Context, params RequestParameters, vendorCredit *VendorCredit) (*VendorCredit, error)

UpdateVendorCredit full updates the vendor credit, meaning that missing writable fields will be set to nil/null

func (*Client) UploadAttachable

func (c *Client) UploadAttachable(ctx context.Context, realmId string, attachable *Attachable, data io.Reader) (*Attachable, error)

UploadAttachable uploads the attachable

func (*Client) VoidBillPayment

func (c *Client) VoidBillPayment(ctx context.Context, params RequestParameters, billPayment BillPayment) error

func (*Client) VoidEstimate

func (c *Client) VoidEstimate(ctx context.Context, params RequestParameters, estimate Estimate) error

func (*Client) VoidInvoice

func (c *Client) VoidInvoice(ctx context.Context, params RequestParameters, invoice Invoice) error

func (*Client) VoidPayment

func (c *Client) VoidPayment(ctx context.Context, params RequestParameters, payment Payment) error

VoidPayment voids the given payment in QuickBooks.

type ClientRequest

type ClientRequest struct {
	Client       *http.Client
	DiscoveryAPI *DiscoveryAPI
	ClientId     string
	ClientSecret string
	Endpoint     string
	MinorVersion string
}

type CompanyInfo

type CompanyInfo struct {
	CompanyName string
	LegalName   string
	// CompanyAddr
	// CustomerCommunicationAddr
	// LegalAddr
	// PrimaryPhone
	// CompanyStartDate     Date
	CompanyStartDate     string
	FiscalYearStartMonth string
	Country              string
	// Email
	// WebAddr
	SupportedLanguages string
	// NameValue
	Domain    string
	Id        string
	SyncToken string
	Metadata  ModificationMetaData `json:",omitempty"`
}

CompanyInfo describes a company account.

type ContactInfo

type ContactInfo struct {
	Type      string          `json:",omitempty"`
	Telephone TelephoneNumber `json:",omitempty"`
}

type ContentType

type ContentType string
const (
	AI   ContentType = "application/postscript"
	CSV  ContentType = "text/csv"
	DOC  ContentType = "application/msword"
	DOCX ContentType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
	EPS  ContentType = "application/postscript"
	GIF  ContentType = "image/gif"
	JPEG ContentType = "image/jpeg"
	JPG  ContentType = "image/jpg"
	ODS  ContentType = "application/vnd.oasis.opendocument.spreadsheet"
	PDF  ContentType = "application/pdf"
	PNG  ContentType = "image/png"
	RTF  ContentType = "text/rtf"
	TIF  ContentType = "image/tif"
	TXT  ContentType = "text/plain"
	XLS  ContentType = "application/vnd/ms-excel"
	XLSX ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
	XML  ContentType = "text/xml"
)

type Creatable added in v0.1.14

type Creatable[T any] interface {
	Create(params RequestParameters, object *T) (*T, error)
}

type CreditMemo

type CreditMemo struct {
	TotalAmt              float64              `json:",omitempty"`
	RemainingCredit       json.Number          `json:",omitempty"`
	Line                  []Line               `json:",omitempty"`
	ApplyTaxAfterDiscount bool                 `json:",omitempty"`
	DocNumber             string               `json:",omitempty"`
	TxnDate               Date                 `json:",omitempty"`
	Sparse                bool                 `json:"sparse,omitempty"`
	CustomerMemo          MemoRef              `json:",omitempty"`
	ProjectRef            ReferenceType        `json:",omitempty"`
	Balance               json.Number          `json:",omitempty"`
	CustomerRef           ReferenceType        `json:",omitempty"`
	TxnTaxDetail          *TxnTaxDetail        `json:",omitempty"`
	SyncToken             string               `json:",omitempty"`
	CustomField           []CustomField        `json:",omitempty"`
	ShipAddr              PhysicalAddress      `json:",omitempty"`
	EmailStatus           string               `json:",omitempty"`
	BillAddr              PhysicalAddress      `json:",omitempty"`
	MetaData              ModificationMetaData `json:",omitempty"`
	BillEmail             EmailAddress         `json:",omitempty"`
	Id                    string               `json:",omitempty"`
}

type CustomField

type CustomField struct {
	DefinitionId string `json:"DefinitionId,omitempty"`
	StringValue  string `json:"StringValue,omitempty"`
	Type         string `json:"Type,omitempty"`
	Name         string `json:"Name,omitempty"`
}

type Customer

type Customer struct {
	CustomerTypeRef      *ReferenceType       `json:",omitempty"`
	ParentRef            *ReferenceType       `json:",omitempty"`
	CurrencyRef          *ReferenceType       `json:",omitempty"`
	DefaultTaxCodeRef    *ReferenceType       `json:",omitempty"`
	SalesTermRef         *ReferenceType       `json:",omitempty"`
	PaymentMethodRef     *ReferenceType       `json:",omitempty"`
	PrimaryPhone         *TelephoneNumber     `json:",omitempty"`
	AlternatePhone       *TelephoneNumber     `json:",omitempty"`
	Mobile               *TelephoneNumber     `json:",omitempty"`
	Fax                  *TelephoneNumber     `json:",omitempty"`
	PrimaryEmailAddr     *EmailAddress        `json:",omitempty"`
	WebAddr              *WebSiteAddress      `json:",omitempty"`
	BillAddr             *PhysicalAddress     `json:",omitempty"`
	ShipAddr             *PhysicalAddress     `json:",omitempty"`
	OpenBalanceDate      *Date                `json:",omitempty"`
	Job                  null.Bool            `json:",omitempty"`
	MetaData             ModificationMetaData `json:",omitempty"`
	Balance              json.Number          `json:",omitempty"`
	BalanceWithJobs      json.Number          `json:",omitempty"`
	Id                   string               `json:",omitempty"`
	SyncToken            string               `json:",omitempty"`
	Title                string               `json:",omitempty"`
	GivenName            string               `json:",omitempty"`
	MiddleName           string               `json:",omitempty"`
	FamilyName           string               `json:",omitempty"`
	Suffix               string               `json:",omitempty"`
	DisplayName          string               `json:",omitempty"`
	FullyQualifiedName   string               `json:",omitempty"`
	CompanyName          string               `json:",omitempty"`
	PrintOnCheckName     string               `json:",omitempty"`
	TaxExemptionReasonId string               `json:",omitempty"`
	Notes                string               `json:",omitempty"`
	ResaleNum            string               `json:",omitempty"`
	Level                int                  `json:",omitempty"`
	Active               bool                 `json:",omitempty"`
	Taxable              bool                 `json:",omitempty"`
	BillWithParent       bool                 `json:",omitempty"`
	Domain               string               `json:"domain,omitempty"`
	Status               string               `json:"status,omitempty"`
}

Customer represents a QuickBooks Customer object.

type CustomerType

type CustomerType struct {
	Id        string               `json:",omitempty"`
	Name      string               `json:",omitempty"`
	SyncToken string               `json:",omitempty"`
	Active    bool                 `json:",omitempty"`
	MetaData  ModificationMetaData `json:",omitempty"`
	Domain    string               `json:"domain,omitempty"`
	Status    string               `json:"status,omitempty"`
}

type Date

type Date struct {
	time.Time `json:",omitempty"`
}

Date represents a Quickbooks date

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON removes time from parsed date

type DateTime

type DateTime struct {
	time.Time `json:",omitempty"`
}

DateTime represents a Quickbooks datatime

type DeliveryInfo

type DeliveryInfo struct {
	DeliveryType string
	DeliveryTime Date
}

type Deposit

type Deposit struct {
	Line                []Line
	TxnTaxDetail        *TxnTaxDetail `json:",omitempty"`
	DepositToAccountRef ReferenceType
	CurrencyRef         ReferenceType        `json:",omitempty"`
	DepartmentRef       *ReferenceType       `json:",omitempty"`
	RecurDataRef        *ReferenceType       `json:",omitempty"`
	TxnDate             *Date                `json:",omitempty"`
	MetaData            ModificationMetaData `json:",omitempty"`
	ExchangeRate        json.Number          `json:",omitempty"`
	TotalAmt            json.Number          `json:",omitempty"`
	HomeTotalAmt        json.Number          `json:",omitempty"`
	Id                  string               `json:",omitempty"`
	SyncToken           string               `json:",omitempty"`
	PrivateNote         string               `json:",omitempty"`
	Domain              string               `json:"domain,omitempty"`
	Status              string               `json:"status,omitempty"`
}

type DepositLineDetail

type DepositLineDetail struct {
	AccountRef       ReferenceType
	PaymentMethodRef ReferenceType `json:",omitempty"`
	ClassRef         ReferenceType `json:",omitempty"`
	TaxCodeRef       ReferenceType `json:",omitempty"`
	EntityRef        ReferenceType `json:",omitempty"`
	CheckNum         string        `json:",omitempty"`
}

DepositLineDetail ...

type DescriptionLineDetail

type DescriptionLineDetail struct {
	TaxCodeRef  ReferenceType `json:",omitempty"`
	ServiceDate Date          `json:",omitempty"`
}

DescriptionLineDetail ...

type DiscountLineDetail

type DiscountLineDetail struct {
	PercentBased    bool        `json:",omitempty"`
	DiscountPercent json.Number `json:",omitempty"`
}

DiscountLineDetail ...

type DiscoveryAPI

type DiscoveryAPI struct {
	Issuer                string `json:"issuer"`
	AuthorizationEndpoint string `json:"authorization_endpoint"`
	TokenEndpoint         string `json:"token_endpoint"`
	UserinfoEndpoint      string `json:"userinfo_endpoint"`
	RevocationEndpoint    string `json:"revocation_endpoint"`
	JwksUri               string `json:"jwks_uri"`
}

type EmailAddress

type EmailAddress struct {
	Address string `json:",omitempty"`
}

EmailAddress represents a QuickBooks email address.

type Employee

type Employee struct {
	PrimaryAddr      PhysicalAddress      `json:",omitempty"`
	PrimaryEmailAddr *EmailAddress        `json:",omitempty"`
	PrimaryPhone     *TelephoneNumber     `json:",omitempty"`
	Mobile           *TelephoneNumber     `json:",omitempty"`
	BirthDate        *Date                `json:",omitempty"`
	HiredDate        *Date                `json:",omitempty"`
	ReleasedDate     *Date                `json:",omitempty"`
	MetaData         ModificationMetaData `json:",omitempty"`
	CostRate         json.Number          `json:",omitempty"`
	BillRate         json.Number          `json:",omitempty"`
	Id               string               `json:",omitempty"`
	SyncToken        string               `json:",omitempty"`
	Title            string               `json:",omitempty"`
	GivenName        string               `json:",omitempty"`
	MiddleName       string               `json:",omitempty"`
	FamilyName       string               `json:",omitempty"`
	Suffix           string               `json:",omitempty"`
	DisplayName      string               `json:",omitempty"`
	PrintOnCheckName string               `json:",omitempty"`
	Gender           string               `json:",omitempty"`
	EmployeeNumber   string               `json:",omitempty"`
	SSN              string               `json:",omitempty"`
	Active           bool                 `json:",omitempty"`
	BillableTime     bool                 `json:",omitempty"`
	Organization     bool                 `json:",omitempty"`
	Domain           string               `json:"domain,omitempty"`
	Status           string               `json:"status,omitempty"`
}

type Estimate

type Estimate struct {
	Line                  []Line
	LinkedTxn             []LinkedTxn          `json:",omitempty"`
	CustomField           []CustomField        `json:",omitempty"`
	TxnTaxDetail          *TxnTaxDetail        `json:",omitempty"`
	CustomerRef           ReferenceType        `json:",omitempty"`
	ClassRef              *ReferenceType       `json:",omitempty"`
	SalesTermRef          *ReferenceType       `json:",omitempty"`
	DepartmentRef         *ReferenceType       `json:",omitempty"`
	ShipMethodRef         *ReferenceType       `json:",omitempty"`
	RecurDataRef          *ReferenceType       `json:",omitempty"`
	TaxExemptionRef       *ReferenceType       `json:",omitempty"`
	CurrencyRef           ReferenceType        `json:",omitempty"`
	ProjectRef            ReferenceType        `json:",omitempty"`
	ShipFromAddr          PhysicalAddress      `json:",omitempty"`
	ShipAddr              *PhysicalAddress     `json:",omitempty"`
	BillAddr              *PhysicalAddress     `json:",omitempty"`
	BillEmail             EmailAddress         `json:",omitempty"`
	BillEmailCC           *EmailAddress        `json:"BillEmailCc,omitempty"`
	BillEmailBCC          *EmailAddress        `json:"BillEmailBcc,omitempty"`
	DeliveryInfo          *DeliveryInfo        `json:",omitempty"`
	TxnDate               *Date                `json:",omitempty"`
	ShipDate              *Date                `json:",omitempty"`
	AcceptedDate          *Date                `json:",omitempty"`
	ExpirationDate        *Date                `json:",omitempty"`
	DueDate               *Date                `json:",omitempty"`
	CustomerMemo          MemoRef              `json:",omitempty"`
	MetaData              ModificationMetaData `json:",omitempty"`
	ExchangeRate          json.Number          `json:",omitempty"`
	TotalAmt              json.Number          `json:",omitempty"`
	HomeTotalAmt          json.Number          `json:",omitempty"`
	Id                    string               `json:",omitempty"`
	DocNumber             string               `json:",omitempty"`
	SyncToken             string               `json:",omitempty"`
	TxnStatus             string               `json:",omitempty"`
	PrintStatus           string               `json:",omitempty"`
	EmailStatus           string               `json:",omitempty"`
	PrivateNote           string               `json:",omitempty"`
	AcceptedBy            string               `json:",omitempty"`
	ApplyTaxAfterDiscount bool                 `json:",omitempty"`
	FreeFormAddress       bool                 `json:",omitempty"`
	Domain                string               `json:"domain,omitempty"`
	Status                string               `json:"status,omitempty"`
}

type Failure

type Failure struct {
	Fault struct {
		Error []struct {
			Message string
			Detail  string
			Code    string `json:"code"`
			Element string `json:"element"`
		}
		Type string `json:"type"`
	}
	Time Date `json:"time"`
}

Failure is the outermost struct that holds an error response.

func (Failure) Error

func (f Failure) Error() string

Error implements the error interface.

type GroupLineDetail

type GroupLineDetail struct {
	Quantity     json.Number   `json:",omitempty"`
	GroupItemRef ReferenceType `json:",omitempty"`
	Line         []Line        `json:",omitempty"`
}

GroupLineDetail ...

type Invoice

type Invoice struct {
	Line                         []Line
	LinkedTxn                    []LinkedTxn          `json:"LinkedTxn"`
	CustomField                  []CustomField        `json:",omitempty"`
	TxnTaxDetail                 *TxnTaxDetail        `json:",omitempty"`
	CustomerRef                  ReferenceType        `json:",omitempty"`
	ClassRef                     *ReferenceType       `json:",omitempty"`
	SalesTermRef                 *ReferenceType       `json:",omitempty"`
	DepartmentRef                *ReferenceType       `json:",omitempty"`
	ShipMethodRef                *ReferenceType       `json:",omitempty"`
	RecurDatRef                  *ReferenceType       `json:",omitempty"`
	TaxExemptionRef              *ReferenceType       `json:",omitempty"`
	DepositToAccountRef          *ReferenceType       `json:",omitempty"`
	CurrencyRef                  ReferenceType        `json:",omitempty"`
	ProjectRef                   ReferenceType        `json:",omitempty"`
	ShipFromAddr                 PhysicalAddress      `json:",omitempty"`
	ShipAddr                     *PhysicalAddress     `json:",omitempty"`
	BillAddr                     *PhysicalAddress     `json:",omitempty"`
	BillEmail                    EmailAddress         `json:",omitempty"`
	BillEmailCC                  *EmailAddress        `json:"BillEmailCc,omitempty"`
	BillEmailBCC                 *EmailAddress        `json:"BillEmailBcc,omitempty"`
	DeliveryInfo                 *DeliveryInfo        `json:",omitempty"`
	TxnDate                      *Date                `json:",omitempty"`
	ShipDate                     *Date                `json:",omitempty"`
	DueDate                      *Date                `json:",omitempty"`
	CustomerMemo                 MemoRef              `json:",omitempty"`
	MetaData                     ModificationMetaData `json:",omitempty"`
	ExchangeRate                 json.Number          `json:",omitempty"`
	Deposit                      json.Number          `json:",omitempty"`
	TotalAmt                     json.Number          `json:",omitempty"`
	Balance                      json.Number          `json:",omitempty"`
	HomeAmtTotal                 json.Number          `json:",omitempty"`
	HomeBalance                  json.Number          `json:",omitempty"`
	Id                           string               `json:"Id,omitempty"`
	DocNumber                    string               `json:",omitempty"`
	SyncToken                    string               `json:",omitempty"`
	PrivateNote                  string               `json:",omitempty"`
	TrackingNum                  string               `json:",omitempty"`
	PrintStatus                  string               `json:",omitempty"`
	EmailStatus                  string               `json:",omitempty"`
	TxnSource                    string               `json:",omitempty"`
	ApplyTaxAfterDiscount        bool                 `json:",omitempty"`
	AllowOnlineCreditCardPayment bool                 `json:",omitempty"`
	AllowOnlineACHPayment        bool                 `json:",omitempty"`
	FreeFormAddress              bool                 `json:",omitempty"`
	Domain                       string               `json:"domain,omitempty"`
	Status                       string               `json:"status,omitempty"`
}

Invoice represents a QuickBooks Invoice object.

type Item

type Item struct {
	AssetAccountRef      ReferenceType        `json:",omitempty"`
	IncomeAccountRef     ReferenceType        `json:",omitempty"`
	ExpenseAccountRef    *ReferenceType       `json:",omitempty"`
	SalesTaxCodeRef      *ReferenceType       `json:",omitempty"`
	PurchaseTaxCodeRef   *ReferenceType       `json:",omitempty"`
	TaxClassificationRef *ReferenceType       `json:",omitempty"`
	ClassRef             *ReferenceType       `json:",omitempty"`
	PrefVendorRef        *ReferenceType       `json:",omitempty"`
	ParentRef            *ReferenceType       `json:",omitempty"`
	InvStartDate         Date                 `json:",omitempty"`
	MetaData             ModificationMetaData `json:",omitempty"`
	QtyOnHand            json.Number          `json:",omitempty"`
	ReorderPoint         json.Number          `json:",omitempty"`
	PurchaseCost         json.Number          `json:",omitempty"`
	UnitPrice            json.Number          `json:",omitempty"`
	Level                json.Number          `json:",omitempty"`
	Id                   string               `json:",omitempty"`
	SyncToken            string               `json:",omitempty"`
	Name                 string               `json:",omitempty"`
	FullyQualifiedName   string               `json:",omitempty"`
	SKU                  string               `json:"Sku,omitempty"`
	Description          string               `json:",omitempty"`
	PurchaseDesc         string               `json:",omitempty"`
	Type                 string               `json:",omitempty"`
	TrackQtyOnHand       bool                 `json:",omitempty"`
	Active               bool                 `json:",omitempty"`
	Taxable              bool                 `json:",omitempty"`
	SalesTaxIncluded     bool                 `json:",omitempty"`
	PurchaseTaxIncluded  bool                 `json:",omitempty"`
	SubItem              bool                 `json:",omitempty"`
	Domain               string               `json:"domain,omitempty"`
	Status               string               `json:"status,omitempty"`
}

Item represents a QuickBooks Item object (a product type).

type ItemBasedExpenseLineDetail

type ItemBasedExpenseLineDetail struct {
	ItemRef ReferenceType
	// TaxInclusiveAmt json.Number              `json:",omitempty"`
	// PriceLevelRef ReferenceType `json:",omitempty"`
	ClassRef       ReferenceType      `json:",omitempty"`
	TaxCodeRef     ReferenceType      `json:",omitempty"`
	MarkupInfo     MarkupInfo         `json:",omitempty"`
	BillableStatus BillableStatusEnum `json:",omitempty"`
	CustomerRef    ReferenceType      `json:",omitempty"`
	Qty            json.Number
	UnitPrice      json.Number
}

ItemBasedExpenseLineDetail ...

type Line

type Line struct {
	Id                            string                        `json:",omitempty"`
	LineNum                       int                           `json:",omitempty"`
	Description                   string                        `json:",omitempty"`
	Amount                        json.Number                   `json:",omitempty"`
	DetailType                    LineDetailTypeEnum            `json:",omitempty"`
	LinkedTxn                     []LinkedTxn                   `json:",omitempty"`
	ProjectRef                    ReferenceType                 `json:",omitempty"`
	AccountBasedExpenseLineDetail AccountBasedExpenseLineDetail `json:",omitempty"`
	ItemBasedExpenseLineDetail    ItemBasedExpenseLineDetail    `json:",omitempty"`
	SalesItemLineDetail           SalesItemLineDetail           `json:",omitempty"`
	GroupLineDetail               GroupLineDetail               `json:",omitempty"`
	DescriptionLineDetail         DescriptionLineDetail         `json:",omitempty"`
	DiscountLineDetail            DiscountLineDetail            `json:",omitempty"`
	SubTotalLineDetail            SubTotalLineDetail            `json:",omitempty"`
	TaxLineDetail                 TaxLineDetail                 `json:",omitempty"`
	ReimburseLineDetail           ReimburseLineDetail           `json:",omitempty"`
	DepositLineDetail
}

type LineDetailTypeEnum

type LineDetailTypeEnum string
const (
	SalesItemLine      LineDetailTypeEnum = "SalesItemLineDetail"
	GroupLine          LineDetailTypeEnum = "GroupLineDetail"
	DescriptionLine    LineDetailTypeEnum = "DescriptionOnly"
	DiscountLine       LineDetailTypeEnum = "DiscountLineDetail"
	SubTotalLine       LineDetailTypeEnum = "SubTotalLineDetail"
	ItemExpenseLine    LineDetailTypeEnum = "ItemBasedExpenseLineDetail"
	AccountExpenseLine LineDetailTypeEnum = "AccountBasedExpenseLineDetail"
	TaxLine            LineDetailTypeEnum = "TaxLineDetail"
	ReimburseLine      LineDetailTypeEnum = "ReimburseLineDetail"
	DepositLine        LineDetailTypeEnum = "DepositLineDetail"
)

type LinkedTxn

type LinkedTxn struct {
	TxnId     string
	TxnType   string
	TxnLineId string `json:",omitempty"`
}

type MarkupInfo

type MarkupInfo struct {
	PriceLevelRef          ReferenceType `json:",omitempty"`
	Percent                json.Number   `json:",omitempty"`
	MarkUpIncomeAccountRef ReferenceType `json:",omitempty"`
}

type MemoRef

type MemoRef struct {
	Value string `json:"value,omitempty"`
}

MemoRef represents a QuickBooks MemoRef object.

type ModificationMetaData

type ModificationMetaData struct {
	CreateTime      Date `json:",omitempty"`
	LastUpdatedTime Date `json:",omitempty"`
}

ModificationMetaData is a timestamp of genesis and last change of a Quickbooks object

type Payment

type Payment struct {
	Line                []Line
	CustomerRef         ReferenceType        `json:",omitempty"`
	DepositToAccountRef *ReferenceType       `json:",omitempty"`
	CurrencyRef         ReferenceType        `json:",omitempty"`
	ProjectRef          ReferenceType        `json:",omitempty"`
	PaymentMethodRef    *ReferenceType       `json:",omitempty"`
	TaxExemptionRef     *ReferenceType       `json:",omitempty"`
	TxnDate             Date                 `json:",omitempty"`
	MetaData            ModificationMetaData `json:",omitempty"`
	ExchangeRate        json.Number          `json:",omitempty"`
	UnappliedAmt        json.Number          `json:",omitempty"`
	TotalAmt            json.Number          `json:",omitempty"`
	Id                  string               `json:",omitempty"`
	SyncToken           string               `json:",omitempty"`
	PrivateNote         string               `json:",omitempty"`
	ProcessPayment      bool                 `json:",omitempty"`
	Domain              string               `json:"domain,omitempty"`
	Status              string               `json:"status,omitempty"`
}

type PaymentMethod

type PaymentMethod struct {
	MetaData  ModificationMetaData `json:",omitempty"`
	Id        string               `json:",omitempty"`
	Name      string               `json:",omitempty"`
	SyncToken string               `json:",omitempty"`
	Type      string               `json:",omitempty"`
	Active    bool                 `json:",omitempty"`
	Domain    string               `json:"domain,omitempty"`
	Status    string               `json:"status,omitempty"`
}

type PhysicalAddress

type PhysicalAddress struct {
	Id string `json:"Id,omitempty"`
	// These lines are context-dependent! Read the QuickBooks API carefully.
	Line1   string `json:",omitempty"`
	Line2   string `json:",omitempty"`
	Line3   string `json:",omitempty"`
	Line4   string `json:",omitempty"`
	Line5   string `json:",omitempty"`
	City    string `json:",omitempty"`
	Country string `json:",omitempty"`
	// A.K.A. State.
	CountrySubDivisionCode string `json:",omitempty"`
	PostalCode             string `json:",omitempty"`
	Lat                    string `json:",omitempty"`
	Long                   string `json:",omitempty"`
}

PhysicalAddress represents a QuickBooks address.

type PrintStatusEnum

type PrintStatusEnum string
const (
	NotSetStatus        PrintStatusEnum = "NotSet"
	NeedToPrintStatus   PrintStatusEnum = "NeedToPrint"
	PrintCompleteStatus PrintStatusEnum = "PrintComplete"
)

type Purchase

type Purchase struct {
	Line             []Line
	LinkedTxn        []LinkedTxn          `json:",omitempty"`
	TxnTaxDetail     *TxnTaxDetail        `json:",omitempty"`
	AccountRef       ReferenceType        `json:",omitempty"`
	CurrencyRef      ReferenceType        `json:",omitempty"`
	PaymentMethodRef *ReferenceType       `json:",omitempty"`
	DepartmentRef    *ReferenceType       `json:",omitempty"`
	EntityRef        *ReferenceType       `json:",omitempty"`
	RecurDataRef     *ReferenceType       `json:",omitempty"`
	RemitToAddr      *PhysicalAddress     `json:",omitempty"`
	TxnDate          *Date                `json:",omitempty"`
	MetaData         ModificationMetaData `json:",omitempty"`
	ExchangeRate     json.Number          `json:",omitempty"`
	TotalAmt         json.Number          `json:",omitempty"`
	Id               string               `json:",omitempty"`
	DocNumber        string               `json:",omitempty"`
	PrivateNote      string               `json:",omitempty"`
	SyncToken        string               `json:",omitempty"`
	PaymentType      string               `json:",omitempty"`
	PrintStatus      PrintStatusEnum      `json:",omitempty"`
	Credit           bool                 `json:",omitempty"`
	Domain           string               `json:"domain,omitempty"`
	Status           string               `json:"status,omitempty"`
}

type RateLimitError added in v0.1.4

type RateLimitError struct {
	Message   string
	LimitType rateLimitType
}

func NewRateLimitError added in v0.1.4

func NewRateLimitError(limitType rateLimitType) *RateLimitError

func (*RateLimitError) Error added in v0.1.4

func (e *RateLimitError) Error() string

type RateLimiterManager

type RateLimiterManager struct {
	// contains filtered or unexported fields
}

RateLimiterManager manages rate limiters per realm.

func NewRateLimiterManager

func NewRateLimiterManager() *RateLimiterManager

NewRateLimiterManager initializes a new RateLimiterManager.

type RealmRateLimiters

type RealmRateLimiters struct {
	// contains filtered or unexported fields
}

type ReferenceType

type ReferenceType struct {
	Value string `json:"value,omitempty"`
	Name  string `json:"name,omitempty"`
	Type  string `json:"type,omitempty"`
}

ReferenceType represents a QuickBooks reference to another object.

type ReimburseCharge

type ReimburseCharge struct {
	Line            []Line
	LinkedTxn       []LinkedTxn          `json:",omitempty"`
	CustomerRef     ReferenceType        `json:",omitempty"`
	CurrencyRef     ReferenceType        `json:",omitempty"`
	TxnDate         *Date                `json:",omitempty"`
	MetaData        ModificationMetaData `json:",omitempty"`
	Amount          json.Number          `json:",omitempty"`
	ExchangeRate    json.Number          `json:",omitempty"`
	HomeTotalAmt    json.Number          `json:",omitempty"`
	Id              string               `json:",omitempty"`
	SyncToken       string               `json:",omitempty"`
	PrivateNote     string               `json:",omitempty"`
	HasBeenInvoiced bool                 `json:",omitempty"`
	Domain          string               `json:"domain,omitempty"`
	Status          string               `json:"status,omitempty"`
}

type ReimburseLineDetail

type ReimburseLineDetail struct {
	ClassRef           ReferenceType `json:",omitempty"`
	TaxCodeRef         ReferenceType `json:",omitempty"`
	DiscountAccountRef ReferenceType `json:",omitempty"`
	DiscountPercent    json.Number   `json:",omitempty"`
	PercentBased       bool          `json:",omitempty"`
	MarkupInfo         MarkupInfo    `json:",omitempty"`
	Qty                json.Number   `json:",omitempty"`
	ItemRef            ReferenceType `json:",omitempty"`
	ItemAccountRef     ReferenceType `json:",omitempty"`
	UnitPrice          json.Number   `json:",omitempty"`
}

ReimburseLineDetail ...

type RequestParameters

type RequestParameters struct {
	WaitOnRateLimit bool
	RealmId         string
	Token           *BearerToken
}

type SalesItemLineDetail

type SalesItemLineDetail struct {
	ItemRef         ReferenceType `json:",omitempty"`
	ClassRef        ReferenceType `json:",omitempty"`
	UnitPrice       json.Number   `json:",omitempty"`
	MarkupInfo      MarkupInfo    `json:",omitempty"`
	Qty             json.Number   `json:",omitempty"`
	ItemAccountRef  ReferenceType `json:",omitempty"`
	TaxCodeRef      ReferenceType `json:",omitempty"`
	ServiceDate     Date          `json:",omitempty"`
	TaxInclusiveAmt json.Number   `json:",omitempty"`
	DiscountRate    json.Number   `json:",omitempty"`
	DiscountAmt     json.Number   `json:",omitempty"`
}

SalesItemLineDetail ...

type SubTotalLineDetail

type SubTotalLineDetail struct {
	ItemRef ReferenceType `json:",omitempty"`
}

SubTotalLineDetail ...

type TaxCode

type TaxCode struct {
	PurchaseTaxRateList TaxRateList          `json:",omitempty"`
	SalesTaxRateList    TaxRateList          `json:",omitempty"`
	MetaData            ModificationMetaData `json:",omitempty"`
	Id                  string               `json:",omitempty"`
	Name                string               `json:",omitempty"`
	SyncToken           string               `json:",omitempty"`
	Description         string               `json:",omitempty"`
	TaxCodeConfigType   string               `json:",omitempty"`
	TaxGroup            bool                 `json:",omitempty"`
	Taxable             bool                 `json:",omitempty"`
	Active              bool                 `json:",omitempty"`
	Hidden              bool                 `json:",omitempty"`
}

type TaxLineDetail

type TaxLineDetail struct {
	TaxRateRef          ReferenceType `json:",omitempty"`
	NetAmountTaxable    json.Number   `json:",omitempty"`
	TaxInclusiveAmount  json.Number   `json:",omitempty"`
	OverrideDeltaAmount json.Number   `json:",omitempty"`
	TaxPercent          json.Number   `json:",omitempty"`
	PercentBased        bool          `json:",omitempty"`
}

TaxLineDetail ...

type TaxRate

type TaxRate struct {
	// EffectiveTaxRate EffectiveTaxRateData `json:",omitempty"`
	// AgencyRef        ReferenceType        `json:",omitempty"`
	// TaxReturnLineRef ReferenceType        `json:",omitempty"`
	MetaData       ModificationMetaData `json:",omitempty"`
	RateValue      json.Number          `json:",omitempty"`
	Id             string               `json:",omitempty"`
	SyncToken      string               `json:",omitempty"`
	Name           string               `json:",omitempty"`
	Description    string               `json:",omitempty"`
	SpecialTaxType string               `json:",omitempty"`
	DisplayType    string               `json:",omitempty"`
	Active         bool                 `json:",omitempty"`
}

type TaxRateDetail

type TaxRateDetail struct {
	TaxRateRef        ReferenceType
	TaxTypeApplicable TaxTypeEnum `json:",omitempty"`
	TaxOrder          json.Number `json:",omitempty"`
}

TaxRateDetail

type TaxRateList

type TaxRateList struct {
	TaxRateDetail []TaxRateDetail `json:",omitempty"`
}

TaxRateList ...

type TaxTypeEnum

type TaxTypeEnum string
const (
	TaxOnAmount        TaxTypeEnum = "TaxOnAmount"
	TaxOnAmountPlusTax TaxTypeEnum = "TaxOnAmountPlusTax"
	TaxOnTax           TaxTypeEnum = "TaxOnTax"
)

type TelephoneNumber

type TelephoneNumber struct {
	FreeFormNumber string `json:",omitempty"`
}

TelephoneNumber represents a QuickBooks phone number.

type Term

type Term struct {
	MetaData           ModificationMetaData `json:",omitempty"`
	DiscountPercent    json.Number          `json:",omitempty"`
	DiscountDays       json.Number          `json:",omitempty"`
	DayOfMonthDue      json.Number          `json:",omitempty"`
	DiscountDayOfMonth json.Number          `json:",omitempty"`
	DueNextMonthDays   json.Number          `json:",omitempty"`
	DueDays            json.Number          `json:",omitempty"`
	Id                 string               `json:",omitempty"`
	Name               string               `json:",omitempty"`
	SyncToken          string               `json:",omitempty"`
	Type               string               `json:",omitempty"`
	Active             bool                 `json:",omitempty"`
	Domain             string               `json:"domain,omitempty"`
	Status             string               `json:"status,omitempty"`
}

type TimeActivity

type TimeActivity struct {
	VendorRef      ReferenceType        `json:",omitempty"`
	EmployeeRef    ReferenceType        `json:",omitempty"`
	CustomerRef    ReferenceType        `json:",omitempty"`
	ProjectRef     ReferenceType        `json:",omitempty"`
	ClassRef       *ReferenceType       `json:",omitempty"`
	ItemRef        *ReferenceType       `json:",omitempty"`
	DepartmentRef  *ReferenceType       `json:",omitempty"`
	PayrollItemRef *ReferenceType       `json:",omitempty"`
	TxnDate        Date                 `json:",omitempty"`
	StartTime      *DateTime            `json:",omitempty"`
	EndTime        *DateTime            `json:",omitempty"`
	MetaData       ModificationMetaData `json:",omitempty"`
	BillableStatus BillableStatusEnum   `json:",omitempty"`
	BreakHours     json.Number          `json:",omitempty"`
	BreakMinutes   json.Number          `json:",omitempty"`
	BreakSeconds   json.Number          `json:",omitempty"`
	Hours          json.Number          `json:",omitempty"`
	Minutes        json.Number          `json:",omitempty"`
	Seconds        json.Number          `json:",omitempty"`
	HourlyRate     json.Number          `json:",omitempty"`
	CostRate       json.Number          `json:",omitempty"`
	Id             string               `json:",omitempty"`
	NameOf         string               `json:",omitempty"`
	SyncToken      string               `json:",omitempty"`
	Description    string               `json:",omitempty"`
	Taxable        bool                 `json:",omitempty"`
}

type TxnTaxDetail

type TxnTaxDetail struct {
	TxnTaxCodeRef ReferenceType `json:",omitempty"`
	TotalTax      json.Number   `json:",omitempty"`
	TaxLine       []Line        `json:",omitempty"`
}

type Vendor

type Vendor struct {
	TermRef             *ReferenceType       `json:",omitempty"`
	CurrencyRef         *ReferenceType       `json:",omitempty"`
	PrimaryPhone        *TelephoneNumber     `json:",omitempty"`
	AlternatePhone      *TelephoneNumber     `json:",omitempty"`
	Mobile              *TelephoneNumber     `json:",omitempty"`
	Fax                 *TelephoneNumber     `json:",omitempty"`
	PrimaryEmailAddr    *EmailAddress        `json:",omitempty"`
	WebAddr             *WebSiteAddress      `json:",omitempty"`
	BillAddr            *PhysicalAddress     `json:",omitempty"`
	OtherContactInfo    *ContactInfo         `json:",omitempty"`
	MetaData            ModificationMetaData `json:",omitempty"`
	CostRate            json.Number          `json:",omitempty"`
	BillRate            json.Number          `json:",omitempty"`
	Balance             json.Number          `json:",omitempty"`
	Id                  string               `json:",omitempty"`
	SyncToken           string               `json:",omitempty"`
	Title               string               `json:",omitempty"`
	GivenName           string               `json:",omitempty"`
	MiddleName          string               `json:",omitempty"`
	Suffix              string               `json:",omitempty"`
	FamilyName          string               `json:",omitempty"`
	DisplayName         string               `json:",omitempty"`
	CompanyName         string               `json:",omitempty"`
	TaxIdentifier       string               `json:",omitempty"`
	AcctNum             string               `json:",omitempty"`
	GSTRegistrationType string               `json:",omitempty"`
	PrintOnCheckName    string               `json:",omitempty"`
	Active              bool                 `json:",omitempty"`
	Vendor1099          bool                 `json:",omitempty"`
	Domain              string               `json:"domain,omitempty"`
	Status              string               `json:"status,omitempty"`
}

Vendor describes a vendor.

type VendorCredit

type VendorCredit struct {
	Line          []Line
	LinkedTxn     []LinkedTxn `json:",omitempty"`
	VendorRef     ReferenceType
	CurrencyRef   ReferenceType        `json:",omitempty"`
	APAccountRef  *ReferenceType       `json:",omitempty"`
	DepartmentRef *ReferenceType       `json:",omitempty"`
	RecurDataRef  *ReferenceType       `json:",omitempty"`
	TxnDate       *Date                `json:",omitempty"`
	MetaData      ModificationMetaData `json:",omitempty"`
	TotalAmt      json.Number          `json:",omitempty"`
	Balance       json.Number          `json:",omitempty"`
	ExchangeRate  json.Number          `json:",omitempty"`
	Id            string               `json:",omitempty"`
	SyncToken     string               `json:",omitempty"`
	DocNumber     string               `json:",omitempty"`
	PrivateNote   string               `json:",omitempty"`
	Domain        string               `json:"domain,omitempty"`
	Status        string               `json:"status,omitempty"`
}

type WebSiteAddress

type WebSiteAddress struct {
	URI string `json:",omitempty"`
}

WebSiteAddress represents a Quickbooks Website

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL