accounting

package
v0.0.0-...-7d59a54 Latest Latest
Warning

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

Go to latest
Published: Apr 19, 2021 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Account

type Account struct {

	// Customer defined alpha numeric account code e.g 200 or SALES (max length = 10)
	Code string `json:"Code,omitempty" xml:"Code,omitempty"`

	// Name of account (max length = 150)
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// See Account Types
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// For bank accounts only (Account Type BANK)
	BankAccountNumber string `json:"BankAccountNumber,omitempty" xml:"BankAccountNumber,omitempty"`

	// Accounts with a status of ACTIVE can be updated to ARCHIVED. See Account Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Description of the Account. Valid for all types of accounts except bank accounts (max length = 4000)
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`

	// For bank accounts only. See Bank Account types
	BankAccountType string `json:"BankAccountType,omitempty" xml:"BankAccountType,omitempty"`

	// For bank accounts only
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// See Tax Types
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`

	// Boolean – describes whether account can have payments applied to it
	EnablePaymentsToAccount bool `json:"EnablePaymentsToAccount,omitempty" xml:"EnablePaymentsToAccount,omitempty"`

	// Boolean – describes whether account code is available for use with expense claims
	ShowInExpenseClaims bool `json:"ShowInExpenseClaims,omitempty" xml:"ShowInExpenseClaims,omitempty"`

	// The Xero identifier for an account – specified as a string following the endpoint name e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9
	AccountID string `json:"AccountID,omitempty" xml:"AccountID,omitempty"`

	// See Account Class Types
	Class string `json:"Class,omitempty" xml:"-"`

	// If this is a system account then this element is returned. See System Account types. Note that non-system accounts may have this element set as either “” or null.
	SystemAccount string `json:"SystemAccount,omitempty" xml:"-"`

	// Shown if set
	ReportingCode string `json:"ReportingCode,omitempty" xml:"-"`

	// Shown if set
	ReportingCodeName string `json:"ReportingCodeName,omitempty" xml:"-"`

	// boolean to indicate if an account has an attachment (read only)
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`
}

Account represents individual accounts in a Xero organisation

type Accounts

type Accounts struct {
	Accounts []Account `json:"Accounts,omitempty" xml:"Account,omitempty"`
}

Accounts contains a collection of Accounts

func FindAccount

func FindAccount(provider *xerogolang.Provider, session goth.Session, accountID string) (*Accounts, error)

FindAccount will get a single account - accountID must be a GUID for an account

func FindAccounts

func FindAccounts(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Accounts, error)

FindAccounts will get all accounts. These account will not have details like line items. additional querystringParameters such as where and order can be added as a map

func FindAccountsModifiedSince

func FindAccountsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Accounts, error)

FindAccountsModifiedSince will get all accounts modified after a specified date. additional querystringParameters such as where and order can be added as a map

func GenerateExampleAccount

func GenerateExampleAccount() *Accounts

GenerateExampleAccount Creates an Example account

func RemoveAccount

func RemoveAccount(provider *xerogolang.Provider, session goth.Session, accountID string) (*Accounts, error)

RemoveAccount will get a single account - accountID must be a GUID for an account

func (*Accounts) Create

func (a *Accounts) Create(provider *xerogolang.Provider, session goth.Session) (*Accounts, error)

Create will create accounts given an Accounts struct

func (*Accounts) Update

func (a *Accounts) Update(provider *xerogolang.Provider, session goth.Session) (*Accounts, error)

Update will update an account given an Accounts struct This will only handle single account - you cannot update multiple accounts in a single call

type Address

type Address struct {
	AddressType string `json:"AddressType,omitempty" xml:"AddressType,omitempty"`

	// max length = 500
	AddressLine1 string `json:"AddressLine1,omitempty" xml:"AddressLine1,omitempty"`

	// max length = 500
	AddressLine2 string `json:"AddressLine2,omitempty" xml:"AddressLine2,omitempty"`

	// max length = 500
	AddressLine3 string `json:"AddressLine3,omitempty" xml:"AddressLine3,omitempty"`

	// max length = 500
	AddressLine4 string `json:"AddressLine4,omitempty" xml:"AddressLine4,omitempty"`

	// max length = 255
	City string `json:"City,omitempty" xml:"City,omitempty"`

	// max length = 255
	Region string `json:"Region,omitempty" xml:"Region,omitempty"`

	// max length = 50
	PostalCode string `json:"PostalCode,omitempty" xml:"PostalCode,omitempty"`

	// max length = 50, [A-Z], [a-z] only
	Country string `json:"Country,omitempty" xml:"Country,omitempty"`

	// max length = 255
	AttentionTo string `json:"AttentionTo,omitempty" xml:"AttentionTo,omitempty"`
}

Address is an address for a contact

type Allocation

type Allocation struct {

	// the amount being applied to the invoice
	AppliedAmount float64 `json:"AppliedAmount,omitempty" xml:"AppliedAmount,omitempty"`

	// the date the prepayment is applied YYYY-MM-DD (read-only). This will be the latter of the invoice date and the prepayment date.
	Date string `json:"Date,omitempty" xml:"-"`

	//The Invoice that the allocation will be made to
	Invoice InvoiceID `json:"Invoice,omitempty" xml:"Invoice>InvoiceID,omitempty"`
}

Allocation allocated an overpayment or Prepayment to an Invoice

type Allocations

type Allocations struct {
	Allocations []Allocation `json:"Allocations" xml:"Allocation"`
}

Allocations is a collection of Allocations

type Attribute

type Attribute struct {
	//value of the Attribute
	Value string `json:"Value,omitempty" xml:"Value,omitempty"`
	//ID of the Attribute
	ID string `json:"Id,omitempty" xml:"Id,omitempty"`
}

Attribute is an element within a Cell on a Report

type Balance

type Balance struct {
	Outstanding float64 `json:"Outstanding,omitempty" xml:"Outstanding,omitempty"`
	Overdue     float64 `json:"Overdue,omitempty" xml:"Overdue,omitempty"`
}

Balance is the raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency

type Balances

type Balances struct {
	AccountsReceivable Balance `json:"AccountsReceivable,omitempty" xml:"AccountsReceivable,omitempty"`
	AccountsPayable    Balance `json:"AccountsPayable,omitempty" xml:"AccountsPayable,omitempty"`
}

Balances are the raw AccountsReceivable(sales invoices) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency

type BankAccount

type BankAccount struct {

	// The Account Code of the Bank Account
	Code string `json:"Code,omitempty" xml:"Code,omitempty"`

	// The ID of the Bank Account
	AccountID string `json:"AccountID,omitempty" xml:"AccountID,omitempty"`

	// The Name Bank Account
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`
}

BankAccount is an element on a BankTransfer - it is not to be used alone and has no methods

type BankTransaction

type BankTransaction struct {

	// See Bank Transaction Types
	Type string `json:"Type" xml:"Type"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// See LineItems
	LineItems []LineItem `json:"LineItems" xml:"LineItems>LineItem"`

	// Boolean to show if transaction is reconciled
	IsReconciled bool `json:"IsReconciled,omitempty" xml:"IsReconciled,omitempty"`

	// Date of transaction – YYYY-MM-DD
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// Reference for the transaction. Only supported for SPEND and RECEIVE transactions.
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// The currency that bank transaction has been raised in (see Currencies). Setting currency is only supported on overpayments.
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// Exchange rate to base currency when money is spent or received. e.g. 0.7500 Only used for bank transactions in non base currency. If this isn’t specified for non base currency accounts then either the user-defined rate (preference) or the XE.com day rate will be used. Setting currency is only supported on overpayments.
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// URL link to a source document – shown as “Go to App Name”
	URL string `json:"Url,omitempty" xml:"Url,omitempty"`

	// See Bank Transaction Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// Total of bank transaction excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// Total tax on bank transaction
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// Total of bank transaction tax inclusive
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// Xero generated unique identifier for bank transaction
	BankTransactionID string `json:"BankTransactionID,omitempty" xml:"BankTransactionID,omitempty"`

	// Xero Bank Account
	BankAccount BankAccount `json:"BankAccount,omitempty" xml:"BankAccount,omitempty"`

	// Xero generated unique identifier for a Prepayment. This will be returned on BankTransactions with a Type of SPEND-PREPAYMENT or RECEIVE-PREPAYMENT
	PrepaymentID string `json:"PrepaymentID,omitempty" xml:"-"`

	// Xero generated unique identifier for an Overpayment. This will be returned on BankTransactions with a Type of SPEND-OVERPAYMENT or RECEIVE-OVERPAYMENT
	OverpaymentID string `json:"OverpaymentID,omitempty" xml:"-"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// Boolean to indicate if a bank transaction has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`
}

BankTransaction is a bank transaction

type BankTransactions

type BankTransactions struct {
	BankTransactions []BankTransaction `json:"BankTransactions" xml:"BankTransaction"`
}

BankTransactions contains a collection of BankTransactions

func FindBankTransaction

func FindBankTransaction(provider *xerogolang.Provider, session goth.Session, bankTransactionID string) (*BankTransactions, error)

FindBankTransaction will get a single BankTransaction - BankTransactionID can be a GUID for an BankTransaction or an BankTransaction number

func FindBankTransactions

func FindBankTransactions(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*BankTransactions, error)

FindBankTransactions will get all BankTransactions. These BankTransaction will not have details like line items by default. If you need details then then add a 'page' querystringParameter and get 100 BankTransactions at a time additional querystringParameters such as where, page, order can be added as a map

func FindBankTransactionsModifiedSince

func FindBankTransactionsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransactions, error)

FindBankTransactionsModifiedSince will get all BankTransactions modified after a specified date. These BankTransactions will not have details like default account codes and tracking categories by default. If you need details then then add a 'page' querystringParameter and get 100 BankTransactions at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleBankTransaction

func GenerateExampleBankTransaction() *BankTransactions

GenerateExampleBankTransaction Creates an Example bankTransaction

func (*BankTransactions) Create

func (b *BankTransactions) Create(provider *xerogolang.Provider, session goth.Session) (*BankTransactions, error)

Create will create BankTransactions given an BankTransactions struct

func (*BankTransactions) Update

func (b *BankTransactions) Update(provider *xerogolang.Provider, session goth.Session) (*BankTransactions, error)

Update will update a BankTransaction given a BankTransactions struct This will only handle single BankTransaction - you cannot update multiple BankTransactions in a single call

type BankTransfer

type BankTransfer struct {

	//
	Amount float64 `json:"Amount" xml:"Amount"`

	// The date of the Transfer YYYY-MM-DD
	Date string `json:"Date,omitempty" xml:"Date,omitempty"`

	// The identifier of the Bank Transfer
	BankTransferID string `json:"BankTransferID,omitempty" xml:"BankTransferID,omitempty"`

	// The currency rate
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// The Bank Transaction ID for the source account
	FromBankTransactionID string `json:"FromBankTransactionID,omitempty" xml:"FromBankTransactionID,omitempty"`

	// The Bank Transaction ID for the destination account
	ToBankTransactionID string `json:"ToBankTransactionID,omitempty" xml:"ToBankTransactionID,omitempty"`

	// Boolean to indicate if a Bank Transfer has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`

	// UTC timestamp of creation date of bank transfer
	CreatedDateUTC string `json:"CreatedDateUTC,omitempty" xml:"CreatedDateUTC,omitempty"`

	// The source BankAccount
	FromBankAccount BankAccount `json:"FromBankAccount,omitempty" xml:"FromBankAccount,omitempty"`

	// The destination BankAccount
	ToBankAccount BankAccount `json:"ToBankAccount,omitempty" xml:"ToBankAccount,omitempty"`
}

BankTransfer is a record of monies transferred from one bank account to another

type BankTransfers

type BankTransfers struct {
	BankTransfers []BankTransfer `json:"BankTransfers" xml:"BankTransfer"`
}

BankTransfers contains a collection of BankTransfers

func FindBankTransfer

func FindBankTransfer(provider *xerogolang.Provider, session goth.Session, bankTransferID string) (*BankTransfers, error)

FindBankTransfer will get a single bankTransfer - bankTransferID can be a GUID for an bankTransfer or an bankTransfer number

func FindBankTransfers

func FindBankTransfers(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*BankTransfers, error)

FindBankTransfers will get all BankTransfers. These BankTransfer will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 BankTransfers at a time additional querystringParameters such as where and order can be added as a map

func FindBankTransfersModifiedSince

func FindBankTransfersModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*BankTransfers, error)

FindBankTransfersModifiedSince will get all BankTransfers modified after a specified date. These BankTransfers will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 BankTransfers at a time additional querystringParameters such as where and order can be added as a map

func GenerateExampleBankTransfer

func GenerateExampleBankTransfer() *BankTransfers

GenerateExampleBankTransfer Creates an Example bankTransfer

func (*BankTransfers) Create

func (b *BankTransfers) Create(provider *xerogolang.Provider, session goth.Session) (*BankTransfers, error)

Create will create bankTransfers given a BankTransfers struct

type BatchPayment

type BatchPayment struct {

	// A user defined bank account number.
	BankAccountNumber string `json:"BankAccountNumber,omitempty" xml:"BankAccountNumber,omitempty"`

	// Full name of bank account
	BankAccountName string `json:"BankAccountName,omitempty" xml:"BankAccountName,omitempty"`

	// Details of the Batch payment
	Details string `json:"Details,omitempty" xml:"Details,omitempty"`

	// Code of the Batch payment
	Code string `json:"Code,omitempty" xml:"Code,omitempty"`

	// Reference of the Batch payment
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`
}

type Bill

type Bill struct {

	// Day of Month (0-31)
	Day string `json:"Day,omitempty"`

	// One of the following values OFFOLLOWINGMONTH/DAYSAFTERBILLDATE/OFCURRENTMONTH
	Type string `json:"Type,omitempty"`
}

type BrandingTheme

type BrandingTheme struct {

	// Xero identifier
	BrandingThemeID string `json:"BrandingThemeID,omitempty" xml:"BrandingThemeID,omitempty"`

	// Name of branding theme
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// Integer – ranked order of branding theme. The default branding theme has a value of 0
	SortOrder float64 `json:"SortOrder,omitempty" xml:"SortOrder,omitempty"`

	// UTC timestamp of creation date of branding theme
	CreatedDateUTC string `json:"CreatedDateUTC,omitempty" xml:"CreatedDateUTC,omitempty"`
}

BrandingTheme applies structure and visuals to an invoice when printed or sent

type BrandingThemes

type BrandingThemes struct {
	BrandingThemes []BrandingTheme `json:"BrandingThemes" xml:"BrandingTheme"`
}

BrandingThemes contains a collection of BrandingThemes

func FindBrandingThemes

func FindBrandingThemes(provider *xerogolang.Provider, session goth.Session) (*BrandingThemes, error)

FindBrandingThemes will get all BrandingThemes.

type Cell

type Cell struct {
	//Value is the value within a cell
	Value string `json:"Value,omitempty" xml:"Value,omitempty"`
	//Attributes are Attributes of a cell
	Attributes *[]Attribute `json:"Attributes,omitempty" xml:"Attributes>Attribute,omitempty"`
}

Cell is an element within a Row on a Report

type Contact

type Contact struct {

	// Xero identifier
	ContactID string `json:"ContactID,omitempty" xml:"ContactID,omitempty"`

	// This can be updated via the API only i.e. This field is read only on the Xero contact screen, used to identify contacts in external systems (max length = 50). If the Contact Number is used, this is displayed as Contact Code in the Contacts UI in Xero.
	ContactNumber string `json:"ContactNumber,omitempty" xml:"ContactNumber,omitempty"`

	// A user defined account number. This can be updated via the API and the Xero UI (max length = 50)
	AccountNumber string `json:"AccountNumber,omitempty" xml:"AccountNumber,omitempty"`

	// Current status of a contact – see contact status types
	ContactStatus string `json:"ContactStatus,omitempty" xml:"ContactStatus,omitempty"`

	// Full name of contact/organisation (max length = 255)
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// First name of contact person (max length = 255)
	FirstName string `json:"FirstName,omitempty" xml:"FirstName,omitempty"`

	// Last name of contact person (max length = 255)
	LastName string `json:"LastName,omitempty" xml:"LastName,omitempty"`

	// Email address of contact person (umlauts not supported) (max length = 255)
	EmailAddress string `json:"EmailAddress,omitempty" xml:"EmailAddress,omitempty"`

	// Skype user name of contact
	SkypeUserName string `json:"SkypeUserName,omitempty" xml:"SkypeUserName,omitempty"`

	// See contact persons
	ContactPersons *[]ContactPerson `json:"ContactPersons,omitempty" xml:"ContactPersons>ContactPerson,omitempty"`

	// Bank account number of contact
	BankAccountDetails string `json:"BankAccountDetails,omitempty" xml:"BankAccountDetails,omitempty"`

	// Tax number of contact – this is also known as the ABN (Australia), GST Number (New Zealand), VAT Number (UK) or Tax ID Number (US and global) in the Xero UI depending on which regionalized version of Xero you are using (max length = 50)
	TaxNumber string `json:"TaxNumber,omitempty" xml:"TaxNumber,omitempty"`

	// Default tax type used for contact on AR Contacts
	AccountsReceivableTaxType string `json:"AccountsReceivableTaxType,omitempty" xml:"AccountsReceivableTaxType,omitempty"`

	// Default tax type used for contact on AP Contacts
	AccountsPayableTaxType string `json:"AccountsPayableTaxType,omitempty" xml:"AccountsPayableTaxType,omitempty"`

	// Store certain address types for a contact – see address types
	Addresses *[]Address `json:"Addresses,omitempty" xml:"Addresses>Address,omitempty"`

	// Store certain phone types for a contact – see phone types
	Phones *[]Phone `json:"Phones,omitempty" xml:"Phones>Phone,omitempty"`

	// true or false – Boolean that describes if a contact that has any AP Contacts entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts payable Contact is generated against this contact.
	IsSupplier bool `json:"IsSupplier,omitempty" xml:"IsSupplier,omitempty"`

	// true or false – Boolean that describes if a contact has any AR Contacts entered against them. Cannot be set via PUT or POST – it is automatically set when an accounts receivable Contact is generated against this contact.
	IsCustomer bool `json:"IsCustomer,omitempty" xml:"IsCustomer,omitempty"`

	// Default currency for raising Contacts against contact
	DefaultCurrency string `json:"DefaultCurrency,omitempty" xml:"DefaultCurrency,omitempty"`

	// Store XeroNetworkKey for contacts.
	XeroNetworkKey string `json:"XeroNetworkKey,omitempty" xml:"XeroNetworkKey,omitempty"`

	// The default sales account code for contacts
	SalesDefaultAccountCode string `json:"SalesDefaultAccountCode,omitempty" xml:"SalesDefaultAccountCode,omitempty"`

	// The default purchases account code for contacts
	PurchasesDefaultAccountCode string `json:"PurchasesDefaultAccountCode,omitempty" xml:"PurchasesDefaultAccountCode,omitempty"`

	// The default sales tracking categories for contacts
	SalesTrackingCategories *[]TrackingCategory `json:"SalesTrackingCategories,omitempty" xml:"SalesTrackingCategories>SalesTrackingCategory,omitempty"`

	// The default purchases tracking categories for contacts
	PurchasesTrackingCategories *[]TrackingCategory `json:"PurchasesTrackingCategories,omitempty" xml:"PurchasesTrackingCategories>PurchaseTrackingCategory,omitempty"`

	// The name of the Tracking Category assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories
	TrackingCategoryName string `json:"TrackingCategoryName,omitempty" xml:"TrackingCategoryName,omitempty"`

	// The name of the Tracking Option assigned to the contact under SalesTrackingCategories and PurchasesTrackingCategories
	TrackingCategoryOption string `json:"TrackingCategoryOption,omitempty" xml:"TrackingCategoryOption,omitempty"`

	// UTC timestamp of last update to contact
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// Displays which contact groups a contact is included in
	ContactGroups *[]ContactGroup `json:"ContactGroups,omitempty" xml:"ContactGroups>ContactGroup,omitempty"`

	// Website address for contact (read only)
	Website string `json:"Website,omitempty" xml:"-"`

	// batch payment details for contact (read only)
	BatchPayments BatchPayment `json:"BatchPayments,omitempty" xml:"-"`

	// The default discount rate for the contact (read only)
	Discount float64 `json:"Discount,omitempty" xml:"-"`

	// The raw AccountsReceivable(sales Contacts) and AccountsPayable(bills) outstanding and overdue amounts, not converted to base currency (read only)
	Balances Balances `json:"Balances,omitempty" xml:"-"`

	// A boolean to indicate if a contact has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`
}

Contact is a debtor/customer or creditor/supplier in a Xero Organisation

type ContactGroup

type ContactGroup struct {

	// The Name of the contact group. Required when creating a new contact group
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// The Status of a contact group. To delete a contact group update the status to DELETED. Only contact groups with a status of ACTIVE are returned on GETs.
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// The Xero identifier for an contact group – specified as a string following the endpoint name. e.g. /297c2dc5-cc47-4afd-8ec8-74990b8761e9
	ContactGroupID string `json:"ContactGroupID,omitempty" xml:"ContactGroupID,omitempty"`

	// The ContactID and Name of Contacts in a contact group. Returned on GETs when the ContactGroupID is supplied in the URL.
	Contacts []Contact `json:"Contacts,omitempty" xml:"-"`
}

ContactGroup is a way of organising Contacts into groups

type ContactGroups

type ContactGroups struct {
	ContactGroups []ContactGroup `json:"ContactGroups" xml:"ContactGroup"`
}

ContactGroups is a collection of ContactGroups

func FindContactGroup

func FindContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*ContactGroups, error)

FindContactGroup will get a single contactGroup - contactGroupID must be a GUID for an contactGroup

func FindContactGroups

func FindContactGroups(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error)

FindContactGroups will get all contactGroups

func GenerateExampleContactGroup

func GenerateExampleContactGroup() *ContactGroups

GenerateExampleContactGroup Creates an Example contactGroup

func RemoveContactGroup

func RemoveContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*ContactGroups, error)

RemoveContactGroup will get a single contactGroup - contactGroupID must be a GUID for an contactGroup

func (*ContactGroups) Create

func (c *ContactGroups) Create(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error)

Create will create contactGroups given an ContactGroups struct

func (*ContactGroups) Update

func (c *ContactGroups) Update(provider *xerogolang.Provider, session goth.Session) (*ContactGroups, error)

Update will update an contactGroup given an ContactGroups struct This will only handle single contactGroup - you cannot update multiple contactGroups in a single call

type ContactPerson

type ContactPerson struct {

	// First name of person
	FirstName string `json:"FirstName,omitempty" xml:"FirstName,omitempty"`

	// Last name of person
	LastName string `json:"LastName,omitempty" xml:"LastName,omitempty"`

	// Email address of person
	EmailAddress string `json:"EmailAddress,omitempty" xml:"EmailAddress,omitempty"`

	// boolean to indicate whether contact should be included on emails with invoices etc.
	IncludeInEmails bool `json:"IncludeInEmails,omitempty" xml:"IncludeInEmails,omitempty"`
}

ContactPerson is a Contact Person against a Contact

type Contacts

type Contacts struct {
	Contacts []Contact `json:"Contacts" xml:"Contact"`
}

Contacts contains a collection of Contacts

func FindContact

func FindContact(provider *xerogolang.Provider, session goth.Session, contactID string) (*Contacts, error)

FindContact will get a single Contact - ContactID can be a GUID for an Contact or an Contact number

func FindContacts

func FindContacts(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Contacts, error)

FindContacts will get all Contacts. These Contact will not have details like default accounts. If you need details then then add a 'page' querystringParameter and get 100 Contacts at a time additional querystringParameters such as where, page, order can be added as a map

func FindContactsModifiedSince

func FindContactsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Contacts, error)

FindContactsModifiedSince will get all Contacts modified after a specified date. These Contacts will not have details like default account codes and tracking categories. If you need details then then add a 'page' querystringParameter and get 100 Contacts at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleContact

func GenerateExampleContact() *Contacts

GenerateExampleContact Creates an Example contact

func (*Contacts) AddToContactGroup

func (c *Contacts) AddToContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*Contacts, error)

AddToContactGroup will add a collection of Contacts to a supplied contactGroupID

func (*Contacts) Create

func (c *Contacts) Create(provider *xerogolang.Provider, session goth.Session) (*Contacts, error)

Create will create Contacts given an Contacts struct

func (*Contacts) RemoveFromContactGroup

func (c *Contacts) RemoveFromContactGroup(provider *xerogolang.Provider, session goth.Session, contactGroupID string) (*Contacts, error)

RemoveFromContactGroup will remove a Contact from a supplied contactGroupID - must be done one at a time.

func (*Contacts) Update

func (c *Contacts) Update(provider *xerogolang.Provider, session goth.Session) (*Contacts, error)

Update will update a Contact given a Contacts struct This will only handle single Contact - you cannot update multiple Contacts in a single call

type CreditNote

type CreditNote struct {

	// See Credit Note Types
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// The date the credit note is issued YYYY-MM-DD.
	// If the Date element is not specified then it will default
	// to the current date based on the timezone setting of the organisation
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// See Credit Note Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See Invoice Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// See Invoice Line Items
	LineItems []LineItem `json:"LineItems,omitempty" xml:"LineItems>LineItem,omitempty"`

	// The subtotal of the credit note excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// The total tax on the credit note
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// The total of the Credit Note(subtotal + total tax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// UTC timestamp of last update to the credit note
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// Currency used for the Credit Note
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// Date when credit note was fully paid(UTC format)
	FullyPaidOnDate string `json:"FullyPaidOnDate,omitempty" xml:"-"`

	// Xero generated unique identifier
	CreditNoteID string `json:"CreditNoteID,omitempty" xml:"CreditNoteID,omitempty"`

	// ACCRECCREDIT – Unique alpha numeric code identifying credit note (when missing will auto-generate from your Organisation Invoice Settings)
	CreditNoteNumber string `json:"CreditNoteNumber,omitempty" xml:"CreditNoteNumber,omitempty"`

	// ACCRECCREDIT only – additional reference number
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// boolean to indicate if a credit note has been sent to a contact via the Xero app (currently read only)
	SentToContact bool `json:"SentToContact,omitempty" xml:"SentToContact,omitempty"`

	// The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// The remaining credit balance on the Credit Note
	RemainingCredit float64 `json:"RemainingCredit,omitempty" xml:"-"`

	// See Allocations
	Allocations *[]Allocation `json:"Allocations,omitempty" xml:"-"`

	// See BrandingThemes
	BrandingThemeID string `json:"BrandingThemeID,omitempty" xml:"BrandingThemeID,omitempty"`

	// boolean to indicate if a credit note has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`
}

CreditNote an be raised directly against a customer or supplier, allowing the customer or supplier to be held in credit until a future invoice or bill is raised

type CreditNotes

type CreditNotes struct {
	CreditNotes []CreditNote `json:"CreditNotes" xml:"CreditNote"`
}

CreditNotes is a collection of CreditNote

func FindCreditNote

func FindCreditNote(provider *xerogolang.Provider, session goth.Session, creditNoteID string) (*CreditNotes, error)

FindCreditNote will get a single creditNote - creditNoteID can be a GUID for a creditNote or a creditNote number

func FindCreditNotes

func FindCreditNotes(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*CreditNotes, error)

FindCreditNotes will get all CreditNotes. These Credit Notes will not have details like line items by default. If you need details then then add a 'page' querystringParameter and get 100 Credit Notes at a time additional querystringParameters such as where, page, order can be added as a map

func FindCreditNotesModifiedSince

func FindCreditNotesModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*CreditNotes, error)

FindCreditNotesModifiedSince will get all Credit Notes modified after a specified date. These Credit Notes will not have details like line items by default. If you need details then then add a 'page' querystringParameter and get 100 Credit Notes at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleCreditNote

func GenerateExampleCreditNote() *CreditNotes

GenerateExampleCreditNote Creates an Example creditNote

func (*CreditNotes) Create

func (c *CreditNotes) Create(provider *xerogolang.Provider, session goth.Session) (*CreditNotes, error)

Create will create creditNotes given an CreditNotes struct

func (*CreditNotes) Update

func (c *CreditNotes) Update(provider *xerogolang.Provider, session goth.Session) (*CreditNotes, error)

Update will update an creditNote given an CreditNotes struct This will only handle single creditNote - you cannot update multiple creditNotes in a single call

type Currencies

type Currencies struct {
	Currencies []Currency `json:"Currencies,omitempty" xml:"Currency,omitempty"`
}

Currencies is a collection of Currencies

func FindCurrencies

func FindCurrencies(provider *xerogolang.Provider, session goth.Session) (*Currencies, error)

FindCurrencies will get all currencies

type Currency

type Currency struct {

	// 3 letter alpha code for the currency – see list of currency codes
	Code string `json:"Code,omitempty" xml:"Code,omitempty"`

	// Name of Currency
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`
}

Currency is the local currency set up to be used in Xero

type Employee

type Employee struct {

	// The Xero identifier for an employee e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
	EmployeeID string `json:"EmployeeID,omitempty"`

	// Current status of an employee – see contact status types
	Status string `json:"Status,omitempty"`

	// First name of an employee (max length = 255)
	FirstName string `json:"FirstName,omitempty"`

	// Last name of an employee (max length = 255)
	LastName string `json:"LastName,omitempty"`
}

Employee is for the deprecated Pay run feature.

type ExpenseClaim

type ExpenseClaim struct {
	//See Users
	User User `json:"User" xml:"User"`

	// See Receipts
	Receipts []Receipt `json:"Receipts" xml:"Receipts>Receipt"`

	// Xero generated unique identifier for an expense claim
	ExpenseClaimID string `json:"ExpenseClaimID,omitempty" xml:"ExpenseClaimID,omitempty"`

	// See Payments
	Payments *[]Payment `json:"Payments,omitempty" xml:"Payments>Payment,omitempty"`

	// Current status of an expense claim – see status types
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// The total of an expense claim being paid
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// The amount due to be paid for an expense claim
	AmountDue float64 `json:"AmountDue,omitempty" xml:"AmountDue,omitempty"`

	// The amount still to pay for an expense claim
	AmountPaid float64 `json:"AmountPaid,omitempty" xml:"AmountPaid,omitempty"`

	// The date when the expense claim is due to be paid YYYY-MM-DD
	PaymentDueDate string `json:"PaymentDueDate,omitempty" xml:"PaymentDueDate,omitempty"`

	// The date the expense claim will be reported in Xero YYYY-MM-DD
	ReportingDate string `json:"ReportingDate,omitempty" xml:"ReportingDate,omitempty"`

	// The Xero identifier for the Receipt e.g. e59a2c7f-1306-4078-a0f3-73537afcbba9
	ReceiptID string `json:"ReceiptID" xml:"ReceiptID"`
}

ExpenseClaim is a collection of receipts from personal spending that needs to be reimbursed by the business

type ExpenseClaims

type ExpenseClaims struct {
	ExpenseClaims []ExpenseClaim `json:"ExpenseClaims" xml:"ExpenseClaim"`
}

ExpenseClaims contains a collection of ExpenseClaims

func FindExpenseClaim

func FindExpenseClaim(provider *xerogolang.Provider, session goth.Session, expenseClaimID string) (*ExpenseClaims, error)

FindExpenseClaim will get a single expenseClaim - expenseClaimID can be a GUID for an expenseClaim or an expenseClaim number

func FindExpenseClaims

func FindExpenseClaims(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*ExpenseClaims, error)

FindExpenseClaims will get all ExpenseClaims. These ExpenseClaim will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 ExpenseClaims at a time additional querystringParameters such as where and order can be added as a map

func FindExpenseClaimsModifiedSince

func FindExpenseClaimsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*ExpenseClaims, error)

FindExpenseClaimsModifiedSince will get all ExpenseClaims modified after a specified date. These ExpenseClaims will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 ExpenseClaims at a time additional querystringParameters such as where and order can be added as a map

func GenerateExampleExpenseClaim

func GenerateExampleExpenseClaim(userID string, receiptID string) *ExpenseClaims

GenerateExampleExpenseClaim Creates an Example expenseClaim

func (*ExpenseClaims) Create

func (e *ExpenseClaims) Create(provider *xerogolang.Provider, session goth.Session) (*ExpenseClaims, error)

Create will create expenseClaims given an ExpenseClaims struct

func (*ExpenseClaims) Update

func (e *ExpenseClaims) Update(provider *xerogolang.Provider, session goth.Session) (*ExpenseClaims, error)

Update will update an expenseClaim given an ExpenseClaims struct This will only handle single expenseClaim - you cannot update multiple expenseClaims in a single call

type ExternalLink struct {

	// See External link types
	LinkType string `json:"LinkType,omitempty"`

	// URL for service e.g. http://twitter.com/xeroapi
	URL string `json:"Url,omitempty"`
}

type HistoryRecord

type HistoryRecord struct {

	// The type of change recorded against the document
	Changes string `json:"Changes,omitempty" xml:"-"`

	// UTC date that the history record was created
	DateUTC string `json:"DateUTC,omitempty" xml:"-"`

	// The user responsible for the change ("System Generated" when the change happens via API)
	User string `json:"User,omitempty" xml:"-"`

	// The Bank Transaction ID for the source account
	Details string `json:"Details" xml:"Details"`
}

BankTransfer is a record of monies transferred from one bank account to another

type HistoryRecords

type HistoryRecords struct {
	HistoryRecords []HistoryRecord `json:"HistoryRecords" xml:"HistoryRecords"`
}

BankTransfers contains a collection of BankTransfers

func FindHistoryAndNotes

func FindHistoryAndNotes(provider *xerogolang.Provider, session goth.Session, docType string, id string) (*HistoryRecords, error)

FindHistoryAndNotes gets all history items and notes for a given type and ID. it is not supported on all endpoints. See https://developer.xero.com/documentation/api/history-and-notes#SupportedDocs

func GenerateExampleHistoryRecord

func GenerateExampleHistoryRecord() *HistoryRecords

GenerateExampleBankTransfer Creates an Example bankTransfer

func (*HistoryRecords) Create

func (h *HistoryRecords) Create(provider *xerogolang.Provider, session goth.Session, docType string, id string) (*HistoryRecords, error)

Create will create History Records given a HistoryRecords struct and a docType and id

type Invoice

type Invoice struct {
	// See Invoice Types
	Type string `json:"Type" xml:"Type"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// See LineItems
	LineItems []LineItem `json:"LineItems" xml:"LineItems>LineItem"`

	// Date invoice was issued – YYYY-MM-DD. If the Date element is not specified it will default to the current date based on the timezone setting of the organisation
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// Date invoice is due – YYYY-MM-DD
	DueDate string `json:"DueDateString,omitempty" xml:"DueDate,omitempty"`

	// Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// ACCREC – Unique alpha numeric code identifying invoice (when missing will auto-generate from your Organisation Invoice Settings) (max length = 255)
	InvoiceNumber string `json:"InvoiceNumber,omitempty" xml:"InvoiceNumber,omitempty"`

	// ACCREC only – additional reference number (max length = 255)
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// See BrandingThemes
	BrandingThemeID string `json:"BrandingThemeID,omitempty" xml:"BrandingThemeID,omitempty"`

	// URL link to a source document – shown as “Go to [appName]” in the Xero app
	URL string `json:"Url,omitempty" xml:"Url,omitempty"`

	// The currency that invoice has been raised in (see Currencies)
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// The currency rate for a multicurrency invoice. If no rate is specified, the XE.com day rate is used. (max length = [18].[6])
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// See Invoice Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Boolean to set whether the invoice in the Xero app should be marked as “sent”. This can be set only on invoices that have been approved
	SentToContact bool `json:"SentToContact,omitempty" xml:"SentToContact,omitempty"`

	// Shown on sales invoices (Accounts Receivable) when this has been set
	ExpectedPaymentDate string `json:"ExpectedPaymentDate,omitempty" xml:"ExpectedPaymentDate,omitempty"`

	// Shown on bills (Accounts Payable) when this has been set
	PlannedPaymentDate string `json:"PlannedPaymentDate,omitempty" xml:"PlannedPaymentDate,omitempty"`

	// Total of invoice excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// Total tax on invoice
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// Total of Invoice tax inclusive (i.e. SubTotal + TotalTax). This will be ignored if it doesn’t equal the sum of the LineAmounts
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// Total of discounts applied on the invoice line items
	TotalDiscount float64 `json:"TotalDiscount,omitempty" xml:"-"`

	// Xero generated unique identifier for invoice
	InvoiceID string `json:"InvoiceID,omitempty" xml:"InvoiceID,omitempty"`

	// boolean to indicate if an invoice has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`

	// See Payments
	Payments *[]Payment `json:"Payments,omitempty" xml:"-"`

	// See Prepayments
	Prepayments *[]Prepayment `json:"Prepayments,omitempty" xml:"-"`

	// See Overpayments
	Overpayments *[]Overpayment `json:"Overpayments,omitempty" xml:"-"`

	// Amount remaining to be paid on invoice
	AmountDue float64 `json:"AmountDue,omitempty" xml:"-"`

	// Sum of payments received for invoice
	AmountPaid float64 `json:"AmountPaid,omitempty" xml:"-"`

	// The date the invoice was fully paid. Only returned on fully paid invoices
	FullyPaidOnDate string `json:"FullyPaidOnDate,omitempty" xml:"-"`

	// Sum of all credit notes, over-payments and pre-payments applied to invoice
	AmountCredited float64 `json:"AmountCredited,omitempty" xml:"-"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// Details of credit notes that have been applied to an invoice
	CreditNotes *[]CreditNote `json:"CreditNotes,omitempty" xml:"-"`
}

Invoice is an Accounts Payable or Accounts Recievable document in a Xero organisation

type InvoiceID

type InvoiceID struct {
	InvoiceID     string `json:"InvoiceID,omitempty" xml:"InvoiceID,omitempty"`
	InvoiceNumber string `json:"InvoiceNumber,omitempty" xml:"InvoiceNumber,omitempty"`
}

InvoiceID should only be used when you only need to return an Invoice ID and/or InvoiceNumber

type Invoices

type Invoices struct {
	Invoices []Invoice `json:"Invoices" xml:"Invoice"`
}

Invoices contains a collection of Invoices

func FindInvoice

func FindInvoice(provider *xerogolang.Provider, session goth.Session, invoiceID string) (*Invoices, error)

FindInvoice will get a single invoice - invoiceID can be a GUID for an invoice or an invoice number

func FindInvoices

func FindInvoices(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Invoices, error)

FindInvoices will get all Invoices. These Invoice will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 Invoices at a time additional querystringParameters such as where, page, order can be added as a map

func FindInvoicesModifiedSince

func FindInvoicesModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Invoices, error)

FindInvoicesModifiedSince will get all Invoices modified after a specified date. These Invoices will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 Invoices at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleInvoice

func GenerateExampleInvoice() *Invoices

GenerateExampleInvoice Creates an Example invoice

func (*Invoices) Create

func (i *Invoices) Create(provider *xerogolang.Provider, session goth.Session) (*Invoices, error)

Create will create invoices given an Invoices struct

func (*Invoices) Update

func (i *Invoices) Update(provider *xerogolang.Provider, session goth.Session) (*Invoices, error)

Update will update an invoice given an Invoices struct This will only handle single invoice - you cannot update multiple invoices in a single call

type Item

type Item struct {

	// User defined item code (max length = 30)
	Code string `json:"Code" xml:"Code"`

	// The inventory asset account for the item. The account must be of type INVENTORY. The  COGSAccountCode in PurchaseDetails is also required to create a tracked item
	InventoryAssetAccountCode string `json:"InventoryAssetAccountCode" xml:"InventoryAssetAccountCode"`

	// The name of the item (max length = 50)
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// Boolean value, defaults to true. When IsSold is true the item will be available on sales transactions in the Xero UI. If IsSold is updated to false then Description and SalesDetails values will be nulled.
	IsSold bool `json:"IsSold,omitempty" xml:"IsSold,omitempty"`

	// Boolean value, defaults to true. When IsPurchased is true the item is available for purchase transactions in the Xero UI. If IsPurchased is updated to false then PurchaseDescription and PurchaseDetails values will be nulled.
	IsPurchased bool `json:"IsPurchased,omitempty" xml:"IsPurchased,omitempty"`

	// The sales description of the item (max length = 4000)
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`

	// The purchase description of the item (max length = 4000)
	PurchaseDescription string `json:"PurchaseDescription,omitempty" xml:"PurchaseDescription,omitempty"`

	// See Purchases & Sales
	PurchaseDetails PurchaseAndSaleDetails `json:"PurchaseDetails,omitempty" xml:"PurchaseDetails,omitempty"`

	// See Purchases & Sales
	SalesDetails PurchaseAndSaleDetails `json:"SalesDetails,omitempty" xml:"SalesDetails,omitempty"`

	// True for items that are tracked as inventory. An item will be tracked as inventory if the InventoryAssetAccountCode and COGSAccountCode are set.
	IsTrackedAsInventory bool `json:"IsTrackedAsInventory,omitempty" xml:"-"`

	// The value of the item on hand. Calculated using average cost accounting.
	TotalCostPool float64 `json:"TotalCostPool,omitempty" xml:"-"`

	// The quantity of the item on hand
	QuantityOnHand float64 `json:"QuantityOnHand,omitempty" xml:"-"`

	// Last modified date in UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// The Xero identifier for an Item
	ItemID string `json:"ItemID,omitempty" xml:"ItemID,omitempty"`
}

Item is something that is sold or purchased. It can have inventory tracked or not tracked.

type Items

type Items struct {
	Items []Item `json:"Items" xml:"Item"`
}

Items is a collection of Items

func FindItem

func FindItem(provider *xerogolang.Provider, session goth.Session, itemID string) (*Items, error)

FindItem will get a single item - itemID must be a GUID for an item

func FindItems

func FindItems(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Items, error)

FindItems will get all items.

func FindItemsModifiedSince

func FindItemsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Items, error)

FindItemsModifiedSince will get all items modified after a specified date. additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleItem

func GenerateExampleItem() *Items

GenerateExampleItem Creates an Example item

func RemoveItem

func RemoveItem(provider *xerogolang.Provider, session goth.Session, itemID string) (*Items, error)

RemoveItem will get a single item - itemID must be a GUID for an item

func (*Items) Create

func (i *Items) Create(provider *xerogolang.Provider, session goth.Session) (*Items, error)

Create will create items given an Items struct

func (*Items) Update

func (i *Items) Update(provider *xerogolang.Provider, session goth.Session) (*Items, error)

Update will update an item given an Items struct This will only handle single item - you cannot update multiple items in a single call

type Journal

type Journal struct {

	// Xero identifier
	JournalID string `json:"JournalID,omitempty" xml:"JournalID,omitempty"`

	// Date the journal was posted
	JournalDate string `json:"JournalDate,omitempty" xml:"JournalDate,omitempty"`

	// Xero generated journal number
	JournalNumber int `json:"JournalNumber,omitempty" xml:"JournalNumber,omitempty"`

	// Created date UTC format
	CreatedDateUTC string `json:"CreatedDateUTC,omitempty" xml:"CreatedDateUTC,omitempty"`

	//
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// The identifier for the source transaction (e.g. InvoiceID)
	SourceID string `json:"SourceID,omitempty" xml:"SourceID,omitempty"`

	// The journal source type. The type of transaction that created the journal
	SourceType string `json:"SourceType,omitempty" xml:"SourceType,omitempty"`

	// See JournalLines
	JournalLines []JournalLine `json:"JournalLines,omitempty" xml:"JournalLines>JournalLine,omitempty"`
}

Journal is a record of a financial transaction in Xero

type JournalLine

type JournalLine struct {
	//Xero identifier
	JournalLineID string `json:"JournalLineID" xml:"JournalLineID"`

	//Xero identifier for an account
	AccountID string `json:"AccountID" xml:"AccountID"`

	// See Accounts
	AccountCode string `json:"AccountCode" xml:"AccountCode"`

	// See Accounts
	AccountType string `json:"AccountType" xml:"AccountType"`

	// See Accounts
	AccountName string `json:"AccountName" xml:"AccountName"`

	// The description from the source transaction line item. Only returned if populated.
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`

	// Net amount of journal line. This will be a positive value for a debit and negative for a credit
	NetAmount float64 `json:"NetAmount" xml:"NetAmount"`

	// 	Gross amount of journal line (NetAmount + TaxAmount).
	GrossAmount float64 `json:"GrossAmount" xml:"GrossAmount"`

	// The calculated tax amount based on the TaxType and LineAmount
	TaxAmount float64 `json:"TaxAmount,omitempty" xml:"TaxAmount,omitempty"`

	// Used as an override if the default Tax Code for the selected <AccountCode> is not correct – see TaxTypes.
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`

	//see tax TaxTypes
	TaxName string `json:"TaxName,omitempty" xml:"TaxName,omitempty"`

	// Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements.
	TrackingCategories []TrackingCategory `json:"TrackingCategories,omitempty" xml:"TrackingCategories>TrackingCategory,omitempty"`
}

JournalLine is a line on a Journal

type Journals

type Journals struct {
	Journals []Journal `json:"Journals,omitempty" xml:"Journal,omitempty"`
}

Journals is a collection of Journals

func FindJournal

func FindJournal(provider *xerogolang.Provider, session goth.Session, journalID string) (*Journals, error)

FindJournal will get a single journal - journalID can be a GUID for an journal or an journal number

func FindJournals

func FindJournals(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Journals, error)

FindJournals will get all journals. A maximum of 100 journals will be returned in any response. Use the offset or ModifiedSince filters with multiple API calls to retrieve larger sets of journals. Journals are ordered oldest to newest. additional querystringParameters such as offset and paymentsOnly can be added as a map

func FindJournalsModifiedSince

func FindJournalsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Journals, error)

FindJournalsModifiedSince will get all journals modified after a specified date. A maximum of 100 journals will be returned in any response. Use the offset or ModifiedSince filters with multiple API calls to retrieve larger sets of journals. Journals are ordered oldest to newest. additional querystringParameters such as offset and paymentsOnly can be added as a map

type LineItem

type LineItem struct {
	//The Xero generated identifier for a LineItem. It is recommended that you include LineItemIDs on update requests. If LineItemIDs are not included with line items in an update request then the line items are deleted and recreated.
	LineItemID string `json:"LineItemID,omitempty" xml:"LineItemID,omitempty"`

	// Description needs to be at least 1 char long. A line item with just a description (i.e no unit amount or quantity) can be created by specifying just a <Description> element that contains at least 1 character
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`

	// LineItem Quantity
	Quantity float64 `json:"Quantity,omitempty" xml:"Quantity,omitempty"`

	// LineItem Unit Amount
	UnitAmount float64 `json:"UnitAmount,omitempty" xml:"UnitAmount,omitempty"`

	// See Items
	ItemCode string `json:"ItemCode,omitempty" xml:"ItemCode,omitempty"`

	// See Accounts
	AccountCode string `json:"AccountCode,omitempty" xml:"AccountCode,omitempty"`

	// Used as an override if the default Tax Code for the selected <AccountCode> is not correct – see TaxTypes.
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`

	// The tax amount is auto calculated as a percentage of the line amount (see below) based on the tax rate. This value can be overriden if the calculated <TaxAmount> is not correct.
	TaxAmount float64 `json:"TaxAmount,omitempty" xml:"TaxAmount,omitempty"`

	// If you wish to omit either of the <Quantity> or <UnitAmount> you can provide a LineAmount and Xero will calculate the missing amount for you. The line amount reflects the discounted price if a DiscountRate has been used . i.e LineAmount = Quantity * Unit Amount * ((100 – DiscountRate)/100)
	LineAmount float64 `json:"LineAmount,omitempty" xml:"LineAmount,omitempty"`

	// Optional Tracking Category – see Tracking.  Any LineItem can have a maximum of 2 <TrackingCategory> elements.
	Tracking []TrackingCategory `json:"Tracking,omitempty" xml:"Tracking>TrackingCategory,omitempty"`

	// Percentage discount being applied to a line item (only supported on ACCREC invoices – ACC PAY invoices and credit notes in Xero do not support discounts
	DiscountRate float64 `json:"DiscountRate,omitempty" xml:"DiscountRate,omitempty"`

	// The Xero identifier for a Repeating Invoicee.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
	RepeatingInvoiceID string `json:"RepeatingInvoiceID,omitempty" xml:"RepeatingInvoiceID,omitempty"`
}

LineItem is a line containing detail on an Invoice

type LinkedTransaction

type LinkedTransaction struct {

	// Filter by the SourceTransactionID. Get all the linked transactions created from a particular ACCPAY invoice
	SourceTransactionID string `json:"SourceTransactionID,omitempty" xml:"SourceTransactionID,omitempty"`

	// The line item identifier from the source transaction.
	SourceLineItemID string `json:"SourceLineItemID" xml:"SourceLineItemID"`

	// Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
	ContactID string `json:"ContactID,omitempty" xml:"ContactID,omitempty"`

	// Filter by the TargetTransactionID. Get all the linked transactions allocated to a particular ACCREC invoice
	TargetTransactionID string `json:"TargetTransactionID,omitempty" xml:"TargetTransactionID,omitempty"`

	// The line item identifier from the target transaction. It is possible to link multiple billable expenses to the same TargetLineItemID.
	TargetLineItemID string `json:"TargetLineItemID,omitempty" xml:"TargetLineItemID,omitempty"`

	// The Xero identifier for an Linked Transaction e.g. /LinkedTransactions/297c2dc5-cc47-4afd-8ec8-74990b8761e9
	LinkedTransactionID string `json:"LinkedTransactionID,omitempty" xml:"LinkedTransactionID,omitempty"`

	// Filter by the combination of ContactID and Status. Get all the linked transactions that have been assigned to a particular customer and have a particular status e.g. GET /LinkedTransactions?ContactID=4bb34b03-3378-4bb2-a0ed-6345abf3224e&Status=APPROVED.
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// This will always be BILLABLEEXPENSE. More types may be added in future.
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// The last modified date in UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// The Type of the source tranasction. This will be ACCPAY if the linked transaction was created from an invoice and SPEND if it was created from a bank transaction.
	SourceTransactionTypeCode string `json:"SourceTransactionTypeCode,omitempty" xml:"SourceTransactionTypeCode,omitempty"`
}

LinkedTransaction can link transactions from an Accounts Payable invoice to an accounts recievable invoice - also known as a billable expense

type LinkedTransactions

type LinkedTransactions struct {
	LinkedTransactions []LinkedTransaction `json:"LinkedTransactions" xml:"LinkedTransaction"`
}

LinkedTransactions is a collection of LinkedTransactions

func FindLinkedTransaction

func FindLinkedTransaction(provider *xerogolang.Provider, session goth.Session, linkedTransactionID string) (*LinkedTransactions, error)

FindLinkedTransaction will get a single LinkedTransaction - LinkedTransactionID must be a GUID for an LinkedTransaction

func FindLinkedTransactions

func FindLinkedTransactions(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*LinkedTransactions, error)

FindLinkedTransactions will get all LinkedTransactions. additional querystringParameters such as page, SourceTransactionID, ContactID, Status, and TargetTransactionID can be added as a map

func FindLinkedTransactionsModifiedSince

func FindLinkedTransactionsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*LinkedTransactions, error)

FindLinkedTransactionsModifiedSince will get all LinkedTransactions modified after a specified date. additional querystringParameters such as page, SourceTransactionID, ContactID, Status, and TargetTransactionID can be added as a map

func GenerateExampleLinkedTransaction

func GenerateExampleLinkedTransaction(sourceTransactionID string, sourceLineItemID string, contactID string) *LinkedTransactions

GenerateExampleLinkedTransaction Creates an Example LinkedTransaction

func RemoveLinkedTransaction

func RemoveLinkedTransaction(provider *xerogolang.Provider, session goth.Session, linkedTransactionID string) (*LinkedTransactions, error)

RemoveLinkedTransaction will get a single LinkedTransaction - LinkedTransactionID must be a GUID for an LinkedTransaction

func (*LinkedTransactions) Create

func (l *LinkedTransactions) Create(provider *xerogolang.Provider, session goth.Session) (*LinkedTransactions, error)

Create will create LinkedTransactions given an LinkedTransactions struct

func (*LinkedTransactions) Update

func (l *LinkedTransactions) Update(provider *xerogolang.Provider, session goth.Session) (*LinkedTransactions, error)

Update will update an LinkedTransaction given an LinkedTransactions struct This will only handle single LinkedTransaction - you cannot update multiple LinkedTransactions in a single call LinkedTransactions cannot be modified, only created and deleted.

type ManualJournal

type ManualJournal struct {

	// Description of journal being posted
	Narration string `json:"Narration" xml:"Narration"`

	// See JournalLines
	JournalLines []ManualJournalLine `json:"JournalLines" xml:"JournalLines>JournalLine"`

	// Date journal was posted – YYYY-MM-DD
	Date string `json:"Date,omitempty" xml:"Date,omitempty"`

	// NoTax by default if you don’t specify this element. See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// See Manual Journal Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Url link to a source document – shown as “Go to [appName]” in the Xero app
	URL string `json:"Url,omitempty" xml:"Url,omitempty"`

	// Boolean – default is true if not specified
	ShowOnCashBasisReports bool `json:"ShowOnCashBasisReports,omitempty" xml:"ShowOnCashBasisReports,omitempty"`

	// Boolean to indicate if a manual journal has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// The Xero identifier for a Manual Journal
	ManualJournalID string `json:"ManualJournalID,omitempty" xml:"ManualJournalID,omitempty"`
}

ManualJournal used by accountants or bookkeepers to work directly with the general ledger. For example, to record accrued expenses or completed work not invoiced.

type ManualJournalLine

type ManualJournalLine struct {
	// See Accounts
	AccountCode string `json:"AccountCode" xml:"AccountCode"`

	// The description from the source transaction line item. Only returned if populated.
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`

	// Net amount of journal line. This will be a positive value for a debit and negative for a credit
	LineAmount float64 `json:"LineAmount" xml:"LineAmount"`

	// The calculated tax amount based on the TaxType and LineAmount
	TaxAmount float64 `json:"TaxAmount,omitempty" xml:"TaxAmount,omitempty"`

	// Used as an override if the default Tax Code for the selected <AccountCode> is not correct – see TaxTypes.
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`

	// Optional Tracking Category – see Tracking. Any JournalLine can have a maximum of 2 <TrackingCategory> elements.
	Tracking []TrackingCategory `json:"Tracking,omitempty" xml:"Tracking>TrackingCategory,omitempty"`
}

ManualJournalLine is a line on a Manual Journal

type ManualJournals

type ManualJournals struct {
	ManualJournals []ManualJournal `json:"ManualJournals,omitempty" xml:"ManualJournal,omitempty"`
}

ManualJournals is a collection of ManualJournals

func FindManualJournal

func FindManualJournal(provider *xerogolang.Provider, session goth.Session, manualJournalID string) (*ManualJournals, error)

FindManualJournal will get a single manualJournal - manualJournalID can be a GUID for an manualJournal or an manualJournal number

func FindManualJournals

func FindManualJournals(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*ManualJournals, error)

FindManualJournals will get all ManualJournals. These ManualJournal will not have details like line items. If you need details then then add a 'page' querystringParameter and get 100 ManualJournals at a time additional querystringParameters such as where, page, order can be added as a map

func FindManualJournalsModifiedSince

func FindManualJournalsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*ManualJournals, error)

FindManualJournalsModifiedSince will get all ManualJournals modified after a specified date. These ManualJournals will not have details like line items by default If you need details then then add a 'page' querystringParameter and get 100 ManualJournals at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleManualJournal

func GenerateExampleManualJournal() *ManualJournals

GenerateExampleManualJournal Creates an Example manualJournal

func (*ManualJournals) Create

func (m *ManualJournals) Create(provider *xerogolang.Provider, session goth.Session) (*ManualJournals, error)

Create will create manualJournals given an ManualJournals struct

func (*ManualJournals) Update

func (m *ManualJournals) Update(provider *xerogolang.Provider, session goth.Session) (*ManualJournals, error)

Update will update an manualJournal given an ManualJournals struct This will only handle single manualJournal - you cannot update multiple manualJournals in a single call

type Options

type Options struct {
	Options []TrackingOption `json:"Options,omitempty" xml:"Option,omitempty"`
}

Options is a collection of TrackingOptions

func (*Options) Add

func (o *Options) Add(provider *xerogolang.Provider, session goth.Session) (*TrackingCategories, error)

Add will add tracking options to the TrackingCategory Specified on the first option All options should belong to the same Tracking Category

type Organisation

type Organisation struct {

	// Display a unique key used for Xero-to-Xero transactions
	APIKey string `json:"APIKey,omitempty"`

	// Display name of organisation shown in Xero
	Name string `json:"Name,omitempty"`

	// Organisation name shown on Reports
	LegalName string `json:"LegalName,omitempty"`

	// Boolean to describe if organisation is registered with a local tax authority i.e. true, false
	PaysTax bool `json:"PaysTax,omitempty"`

	// See Version Types
	Version string `json:"Version,omitempty"`

	// Organisation Type
	OrganisationType string `json:"OrganisationType,omitempty"`

	// Default currency for organisation. See ISO 4217 Currency Codes
	BaseCurrency string `json:"BaseCurrency,omitempty"`

	// Country code for organisation. See ISO 3166-2 Country Codes
	CountryCode string `json:"CountryCode,omitempty"`

	// Boolean to describe if organisation is a demo company.
	IsDemoCompany bool `json:"IsDemoCompany,omitempty"`

	// Will be set to ACTIVE if you can connect to organisation via the Xero API
	OrganisationStatus string `json:"OrganisationStatus,omitempty"`

	// Shows for New Zealand, Australian and UK organisations
	RegistrationNumber string `json:"RegistrationNumber,omitempty"`

	// Shown if set. Displays in the Xero UI as Tax File Number (AU), GST Number (NZ), VAT Number (UK) and Tax ID Number (US & Global).
	TaxNumber string `json:"TaxNumber,omitempty"`

	// Calendar day e.g. 0-31
	FinancialYearEndDay int `json:"FinancialYearEndDay,omitempty"`

	// Calendar Month e.g. 1-12
	FinancialYearEndMonth int `json:"FinancialYearEndMonth,omitempty"`

	// The accounting basis used for tax returns. See Sales Tax Basis
	SalesTaxBasis string `json:"SalesTaxBasis,omitempty"`

	// The frequency with which tax returns are processed. See Sales Tax Period
	SalesTaxPeriod string `json:"SalesTaxPeriod,omitempty"`

	// The default for LineAmountTypes on sales transactions
	DefaultSalesTax string `json:"DefaultSalesTax,omitempty"`

	// The default for LineAmountTypes on purchase transactions
	DefaultPurchasesTax string `json:"DefaultPurchasesTax,omitempty"`

	// Shown if set. See lock dates
	PeriodLockDate string `json:"PeriodLockDate,omitempty"`

	// Shown if set. See lock dates
	EndOfYearLockDate string `json:"EndOfYearLockDate,omitempty"`

	// Timestamp when the organisation was created in Xero
	CreatedDateUTC string `json:"CreatedDateUTC,omitempty"`

	// Timezone specifications
	Timezone string `json:"Timezone,omitempty"`

	// Organisation Type
	OrganisationEntityType string `json:"OrganisationEntityType,omitempty"`

	// A unique identifier for the organisation.
	OrganisationID string `json:"OrganisationID,omitempty"`

	// A shorter unique identifier for the organisation.
	ShortCode string `json:"ShortCode,omitempty"`

	// Description of business type as defined in Organisation settings
	LineOfBusiness string `json:"LineOfBusiness,omitempty"`

	// Address details for organisation – see Addresses
	Addresses []Address `json:"Addresses,omitempty"`

	// Phones details for organisation – see Phones
	Phones []Phone `json:"Phones,omitempty"`

	// Organisation profile links for popular services such as Facebook, Twitter, GooglePlus and LinkedIn. You can also add link to your website here. Shown if Organisation settings  is updated in Xero. See ExternalLinks below
	ExternalLinks []ExternalLink `json:"ExternalLinks,omitempty"`
}

Organisation is information about a Xero organisation

type OrganisationCollection

type OrganisationCollection struct {
	Organisations []Organisation `json:"Organisations,omitempty"`
}

OrganisationCollection contains a collection of Organisations - but there will only ever be one. Like Highlander

func FindOrganisation

func FindOrganisation(provider *xerogolang.Provider, session goth.Session) (*OrganisationCollection, error)

FindOrganisation returns details about the Xero organisation you're connected to

type Overpayment

type Overpayment struct {

	// See Overpayment Types
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// The date the overpayment is created YYYY-MM-DD
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// See Overpayment Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See Overpayment Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// See Overpayment Line Items
	LineItems []LineItem `json:"LineItems,omitempty" xml:"LineItems,omitempty"`

	// The subtotal of the overpayment excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// The total tax on the overpayment
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// The total of the overpayment (subtotal + total tax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// UTC timestamp of last update to the overpayment
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"UpdatedDateUTC,omitempty"`

	// Currency used for the overpayment
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// Xero generated unique identifier
	OverpaymentID string `json:"OverpaymentID,omitempty" xml:"OverpaymentID,omitempty"`

	// The currency rate for a multicurrency overpayment. If no rate is specified, the XE.com day rate is used
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// The remaining credit balance on the overpayment
	RemainingCredit float64 `json:"RemainingCredit,omitempty" xml:"RemainingCredit,omitempty"`

	// See Allocations
	Allocations []Allocation `json:"Allocations,omitempty" xml:"Allocations,omitempty"`

	// See Payments
	Payments []Payment `json:"Payments,omitempty" xml:"Payments,omitempty"`

	// boolean to indicate if a overpayment has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`
}

Overpayment is used when a debtor overpays an invoice

type Overpayments

type Overpayments struct {
	Overpayments []Overpayment `json:"Overpayments" xml:"Overpayment"`
}

Overpayments is a collection of Overpayments

func FindOverpayment

func FindOverpayment(provider *xerogolang.Provider, session goth.Session, overpaymentID string) (*Overpayments, error)

FindOverpayment will get a single overpayment - overpaymentID can be a GUID for an overpayment or an overpayment number

func FindOverpayments

func FindOverpayments(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Overpayments, error)

FindOverpayments will get all Overpayments. These Overpayment will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 Overpayments at a time additional querystringParameters such as where, page, order can be added as a map

func FindOverpaymentsModifiedSince

func FindOverpaymentsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Overpayments, error)

FindOverpaymentsModifiedSince will get all Overpayments modified after a specified date. These Overpayments will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 Overpayments at a time additional querystringParameters such as where, page, order can be added as a map

func (*Overpayments) Allocate

func (o *Overpayments) Allocate(provider *xerogolang.Provider, session goth.Session, allocations Allocations) (*Overpayments, error)

Allocate allocates an overpayment - to create an overpayment use the bankTransactions endpoint.

type Payment

type Payment struct {

	// Number of invoice or credit note you are applying payment to e.g. INV-4003
	Invoice *Invoice `json:"Invoice,omitempty" xml:"Invoice,omitempty"`

	// Number of invoice or credit note you are applying payment to e.g. INV-4003
	CreditNote *CreditNote `json:"CreditNote,omitempty" xml:"CreditNote,omitempty"`

	//Account of payment
	Account *Account `json:"Account,omitempty" xml:"Account,omitempty"`

	// Date the payment is being made (YYYY-MM-DD) e.g. 2009-09-06
	Date string `json:"Date,omitempty" xml:"Date,omitempty"`

	// Exchange rate when payment is received. Only used for non base currency invoices and credit notes e.g. 0.7500
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// The amount of the payment. Must be less than or equal to the outstanding amount owing on the invoice e.g. 200.00
	Amount float64 `json:"Amount,omitempty" xml:"Amount,omitempty"`

	// An optional description for the payment e.g. Direct Debit
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// An optional parameter for the payment. A boolean indicating whether you would like the payment to be created as reconciled when using PUT, or whether a payment has been reconciled when using GET
	IsReconciled bool `json:"IsReconciled,omitempty" xml:"IsReconciled,omitempty"`

	// The status of the payment.
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See Payment Types.
	PaymentType string `json:"PaymentType,omitempty" xml:"-"`

	// UTC timestamp of last update to the payment
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// The Xero identifier for an Payment e.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
	PaymentID string `json:"PaymentID,omitempty" xml:"PaymentID,omitempty"`
}

Payment details payments against invoices and CreditNotes

type PaymentTerm

type PaymentTerm struct {
}

type Payments

type Payments struct {
	Payments []Payment `json:"Payments" xml:"Payment"`
}

Payments is a collection of Payments

func FindPayment

func FindPayment(provider *xerogolang.Provider, session goth.Session, paymentID string) (*Payments, error)

FindPayment will get a single payment - paymentID must be a GUID for an payment

func FindPayments

func FindPayments(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Payments, error)

FindPayments will get all payments.

func FindPaymentsModifiedSince

func FindPaymentsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Payments, error)

FindPaymentsModifiedSince will get all payments modified after a specified date. additional querystringParameters such as where, page, order can be added as a map

func GenerateExamplePayment

func GenerateExamplePayment(invoiceID string, amount float64) *Payments

GenerateExamplePayment Creates an Example payment

func RemovePayment

func RemovePayment(provider *xerogolang.Provider, session goth.Session, paymentID string) (*Payments, error)

RemovePayment will get a single payment - paymentID must be a GUID for an payment

func (*Payments) Create

func (p *Payments) Create(provider *xerogolang.Provider, session goth.Session) (*Payments, error)

Create will create payments given an Payments struct

func (*Payments) Update

func (p *Payments) Update(provider *xerogolang.Provider, session goth.Session) (*Payments, error)

Update will update an payment given an Payments struct This will only handle single payment - you cannot update multiple payments in a single call Payments cannot be modified, only created and deleted.

type Phone

type Phone struct {
	PhoneType string `json:"PhoneType,omitempty" xml:"PhoneType,omitempty"`

	// max length = 50
	PhoneNumber string `json:"PhoneNumber,omitempty" xml:"PhoneNumber,omitempty"`

	// max length = 10
	PhoneAreaCode string `json:"PhoneAreaCode,omitempty" xml:"PhoneAreaCode,omitempty"`

	// max length = 20
	PhoneCountryCode string `json:"PhoneCountryCode,omitempty" xml:"PhoneCountryCode,omitempty"`
}

type Prepayment

type Prepayment struct {

	// See Prepayment Types
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// The date the prepayment is created YYYY-MM-DD
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// See Prepayment Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See Prepayment Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// See Prepayment Line Items
	LineItems []LineItem `json:"LineItems,omitempty" xml:"LineItems,omitempty"`

	// The subtotal of the prepayment excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// The total tax on the prepayment
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// The total of the prepayment(subtotal + total tax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// UTC timestamp of last update to the prepayment
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"UpdatedDateUTC,omitempty"`

	// Currency used for the prepayment
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// Xero generated unique identifier
	PrepaymentID string `json:"PrepaymentID,omitempty" xml:"PrepaymentID,omitempty"`

	// The currency rate for a multicurrency prepayment. If no rate is specified, the XE.com day rate is used
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// The remaining credit balance on the prepayment
	RemainingCredit float64 `json:"RemainingCredit,omitempty" xml:"RemainingCredit,omitempty"`

	// See Allocations
	Allocations []Allocation `json:"Allocations,omitempty" xml:"Allocations,omitempty"`

	// boolean to indicate if a prepayment has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`
}

Prepayment are payments made before the associated document has been created

type Prepayments

type Prepayments struct {
	Prepayments []Prepayment `json:"Prepayments" xml:"Prepayment"`
}

Prepayments is a collection of Prepayments

func FindPrepayment

func FindPrepayment(provider *xerogolang.Provider, session goth.Session, prepaymentID string) (*Prepayments, error)

FindPrepayment will get a single prepayment - prepaymentID can be a GUID for an prepayment or an prepayment number

func FindPrepayments

func FindPrepayments(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Prepayments, error)

FindPrepayments will get all Prepayments. These Prepayment will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 Prepayments at a time additional querystringParameters such as where, page, order can be added as a map

func FindPrepaymentsModifiedSince

func FindPrepaymentsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Prepayments, error)

FindPrepaymentsModifiedSince will get all Prepayments modified after a specified date. These Prepayments will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 Prepayments at a time additional querystringParameters such as where, page, order can be added as a map

func (*Prepayments) Allocate

func (p *Prepayments) Allocate(provider *xerogolang.Provider, session goth.Session, allocations Allocations) (*Prepayments, error)

Allocate allocates a prepayment - to create a prepayment use the bankTransactions endpoint.

type Purchase

type Purchase struct {

	// Unit Price of the item. By default UnitPrice is rounded to two decimal places. You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request.
	UnitPrice float64 `json:"UnitPrice,omitempty"`

	// Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items
	AccountCode string `json:"AccountCode,omitempty"`

	// Cost of goods sold account. Only applicable to the purchase details of tracked items.
	COGSAccountCode string `json:"COGSAccountCode,omitempty"`

	// Used as an override if the default Tax Code for the selected <AccountCode> is not correct – see TaxTypes.
	TaxType string `json:"TaxType,omitempty"`
}

type PurchaseAndSaleDetails

type PurchaseAndSaleDetails struct {
	//Unit Price of the item. By default UnitPrice is returned to two decimal places.  You can use 4 decimal places by adding the unitdp=4 querystring parameter to your request.
	UnitPrice float64 `json:"UnitPrice,omitempty" xml:"UnitPrice,omitempty"`

	//Default account code to be used for purchased/sale. Not applicable to the purchase details of tracked items
	AccountCode string `json:"AccountCode,omitempty" xml:"AccountCode,omitempty"`

	//Cost of goods sold account. Only applicable to the purchase details of tracked items.
	COGSAccountCode string `json:"COGSAccountCode,omitempty" xml:"COGSAccountCode,omitempty"`

	//Used as an override if the default Tax Code for the selected AccountCode is not correct - see TaxTypes.
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`
}

PurchaseAndSaleDetails are Elements for Purchases and Sales

type PurchaseOrder

type PurchaseOrder struct {

	// See LineItems
	LineItems []LineItem `json:"LineItems" xml:"LineItems>LineItem"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// Date purchase order was issued – YYYY-MM-DD. If the Date element is not specified then it will default to the current date based on the timezone setting of the organisation
	Date string `json:"DateString,omitempty" xml:"Date,omitempty"`

	// Date the goods are to be delivered – YYYY-MM-DD
	DeliveryDate string `json:"DeliveryDateString,omitempty" xml:"DeliveryDate,omitempty"`

	// Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// Unique alpha numeric code identifying purchase order (when missing will auto-generate from your Organisation Invoice Settings)
	PurchaseOrderNumber string `json:"PurchaseOrderNumber,omitempty" xml:"PurchaseOrderNumber,omitempty"`

	// Additional reference number
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// See BrandingThemes
	BrandingThemeID string `json:"BrandingThemeID,omitempty" xml:"BrandingThemeID,omitempty"`

	// The currency that purchase order has been raised in (see Currencies)
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// See Purchase Order Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Boolean to set whether the purchase order should be marked as “sent”. This can be set only on purchase orders that have been approved or billed
	SentToContact bool `json:"SentToContact,omitempty" xml:"SentToContact,omitempty"`

	// The address the goods are to be delivered to
	DeliveryAddress string `json:"DeliveryAddress,omitempty" xml:"DeliveryAddress,omitempty"`

	// The person that the delivery is going to
	AttentionTo string `json:"AttentionTo,omitempty" xml:"AttentionTo,omitempty"`

	// The phone number for the person accepting the delivery
	Telephone string `json:"Telephone,omitempty" xml:"Telephone,omitempty"`

	// A free text feild for instructions (500 characters max)
	DeliveryInstructions string `json:"DeliveryInstructions,omitempty" xml:"DeliveryInstructions,omitempty"`

	// The date the goods are expected to arrive.
	ExpectedArrivalDate string `json:"ExpectedArrivalDate,omitempty" xml:"ExpectedArrivalDate,omitempty"`

	// Xero generated unique identifier for purchase order
	PurchaseOrderID string `json:"PurchaseOrderID,omitempty" xml:"PurchaseOrderID,omitempty"`

	// The currency rate for a multicurrency purchase order. As no rate can be specified, the XE.com day rate is used.
	CurrencyRate float64 `json:"CurrencyRate,omitempty" xml:"CurrencyRate,omitempty"`

	// Total of purchase order excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// Total tax on purchase order
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// Total of Purchase Order tax inclusive (i.e. SubTotal + TotalTax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// Total of discounts applied on the purchase order line items
	TotalDiscount float64 `json:"TotalDiscount,omitempty" xml:"TotalDiscount,omitempty"`

	// boolean to indicate if a purchase order has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"-"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`
}

PurchaseOrder is the first official offer issued by a buyer to a seller, indicating types, quantities, and agreed prices for products or services

type PurchaseOrders

type PurchaseOrders struct {
	PurchaseOrders []PurchaseOrder `json:"PurchaseOrders" xml:"PurchaseOrder"`
}

PurchaseOrders contains a collection of PurchaseOrders

func FindPurchaseOrder

func FindPurchaseOrder(provider *xerogolang.Provider, session goth.Session, purchaseOrderID string) (*PurchaseOrders, error)

FindPurchaseOrder will get a single purchaseOrder - purchaseOrderID can be a GUID for an purchaseOrder or an purchaseOrder number

func FindPurchaseOrders

func FindPurchaseOrders(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*PurchaseOrders, error)

FindPurchaseOrders will get all PurchaseOrders. Paging is enforced by default. 100 purchase orders are returned per page. additional querystringParameters such as page, order, status, DateFrom & DateTo can be added as a map

func FindPurchaseOrdersModifiedSince

func FindPurchaseOrdersModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*PurchaseOrders, error)

FindPurchaseOrdersModifiedSince will get all PurchaseOrders modified after a specified date. Paging is enforced by default. 100 purchase orders are returned per page. additional querystringParameters such as page, order, status, DateFrom & DateTo can be added as a map

func GenerateExamplePurchaseOrder

func GenerateExamplePurchaseOrder(contactID string) *PurchaseOrders

GenerateExamplePurchaseOrder Creates an Example purchaseOrder

func (*PurchaseOrders) Create

func (p *PurchaseOrders) Create(provider *xerogolang.Provider, session goth.Session) (*PurchaseOrders, error)

Create will create purchaseOrders given an PurchaseOrders struct

func (*PurchaseOrders) Update

func (p *PurchaseOrders) Update(provider *xerogolang.Provider, session goth.Session) (*PurchaseOrders, error)

Update will update an purchaseOrder given an PurchaseOrders struct This will only handle single purchaseOrder - you cannot update multiple purchaseOrders in a single call

type Receipt

type Receipt struct {
	//See Users
	User User `json:"User" xml:"User"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// Date of receipt – YYYY-MM-DD
	Date string `json:"Date" xml:"Date"`

	// See LineItems
	LineItems []LineItem `json:"LineItems" xml:"LineItems>LineItem"`

	// Additional reference number
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// Total of receipt excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// Total tax on receipt
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// Total of receipt tax inclusive (i.e. SubTotal + TotalTax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// Xero generated unique identifier for receipt
	ReceiptID string `json:"ReceiptID,omitempty" xml:"ReceiptID,omitempty"`

	// Current status of receipt – see status types
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Xero generated sequence number for receipt in current claim for a given user
	ReceiptNumber int `json:"ReceiptNumber,omitempty" xml:"ReceiptNumber,omitempty"`

	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"-"`

	// boolean to indicate if a receipt has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`

	// URL link to a source document – shown as “Go to [appName]” in the Xero app
	URL string `json:"Url,omitempty" xml:"Url,omitempty"`
}

Receipt is a record of personal money spent that a user would like to be reimbursed for - see also ExpenseClaim

type Receipts

type Receipts struct {
	Receipts []Receipt `json:"Receipts" xml:"Receipt"`
}

Receipts contains a collection of Receipts

func FindReceipt

func FindReceipt(provider *xerogolang.Provider, session goth.Session, receiptID string) (*Receipts, error)

FindReceipt will get a single receipt - receiptID can be a GUID for an receipt or an receipt number

func FindReceipts

func FindReceipts(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Receipts, error)

FindReceipts will get all Receipts. These Receipt will not have details like line items by default. If you need details then add a 'page' querystringParameter and get 100 Receipts at a time additional querystringParameters such as where, page, order can be added as a map

func FindReceiptsModifiedSince

func FindReceiptsModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Receipts, error)

FindReceiptsModifiedSince will get all Receipts modified after a specified date. These Receipts will not have details like default line items by default. If you need details then add a 'page' querystringParameter and get 100 Receipts at a time additional querystringParameters such as where, page, order can be added as a map

func GenerateExampleReceipt

func GenerateExampleReceipt(userID string, contactID string) *Receipts

GenerateExampleReceipt Creates an Example receipt

func (*Receipts) Create

func (r *Receipts) Create(provider *xerogolang.Provider, session goth.Session) (*Receipts, error)

Create will create receipts given an Receipts struct

func (*Receipts) Update

func (r *Receipts) Update(provider *xerogolang.Provider, session goth.Session) (*Receipts, error)

Update will update an receipt given an Receipts struct This will only handle single receipt - you cannot update multiple receipts in a single call

type RepeatingInvoice

type RepeatingInvoice struct {

	// See Invoice Types
	Type string `json:"Type,omitempty" xml:"Type,omitempty"`

	// See Contacts
	Contact Contact `json:"Contact" xml:"Contact"`

	// See LineItems
	LineItems []LineItem `json:"LineItems,omitempty" xml:"LineItems>LineItem,omitempty"`

	// Line amounts are exclusive of tax by default if you don’t specify this element. See Line Amount Types
	LineAmountTypes string `json:"LineAmountTypes,omitempty" xml:"LineAmountTypes,omitempty"`

	// ACCREC only – additional reference number
	Reference string `json:"Reference,omitempty" xml:"Reference,omitempty"`

	// See BrandingThemes
	BrandingThemeID string `json:"BrandingThemeID,omitempty" xml:"BrandingThemeID,omitempty"`

	// The currency that invoice has been raised in (see Currencies)
	CurrencyCode string `json:"CurrencyCode,omitempty" xml:"CurrencyCode,omitempty"`

	// One of the following : DRAFT or AUTHORISED – See Invoice Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Total of invoice excluding taxes
	SubTotal float64 `json:"SubTotal,omitempty" xml:"SubTotal,omitempty"`

	// Total tax on invoice
	TotalTax float64 `json:"TotalTax,omitempty" xml:"TotalTax,omitempty"`

	// Total of Invoice tax inclusive (i.e. SubTotal + TotalTax)
	Total float64 `json:"Total,omitempty" xml:"Total,omitempty"`

	// Xero generated unique identifier for repeating invoice template
	RepeatingInvoiceID string `json:"RepeatingInvoiceID,omitempty" xml:"RepeatingInvoiceID,omitempty"`

	// boolean to indicate if an invoice has an attachment
	HasAttachments bool `json:"HasAttachments,omitempty" xml:"HasAttachments,omitempty"`

	//Specifies when the repeating invoice will be created
	Schedule Schedule `json:"Schedule,omitempty" xml:"Schedule,omitempty"`
}

RepeatingInvoice a template for the invoices you send and bills you receive regularly

type RepeatingInvoices

type RepeatingInvoices struct {
	RepeatingInvoices []RepeatingInvoice `json:"RepeatingInvoices,omitempty" xml:"RepeatingInvoice,omitempty"`
}

RepeatingInvoices is a collection of RepeatingInvoices

func FindRepeatingInvoice

func FindRepeatingInvoice(provider *xerogolang.Provider, session goth.Session, repeatingInvoiceID string) (*RepeatingInvoices, error)

FindRepeatingInvoice will get a single repeatingInvoice - RepeatingInvoiceID must be a GUID for a repeatingInvoice

func FindRepeatingInvoices

func FindRepeatingInvoices(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*RepeatingInvoices, error)

FindRepeatingInvoices will get all repeatingInvoices additional querystringParameters such as where and order can be added as a map

type Report

type Report struct {
	//The ID of the report
	ReportID string `json:"ReportID,omitempty" xml:"ReportID,omitempty"`
	//The Name of the report
	ReportName string `json:"ReportName,omitempty" xml:"ReportName,omitempty"`
	//The type of report
	ReportType string `json:"ReportType,omitempty" xml:"ReportType,omitempty"`
	//A collection of titles for the report
	ReportTitles *[]string `json:"ReportTitles,omitempty" xml:"ReportTitles>ReportTitle,omitempty"`
	//The date of the report
	ReportDate string `json:"ReportDate,omitempty" xml:"ReportDate,omitempty"`
	// Last modified date UTC format
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"UpdatedDateUTC,omitempty"`
	//Attributes of the report
	Attributes *[]ReportAttribute `json:"Attributes,omitempty" xml:"Attributes>Attribute,omitempty"`
	//Rows on the report that may contain cells, Attributes, or other rows
	Rows *[]Row `json:"Rows,omitempty" xml:"Rows>Row,omitempty"`
}

Report is an organised set of financial information

type ReportAttribute

type ReportAttribute struct {
	//Name is the name of the Attribute
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`
	//Description describes the Attribute
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`
	//Value contains the value of the Attribute
	Value string `json:"Value,omitempty" xml:"Value,omitempty"`
}

ReportAttribute is an element on a report

type ReportField

type ReportField struct {
	//Name is the ID of the Field
	FieldID string `json:"FieldID,omitempty" xml:"FieldID,omitempty"`
	//Description describes the Field
	Description string `json:"Description,omitempty" xml:"Description,omitempty"`
	//Value contains the value of the Field
	Value string `json:"Value,omitempty" xml:"Value,omitempty"`
}

ReportField is an element on a report

type Reports

type Reports struct {
	Reports []Report `json:"Reports" xml:"Report"`
}

Reports is a collection of reports

func Run1099

func Run1099(provider *xerogolang.Provider, session goth.Session, reportYear int) (*Reports, error)

Run1099 will run the 1099 Report and marshal the results to a Report Struct This Report will only work for US based Organisations

func RunAgedPayablesByContact

func RunAgedPayablesByContact(provider *xerogolang.Provider, session goth.Session, contactID string, querystringParameters map[string]string) (*Reports, error)

RunAgedPayablesByContact will run the Aged Payables By Contact Report and marshal the results to a Report Struct Date, FromDate and ToDate can be added as optional paramters as a map

func RunAgedReceivablesByContact

func RunAgedReceivablesByContact(provider *xerogolang.Provider, session goth.Session, contactID string, querystringParameters map[string]string) (*Reports, error)

RunAgedReceivablesByContact will run the Aged Receivables By Contact Report and marshal the results to a Report Struct Date, FromDate and ToDate can be added as optional paramters as a map

func RunBASReport

func RunBASReport(provider *xerogolang.Provider, session goth.Session, reportID string) (*Reports, error)

RunBASReport will retrieve an individual BAS Report given a reportID and marshal the results to a Report Struct Will only work for AU based Organisations

func RunBASReports

func RunBASReports(provider *xerogolang.Provider, session goth.Session) (*Reports, error)

RunBASReports will retrieve all BAS Reports and marshal the results to a Report Struct Will only work for AU based Organisations

func RunBalanceSheet

func RunBalanceSheet(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunBalanceSheet will run the Balance Sheet Report and marshal the results to a Report Struct date, trackingOptionID1, trackingOptionID2, standardLayout, and paymentsOnly can be added as optional paramters as a map

func RunBankStatement

func RunBankStatement(provider *xerogolang.Provider, session goth.Session, bankAccountID string, querystringParameters map[string]string) (*Reports, error)

RunBankStatement will run the Bank Statement Report and marshal the results to a Report Struct FromDate and ToDate can be added as optional paramters as a map

func RunBankSummary

func RunBankSummary(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunBankSummary will run the Bank Summary Report and marshal the results to a Report Struct FromDate and ToDate can be added as optional paramters as a map

func RunBudgetSummary

func RunBudgetSummary(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunBudgetSummary will run the Budget Summary Report and marshal the results to a Report Struct

func RunExecutiveSummary

func RunExecutiveSummary(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunExecutiveSummary will run the Executive Summary Report and marshal the results to a Report Struct date can be added as an optional paramter as a map

func RunGSTReport

func RunGSTReport(provider *xerogolang.Provider, session goth.Session, reportID string) (*Reports, error)

RunGSTReport will retrieve an individual GST Report given a reportID and marshal the results to a Report Struct Will only work for NZ based Organisations

func RunGSTReports

func RunGSTReports(provider *xerogolang.Provider, session goth.Session) (*Reports, error)

RunGSTReports will retrieve all GST Reports and marshal the results to a Report Struct Will only work for NZ based Organisations

func RunProfitAndLoss

func RunProfitAndLoss(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunProfitAndLoss will run the Profit And Loss Report and marshal the results to a Report Struct date, trackingCategoryID, trackingOptionID, trackingCategoryID2, trackingOptionID2, standardLayout, and paymentsOnly can be added as optional paramters as a map

func RunTrialBalance

func RunTrialBalance(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Reports, error)

RunTrialBalance will run the TrialBalance Report and marshal the results to a Report Struct date and paymentsOnly can be added as optional paramters as a map

type Row

type Row struct {
	//RowType indicates what type of Row this is
	RowType string `json:"RowType,omitempty" xml:"RowType,omitempty"`
	//Title describes the row
	Title string `json:"Title,omitempty" xml:"Title,omitempty"`
	//Rows is a collection of other rows that can be nested beneath the row
	Rows *[]Row `json:"Rows,omitempty" xml:"Rows>Row,omitempty"`
	//Cells is a collection of cells that can be nested beneath the row
	Cells *[]Cell `json:"Cells,omitempty" xml:"Cells>Cell,omitempty"`
}

Row is a Row on a Report

type Schedule

type Schedule struct {

	// Integer used with the unit e.g. 1 (every 1 week), 2 (every 2 months)
	Period float64 `json:"Period,omitempty" xml:"Period,omitempty"`

	// One of the following : WEEKLY or MONTHLY
	Unit string `json:"Unit,omitempty" xml:"Unit,omitempty"`

	// Integer used with due date type e.g 20 (of following month), 31 (of current month)
	DueDate float64 `json:"DueDate,omitempty" xml:"DueDate,omitempty"`

	// Date the first invoice of the current version of the repeating schedule was generated (changes when repeating invoice is edited)
	StartDate string `json:"StartDate,omitempty" xml:"StartDate,omitempty"`

	// The calendar date of the next invoice in the schedule to be generated
	NextScheduledDate string `json:"NextScheduledDate,omitempty" xml:"NextScheduledDate,omitempty"`

	// Invoice end date – only returned if the template has an end date set
	EndDate string `json:"EndDate,omitempty" xml:"EndDate,omitempty"`
}

Schedule is an element on a Repeating Invoice - do not use it separately

type TaxComponent

type TaxComponent struct {

	// Name of Tax Component
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// Tax Rate (up to 4dp)
	Rate float64 `json:"Rate,omitempty" xml:"Rate,omitempty"`

	// Boolean to describe if Tax rate is compounded.Learn more
	IsCompound bool `json:"IsCompound,omitempty" xml:"IsCompound,omitempty"`

	// Filter by a Tax Type
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`
}

TaxComponent is a component of tax witjin a TaxRate

type TaxRate

type TaxRate struct {

	// Name of tax rate
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// See Tax Types – can only be used on update calls
	TaxType string `json:"TaxType,omitempty" xml:"TaxType,omitempty"`

	// See TaxComponents
	TaxComponents []TaxComponent `json:"TaxComponents,omitempty" xml:"TaxComponents>TaxComponent,omitempty"`

	// See Status Codes
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See ReportTaxTypes
	ReportTaxType string `json:"ReportTaxType" xml:"ReportTaxType"`

	// Boolean to describe if tax rate can be used for asset accounts i.e. true,false
	CanApplyToAssets bool `json:"CanApplyToAssets,omitempty" xml:"CanApplyToAssets,omitempty"`

	// Boolean to describe if tax rate can be used for equity accounts i.e. true,false
	CanApplyToEquity bool `json:"CanApplyToEquity,omitempty" xml:"CanApplyToEquity,omitempty"`

	// Boolean to describe if tax rate can be used for expense accounts i.e. true,false
	CanApplyToExpenses bool `json:"CanApplyToExpenses,omitempty" xml:"CanApplyToExpenses,omitempty"`

	// Boolean to describe if tax rate can be used for liability accounts i.e. true,false
	CanApplyToLiabilities bool `json:"CanApplyToLiabilities,omitempty" xml:"CanApplyToLiabilities,omitempty"`

	// Boolean to describe if tax rate can be used for revenue accounts i.e. true,false
	CanApplyToRevenue bool `json:"CanApplyToRevenue,omitempty" xml:"CanApplyToRevenue,omitempty"`

	// Tax Rate (decimal to 4dp) e.g 12.5000
	DisplayTaxRate float64 `json:"DisplayTaxRate,omitempty" xml:"DisplayTaxRate,omitempty"`

	// Effective Tax Rate (decimal to 4dp) e.g 12.5000
	EffectiveRate float64 `json:"EffectiveRate,omitempty" xml:"EffectiveRate,omitempty"`
}

TaxRate is a rate at which an item or service is taxed when sold or purchased

type TaxRates

type TaxRates struct {
	TaxRates []TaxRate `json:"TaxRates" xml:"TaxRate"`
}

func FindTaxRates

func FindTaxRates(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*TaxRates, error)

FindTaxRates will get all TaxRates. additional querystringParameters such as taxType, where and order can be added as a map

func GenerateExampleTaxRate

func GenerateExampleTaxRate() *TaxRates

GenerateExampleTaxRate Creates an Example taxRate

func (*TaxRates) Create

func (t *TaxRates) Create(provider *xerogolang.Provider, session goth.Session) (*TaxRates, error)

Create will create taxRates given an TaxRates struct

func (*TaxRates) Update

func (t *TaxRates) Update(provider *xerogolang.Provider, session goth.Session) (*TaxRates, error)

Update will update an taxRate given an TaxRates struct This will only handle a single taxRate - you cannot update multiple taxRates in a single call

type TrackingCategories

type TrackingCategories struct {
	TrackingCategories []TrackingCategory `json:"TrackingCategories" xml:"TrackingCategory"`
}

TrackingCategories is a collection of TrackingCategories

func FindTrackingCategories

func FindTrackingCategories(provider *xerogolang.Provider, session goth.Session) (*TrackingCategories, error)

FindTrackingCategories will get all trackingCategories

func FindTrackingCategory

func FindTrackingCategory(provider *xerogolang.Provider, session goth.Session, trackingCategoryID string) (*TrackingCategories, error)

FindTrackingCategory will get a single trackingCategory - trackingCategoryID must be a GUID for an trackingCategory

func GenerateExampleTrackingCategory

func GenerateExampleTrackingCategory() *TrackingCategories

GenerateExampleTrackingCategory Generates an Example trackingCategory

func RemoveTrackingCategory

func RemoveTrackingCategory(provider *xerogolang.Provider, session goth.Session, trackingCategoryID string) (*TrackingCategories, error)

RemoveTrackingCategory will get a single trackingCategory - trackingCategoryID must be a GUID for an trackingCategory

func (*TrackingCategories) Create

func (t *TrackingCategories) Create(provider *xerogolang.Provider, session goth.Session) (*TrackingCategories, error)

Create will create trackingCategories given an TrackingCategories struct

func (*TrackingCategories) Update

func (t *TrackingCategories) Update(provider *xerogolang.Provider, session goth.Session) (*TrackingCategories, error)

Update will update an trackingCategory given an TrackingCategories struct This will only handle single trackingCategory - you cannot update multiple trackingCategories in a single call

type TrackingCategory

type TrackingCategory struct {

	// The Xero identifier for a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
	TrackingCategoryID string `json:"TrackingCategoryID,omitempty" xml:"TrackingCategoryID,omitempty"`

	// The name of the tracking category e.g. Department, Region (max length = 100)
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// The status of a tracking category
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// See Tracking Options
	Options []TrackingOption `json:"Options,omitempty" xml:"Option"`
}

TrackingCategory is used to segment data within a Xero organisation

type TrackingOption

type TrackingOption struct {

	// The Xero identifier for a tracking optione.g. ae777a87-5ef3-4fa0-a4f0-d10e1f13073a
	TrackingOptionID string `json:"TrackingOptionID,omitempty" xml:"TrackingOptionID,omitempty"`

	// The name of the tracking option e.g. Marketing, East (max length = 50)
	Name string `json:"Name,omitempty" xml:"Name,omitempty"`

	// The status of a tracking option
	Status string `json:"Status,omitempty" xml:"Status,omitempty"`

	// Filter by a tracking categorye.g. 297c2dc5-cc47-4afd-8ec8-74990b8761e9
	TrackingCategoryID string `json:"TrackingCategoryID,omitempty" xml:"-"`
}

TrackingOption is an option from within a Tracking category

func (*TrackingOption) MarshalXML

func (t *TrackingOption) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (*TrackingOption) Update

func (t *TrackingOption) Update(provider *xerogolang.Provider, session goth.Session) (*TrackingCategories, error)

Update will update a given tracking option

type User

type User struct {

	// Xero identifier
	UserID string `json:"UserID,omitempty" xml:"UserID,omitempty"`

	// Email address of user
	EmailAddress string `json:"EmailAddress,omitempty" xml:"EmailAddress,omitempty"`

	// First name of user
	FirstName string `json:"FirstName,omitempty" xml:"FirstName,omitempty"`

	// Last name of user
	LastName string `json:"LastName,omitempty" xml:"LastName,omitempty"`

	// Timestamp of last change to user
	UpdatedDateUTC string `json:"UpdatedDateUTC,omitempty" xml:"UpdatedDateUTC,omitempty"`

	// Boolean to indicate if user is the subscriber
	IsSubscriber bool `json:"IsSubscriber,omitempty" xml:"IsSubscriber,omitempty"`

	// User role (see Types)
	OrganisationRole string `json:"OrganisationRole,omitempty" xml:"OrganisationRole,omitempty"`
}

User represents a login that has been granted access to the Xero organisation you're connected to

type Users

type Users struct {
	Users []User `json:"Users,omitempty" xml:"User,omitempty"`
}

Users is a collection of Users

func FindUser

func FindUser(provider *xerogolang.Provider, session goth.Session, userID string) (*Users, error)

FindUser will get a single user - UserID must be a GUID for a user

func FindUsers

func FindUsers(provider *xerogolang.Provider, session goth.Session, querystringParameters map[string]string) (*Users, error)

FindUsers will get all users additional querystringParameters such as where and order can be added as a map

func FindUsersModifiedSince

func FindUsersModifiedSince(provider *xerogolang.Provider, session goth.Session, modifiedSince time.Time, querystringParameters map[string]string) (*Users, error)

FindUsersModifiedSince will get all users modified after a specified date additional querystringParameters such as where and order can be added as a map

Jump to

Keyboard shortcuts

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