Versions in this module Expand all Collapse all v0 v0.1.0 Aug 16, 2026 Changes in this version + const BankAccountTypeAmazonSeller + const BankAccountTypeCreditCard + const BankAccountTypeEcommerce + const BankAccountTypeGoCardless + const BankAccountTypePaypalClassic + const BankAccountTypePaypalCurrency + const BankAccountTypeRentalStatement + const BankAccountTypeStandard + const BankAccountTypeStripe + const BankAccountViewCreditCard + const BankAccountViewPaypal + const BankAccountViewStandard + const BankFeedTypeAPI + const BankFeedTypeOpenBanking + const BillViewAll + const BillViewCIS + const BillViewHirePurchase + const BillViewOpen + const BillViewOpenOrOverdue + const BillViewOpenOrOverduePayments + const BillViewOpenOrOverdueRefunds + const BillViewOverdue + const BillViewPaid + const BillViewRecurring + const CISBandGross + const CISBandHigher + const CISBandStandard + const CapitalAssetViewAll + const CapitalAssetViewDisposable + const CapitalAssetViewDisposed + const CategoryGroupAdminExpenses + const CategoryGroupCostOfSales + const CategoryGroupGeneral + const CategoryGroupIncome + const ContactViewActive + const ContactViewActiveProjects + const ContactViewAll + const ContactViewClients + const ContactViewCompletedProjects + const ContactViewHidden + const ContactViewOpenClients + const ContactViewOpenSuppliers + const ContactViewSuppliers + const CreditNoteViewAll + const CreditNoteViewDraft + const CreditNoteViewOpen + const CreditNoteViewOpenOrOverdue + const CreditNoteViewOverdue + const CreditNoteViewRecentOpenOverdue + const CreditNoteViewRefunded + const DateLayout + const DefaultAPIVersion + const DefaultBaseURL + const DefaultMaxResponseBytes + const DefaultRequestsPerHour + const DefaultRequestsPerMinute + const DepreciationFrequencyAnnual + const DepreciationFrequencyMonthly + const DepreciationNone + const DepreciationReducingBalance + const DepreciationStraightLine + const EstimateViewAll + const EstimateViewApproved + const EstimateViewDraft + const EstimateViewInvoiced + const EstimateViewNonDraft + const EstimateViewRecent + const EstimateViewRejected + const EstimateViewSent + const ExpenseViewRecent + const ExpenseViewRecurring + const FilingStatusDraft + const FilingStatusFiled + const FilingStatusMarkedAsFiled + const FilingStatusPending + const FilingStatusRejected + const FilingStatusUnfiled + const InvoiceViewAll + const InvoiceViewDraft + const InvoiceViewOpen + const InvoiceViewOpenOrOverdue + const InvoiceViewOverdue + const InvoiceViewPaid + const InvoiceViewRecentOpenOverdue + const InvoiceViewReminderEmails + const InvoiceViewScheduledToEmail + const InvoiceViewThankYouEmails + const MaxAttachmentBytes + const MaxPerPage + const PaymentStatusMarkedAsPaid + const PaymentStatusUnpaid + const ProjectViewActive + const ProjectViewCancelled + const ProjectViewCompleted + const ProjectViewHidden + const RecurringInvoiceViewActive + const RecurringInvoiceViewDraft + const RecurringInvoiceViewInactive + const SandboxBaseURL + const TaskViewActive + const TaskViewAll + const TaskViewCompleted + const TaskViewHidden + const TimeslipViewAll + const TimeslipViewRunning + const TimeslipViewUnbilled + const TimestampLayout + const UserViewActiveAdvisors + const UserViewActiveStaff + const UserViewAdvisors + const UserViewAll + const UserViewStaff + const VATStatusOutOfScope + const VATStatusReduced + const VATStatusStandard + const VATStatusZero + const Version + var DefaultRetryPolicy = RetryPolicy + var DefaultUserAgent = "freeagent-go/" + Version + " (+https://github.com/alekc/freeagent)" + var ErrForbidden = errors.New("freeagent: forbidden") + var ErrNoToken = errors.New("freeagent: no stored token") + var ErrNoTokenSource = errors.New("freeagent: no token source configured, pass WithTokenSource or WithoutAuth") + var ErrNotAMember = errors.New("freeagent: resource URL does not address a collection member") + var ErrNotFound = errors.New("freeagent: not found") + var ErrRateLimited = errors.New("freeagent: rate limited") + var ErrReadOnly = errors.New("freeagent: client is read-only") + var ErrServer = errors.New("freeagent: server error") + var ErrUnauthorized = errors.New("freeagent: unauthorized") + var ErrValidation = errors.New("freeagent: validation failed") + var Production = Environment + var Resources = map[string]ResourceMeta + var Sandbox = Environment + func DefaultTokenPath() (string, error) + func ExpiresIn(t *oauth2.Token, now time.Time) string + func ResourceNames() []string + type APIError struct + Body []byte + Errors []FieldError + Message string + Method string + RequestID string + RetryAfter time.Duration + StatusCode int + URL string + func (e *APIError) Error() string + func (e *APIError) Is(target error) bool + type AccountingPeriod struct + EndsOn Date + StartsOn Date + type Attachment struct + ContentSrc string + ContentSrcMedium string + ContentSrcSmall string + ContentType string + Data []byte + Description string + ExpiresAt Time + FileName string + FileSize int + URL ResourceURL + func (a Attachment) MarshalJSON() ([]byte, error) + type AttachmentService struct + func (s *AttachmentService) Delete(ctx context.Context, id int64) (*Response, error) + func (s *AttachmentService) Get(ctx context.Context, id int64) (*Attachment, *Response, error) + func (s *AttachmentService) GetURL(ctx context.Context, ref ResourceURL) (*Attachment, *Response, error) + func (s *AttachmentService) Meta() ResourceMeta + type BalanceSheet struct + AccountingPeriodStartDate Date + AsAtDate Date + CapitalAssets *BalanceSheetCapitalAssets + Currency string + CurrentAssets *BalanceSheetSection + CurrentLiabilities *BalanceSheetSection + NetCurrentAssets *Decimal + OwnersEquity *BalanceSheetEquity + TotalAssets *Decimal + TotalOwnersEquity *Decimal + type BalanceSheetAccount struct + Name string + NominalCode string + TotalDebit *Decimal + type BalanceSheetCapitalAssets struct + NetBookValue *Decimal + type BalanceSheetEquity struct + RetainedProfit *Decimal + type BalanceSheetSection struct + Accounts []BalanceSheetAccount + type BankAccount struct + AccountNumber string + BIC string + BankCode string + BankGuessEnabled *bool + BankName string + CreatedAt Time + Currency string + CurrentBalance *Decimal + Email string + IBAN string + IsPersonal *bool + IsPrimary *bool + LatestActivityDate Date + ManuallyAddedTransactionCount *int + MarkedForReviewCount *int + Name string + OpeningBalance *Decimal + SecondarySortCode string + SortCode string + Status string + TotalCount *int + Type string + URL ResourceURL + UnexplainedTransactionCount *int + UpdatedAt Time + type BankAccountService struct + type BankFeed struct + BankAccount ResourceURL + BankServiceName string + CreatedAt Time + FeedType string + SCAExpiresAt Time + State string + URL ResourceURL + UpdatedAt Time + type BankFeedService struct + type BankTransaction struct + Amount *Decimal + BankAccount ResourceURL + BankTransactionExplanations []BankTransactionExplanation + CreatedAt Time + DatedOn Date + Description string + FullDescription string + IsManual *bool + MatchingTransactionsCount *int + TransactionID string + URL ResourceURL + UnexplainedAmount *Decimal + UpdatedAt Time + UploadedAt Time + type BankTransactionExplanation struct + Attachment *Attachment + BankAccount ResourceURL + BankTransaction ResourceURL + CapitalAsset ResourceURL + Category ResourceURL + ChequeNumber string + DatedOn Date + Description string + DirectContact ResourceURL + DisposedAsset ResourceURL + ECStatus string + ForeignCurrencyValue *Decimal + GrossValue *Decimal + IsDeletable *bool + IsLocked *bool + IsMoneyIn *bool + IsMoneyOut *bool + IsMoneyPaidToUser *bool + LinkedTransferAccount ResourceURL + LinkedTransferExplanation ResourceURL + LockedAttributes []string + LockedReason string + MarkedForReview *bool + PaidBill ResourceURL + PaidInvoice ResourceURL + PaidUser ResourceURL + PlaceOfSupply string + Project ResourceURL + Property ResourceURL + RebillFactor *Decimal + RebillType string + ReceiptReference string + SalesTaxRate *Decimal + SalesTaxStatus string + SalesTaxValue *Decimal + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + SecondSalesTaxValue *Decimal + StockAlteringQuantity *int + StockItem ResourceURL + TransferBankAccount ResourceURL + Type string + URL ResourceURL + UpdatedAt Time + type BankTransactionExplanationService struct + func (s *BankTransactionExplanationService) All(context.Context, *ListOptions) iter.Seq2[BankTransactionExplanation, error] + func (s *BankTransactionExplanationService) AllForAccount(ctx context.Context, account ResourceURL, opts *ListOptions) iter.Seq2[BankTransactionExplanation, error] + func (s *BankTransactionExplanationService) List(context.Context, *ListOptions) ([]BankTransactionExplanation, *Response, error) + func (s *BankTransactionExplanationService) ListForAccount(ctx context.Context, account ResourceURL, opts *ListOptions) ([]BankTransactionExplanation, *Response, error) + type BankTransactionService struct + func (s *BankTransactionService) All(context.Context, *ListOptions) iter.Seq2[BankTransaction, error] + func (s *BankTransactionService) AllForAccount(ctx context.Context, account ResourceURL, opts *ListOptions) iter.Seq2[BankTransaction, error] + func (s *BankTransactionService) List(context.Context, *ListOptions) ([]BankTransaction, *Response, error) + func (s *BankTransactionService) ListForAccount(ctx context.Context, account ResourceURL, opts *ListOptions) ([]BankTransaction, *Response, error) + func (s *BankTransactionService) UploadStatement(ctx context.Context, account ResourceURL, lines []StatementLine) (*Response, error) + type Bill struct + Attachment *Attachment + BillItems []BillItem + CISDeduction *Decimal + CISDeductionBand string + CISDeductionRate *Decimal + CISDeductionSuffered *Decimal + Comments string + Contact ResourceURL + CreatedAt Time + Currency string + DatedOn Date + DueOn Date + DueValue *Decimal + ECStatus string + ExchangeRate *Decimal + InputTotalValuesIncTax *bool + IsPaidByHirePurchase *bool + LongStatus string + NativeDueValue *Decimal + NetValue *Decimal + PaidOn Date + Project ResourceURL + Property ResourceURL + RebillFactor *Decimal + RebillToProject ResourceURL + RebillType string + Recurring string + RecurringEndDate Date + Reference string + SalesTaxValue *Decimal + SecondSalesTaxValue *Decimal + Status string + TotalValue *Decimal + URL ResourceURL + UpdatedAt Time + type BillItem struct + Bill ResourceURL + CISDeductionRate *Decimal + CapitalAsset ResourceURL + Category ResourceURL + Description string + Destroy *int + ManualSalesTaxAmount *Decimal + Project ResourceURL + Quantity *Decimal + SalesTaxRate *Decimal + SalesTaxStatus string + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + StockAlteringQuantity *Decimal + StockItem ResourceURL + StockItemDescription string + TotalValue *Decimal + TotalValueExTax *Decimal + URL ResourceURL + Unit string + type BillService struct + type CISBand struct + DeductionDescription string + DeductionRate *Decimal + IncomeDescription string + Name string + NominalCode string + type CISBandService struct + func (s *CISBandService) List(ctx context.Context) ([]CISBand, *Response, error) + func (s *CISBandService) Meta() ResourceMeta + type CapitalAsset struct + AssetLifeYears *int + AssetType string + CapitalAssetHistory []CapitalAssetHistoryEntry + CreatedAt Time + DepreciationProfile *DepreciationProfile + Description string + DisposedOn Date + PurchasedOn Date + URL ResourceURL + UpdatedAt Time + type CapitalAssetHistoryEntry struct + Date Date + Description string + Link ResourceURL + TaxValue *Decimal + Type string + Value *Decimal + type CapitalAssetService struct + func (s *CapitalAssetService) GetWithHistory(ctx context.Context, id int64) (*CapitalAsset, *Response, error) + func (s *CapitalAssetService) ListWithHistory(ctx context.Context, opts *ListOptions) ([]CapitalAsset, *Response, error) + type CapitalAssetType struct + CreatedAt Time + Name string + SystemDefault *bool + URL ResourceURL + UpdatedAt Time + type CapitalAssetTypeService struct + type Cashflow struct + Balance *Decimal + From Date + Incoming *CashflowSection + Outgoing *CashflowSection + To Date + type CashflowMonth struct + Month int + Total *Decimal + Year int + type CashflowSection struct + Months []CashflowMonth + Total *Decimal + type Category struct + AllowableForTax *bool + AutoSalesTaxRate string + BankAccount ResourceURL + CapitalAssetType ResourceURL + CategoryGroup string + Description string + Group string + GroupDescription string + HirePurchase ResourceURL + NominalCode string + StockItem ResourceURL + TaxReportingName string + URL ResourceURL + User ResourceURL + type CategoryGroups struct + AdminExpenses []Category + CostOfSales []Category + General []Category + Income []Category + func (g *CategoryGroups) Flatten() []Category + type CategoryService struct + func (s *CategoryService) Create(ctx context.Context, in *Category) (*Category, *Response, error) + func (s *CategoryService) Delete(ctx context.Context, nominalCode string) (*Response, error) + func (s *CategoryService) Get(ctx context.Context, nominalCode string) (*Category, *Response, error) + func (s *CategoryService) List(ctx context.Context, subAccounts bool) (*CategoryGroups, *Response, error) + func (s *CategoryService) Meta() ResourceMeta + func (s *CategoryService) Update(ctx context.Context, nominalCode string, in *Category) (*Category, *Response, error) + type Client struct + func NewClient(opts ...Option) (*Client, error) + func (c *Client) BaseURL() *url.URL + func (c *Client) Raw(ctx context.Context, method, path string, query url.Values, body any) ([]byte, *Response, error) + func (c *Client) RawURL(ctx context.Context, method string, ref ResourceURL, query url.Values, ...) ([]byte, *Response, error) + type Collection struct + func (c *Collection[T]) Create(ctx context.Context, in *T) (*T, *Response, error) + func (c *Collection[T]) Delete(ctx context.Context, id int64) (*Response, error) + func (c *Collection[T]) Update(ctx context.Context, id int64, in *T) (*T, *Response, error) + type Company struct + Address1 string + Address2 string + Address3 string + AnnualAccountingPeriods []AccountingPeriod + BusinessCategory string + BusinessType string + CISContractor *bool + CISEnabled *bool + CISSubcontractor *bool + CompanyRegistrationNumber string + CompanyStartDate Date + ContactEmail string + ContactPhone string + Country string + CreatedAt Time + Currency string + ECVATReportingEnabled *bool + FirstAccountingYearEnd Date + FreeAgentStartDate Date + ID Int64 + InitialVATBasis string + InitialVATFRSType string + InitiallyOnFRS *bool + Locale string + LockedAttributes []string + MileageUnits string + Name string + Postcode string + Region string + SalesTaxDeregistrationEffectiveDate Date + SalesTaxEffectiveDate Date + SalesTaxIsValueAdded *bool + SalesTaxName string + SalesTaxRates []Decimal + SalesTaxRegistrationNumber string + SalesTaxRegistrationStatus string + SecondSalesTaxIsCompound *bool + SecondSalesTaxName string + SecondSalesTaxRates []Decimal + ShortDateFormat string + Subdomain string + SupportsAutoSalesTaxOnPurchases *bool + Town string + TradingStartDate Date + Type string + URL ResourceURL + UpdatedAt Time + VATFirstReturnPeriodEndsOn Date + Website string + type CompanyService struct + func (s *CompanyService) BusinessCategories(ctx context.Context) ([]string, *Response, error) + func (s *CompanyService) TaxTimeline(ctx context.Context) ([]TaxTimelineItem, *Response, error) + type Contact struct + AccountBalance *Decimal + ActiveProjectsCount Int64 + Address1 string + Address2 string + Address3 string + BillingEmail string + CISDeductionRate string + ChargeSalesTax string + ContactNameOnInvoices *bool + Country string + CreatedAt Time + DefaultPaymentTermsInDays *int + DirectDebitMandateState string + Email string + FirstName string + IsCISSubcontractor *bool + LastName string + Locale string + Mobile string + OrganisationName string + PhoneNumber string + Postcode string + Region string + SalesTaxRegistrationNumber string + Status string + SubcontractorVerificationNumber string + Town string + URL ResourceURL + UniqueTaxReference string + UpdatedAt Time + UsesContactInvoiceSequence *bool + type ContactService struct + type CorporationTaxReturn struct + AmountDue *Decimal + FiledAt Time + FiledReference string + FilingDueOn Date + FilingStatus string + PaymentDueOn Date + PaymentStatus string + PeriodEndsOn Date + PeriodStartsOn Date + URL ResourceURL + type CorporationTaxReturnService struct + func (s *CorporationTaxReturnService) Get(ctx context.Context, periodEndsOn Date) (*CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) List(ctx context.Context) ([]CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) MarkAsFiled(ctx context.Context, periodEndsOn Date) (*CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) MarkAsPaid(ctx context.Context, periodEndsOn Date) (*CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) MarkAsUnfiled(ctx context.Context, periodEndsOn Date) (*CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) MarkAsUnpaid(ctx context.Context, periodEndsOn Date) (*CorporationTaxReturn, *Response, error) + func (s *CorporationTaxReturnService) Meta() ResourceMeta + type CreditNote struct + BankAccount ResourceURL + CISDeduction *Decimal + CISDeductionRate *Decimal + CISDeductionSuffered *Decimal + CISRate string + ClientContactName string + Comments string + Contact ResourceURL + CreatedAt Time + CreditNoteItems []CreditNoteItem + Currency string + DatedOn Date + DiscountPercent *Decimal + DueOn Date + DueValue *Decimal + ECStatus string + ExchangeRate *Decimal + InvolvesSalesTax *bool + IsInterimUKVAT *bool + LongStatus string + NetValue *Decimal + OmitHeader *bool + POReference string + PaymentTerms string + PaymentTermsInDays *int + PlaceOfSupply string + Project ResourceURL + Property ResourceURL + Reference string + RefundedOn Date + RefundedValue *Decimal + SalesTaxValue *Decimal + SecondSalesTaxValue *Decimal + ShowProjectName *bool + Status string + TotalValue *Decimal + URL ResourceURL + UpdatedAt Time + WrittenOffDate Date + type CreditNoteItem struct + Category ResourceURL + Description string + Destroy *int + ID *int64 + ItemType string + Position *Decimal + Price *Decimal + Project ResourceURL + Quantity *Decimal + SalesTaxRate *Decimal + SalesTaxStatus string + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + StockItem ResourceURL + URL ResourceURL + type CreditNoteReconciliation struct + CreatedAt Time + CreditNote ResourceURL + Currency string + DatedOn Date + ExchangeRate *Decimal + GrossValue *Decimal + Invoice ResourceURL + URL ResourceURL + UpdatedAt Time + type CreditNoteReconciliationService struct + type CreditNoteService struct + func (s *CreditNoteService) MarkAsDraft(ctx context.Context, id int64) (*CreditNote, *Response, error) + func (s *CreditNoteService) MarkAsSent(ctx context.Context, id int64) (*CreditNote, *Response, error) + func (s *CreditNoteService) PDF(ctx context.Context, id int64) (*PDF, *Response, error) + func (s *CreditNoteService) SendEmail(ctx context.Context, id int64, opts *EmailOptions) (*Response, error) + type Date struct + func DateOf(t time.Time) Date + func NewDate(year int, month time.Month, day int) Date + func ParseDate(s string) (Date, error) + func (d *Date) UnmarshalJSON(b []byte) error + func (d Date) MarshalJSON() ([]byte, error) + func (d Date) String() string + type Decimal = decimal.Decimal + type DepreciationProfile struct + AnnualDepreciationPercentage *int + AssetLifeYears *int + Frequency string + Method string + type ECMossRate struct + Band string + Percentage *Decimal + type ECMossRates struct + ECTaxName string + Rates []ECMossRate + type EmailAddressService struct + func (s *EmailAddressService) List(ctx context.Context) ([]string, *Response, error) + func (s *EmailAddressService) Meta() ResourceMeta + type EmailOptions struct + Body string + EmailToSelf bool + From string + Subject string + To string + type Environment struct + AuthorizeURL string + BaseURL string + Name string + TokenURL string + func EnvironmentByName(name string) (Environment, error) + func (e Environment) OAuthConfig(clientID, clientSecret, redirectURL string) *oauth2.Config + type Estimate struct + ClientContactName string + Contact ResourceURL + CreatedAt Time + Currency string + DatedOn Date + DiscountPercent *Decimal + ECStatus string + EstimateItems []EstimateItem + EstimateType string + IncludeSalesTaxOnTotalValue *bool + NetValue *Decimal + Notes string + PlaceOfSupply string + Project ResourceURL + Reference string + SalesTaxValue *Decimal + Status string + URL ResourceURL + UpdatedAt Time + type EstimateItem struct + Category ResourceURL + CreatedAt Time + Description string + ItemType string + Position *int + Price *Decimal + Quantity *Decimal + SalesTaxRate *Decimal + SalesTaxStatus string + SalesTaxValue *Decimal + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + SecondSalesTaxValue *Decimal + URL ResourceURL + UpdatedAt Time + type EstimateService struct + func (s *EstimateService) ConvertToInvoice(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) Duplicate(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) MarkAsApproved(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) MarkAsDraft(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) MarkAsRejected(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) MarkAsSent(ctx context.Context, id int64) (*Estimate, *Response, error) + func (s *EstimateService) PDF(ctx context.Context, id int64) (*PDF, *Response, error) + func (s *EstimateService) SendEmail(ctx context.Context, id int64, opts *EmailOptions) (*Response, error) + type Expense struct + Attachment *Attachment + CapitalAsset ResourceURL + Category ResourceURL + CreatedAt Time + Currency string + DatedOn Date + Description string + ECStatus string + EngineSize string + EngineType string + GrossValue *Decimal + HaveVATReceipt *bool + InitialRateMileage *Decimal + ManualSalesTaxAmount *Decimal + Mileage *Decimal + NativeGrossValue *Decimal + NativeSalesTaxValue *Decimal + NextRecursOn Date + Project ResourceURL + Property ResourceURL + RebillFactor *Decimal + RebillMileageRate *Decimal + RebillToProject ResourceURL + RebillType string + RebilledOnInvoice ResourceURL + ReceiptReference string + ReclaimMileage *int + ReclaimMileageRate *Decimal + Recurring string + RecurringEndDate Date + SalesTaxRate *Decimal + SalesTaxStatus string + SalesTaxValue *Decimal + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + StockAlteringQuantity *Decimal + StockItem ResourceURL + StockItemDescription string + URL ResourceURL + UpdatedAt Time + User ResourceURL + VehicleType string + type ExpenseService struct + func (s *ExpenseService) MileageSettings(ctx context.Context) (*MileageSettings, *Response, error) + type FieldError struct + Field string + Message string + func (f FieldError) String() string + type FileStore struct + func NewFileStore(path, key string) (*FileStore, error) + func (f *FileStore) Load(context.Context) (*oauth2.Token, error) + func (f *FileStore) Path() string + func (f *FileStore) Save(_ context.Context, token *oauth2.Token) error + type FilingPayment struct + AmountDue *Decimal + DueOn Date + Label string + Status string + type FinalAccountsReport struct + FiledAt Time + FiledReference string + FilingDueOn Date + FilingStatus string + PeriodEndsOn Date + PeriodStartsOn Date + URL ResourceURL + type FinalAccountsReportService struct + func (s *FinalAccountsReportService) Get(ctx context.Context, periodEndsOn Date) (*FinalAccountsReport, *Response, error) + func (s *FinalAccountsReportService) List(ctx context.Context) ([]FinalAccountsReport, *Response, error) + func (s *FinalAccountsReportService) MarkAsFiled(ctx context.Context, periodEndsOn Date) (*FinalAccountsReport, *Response, error) + func (s *FinalAccountsReportService) MarkAsUnfiled(ctx context.Context, periodEndsOn Date) (*FinalAccountsReport, *Response, error) + func (s *FinalAccountsReportService) Meta() ResourceMeta + type HirePurchase struct + Bill ResourceURL + Description string + LiabilitiesOverOneYearCategory ResourceURL + LiabilitiesUnderOneYearCategory ResourceURL + URL ResourceURL + type HirePurchaseService struct + type IncomeTaxReturn struct + FiledAt Time + FiledReference string + FilingDueOn Date + FilingStatus string + Payments []FilingPayment + PeriodEndsOn Date + PeriodStartsOn Date + URL ResourceURL + type IncomeTaxReturnService struct + func (s *IncomeTaxReturnService) GetForUser(ctx context.Context, user ResourceURL, periodEndsOn Date) (*IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) ListForUser(ctx context.Context, user ResourceURL) ([]IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) MarkAsFiled(ctx context.Context, user ResourceURL, periodEndsOn Date) (*IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) MarkAsUnfiled(ctx context.Context, user ResourceURL, periodEndsOn Date) (*IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) MarkPaymentAsPaid(ctx context.Context, user ResourceURL, periodEndsOn, paymentDate Date) (*IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) MarkPaymentAsUnpaid(ctx context.Context, user ResourceURL, periodEndsOn, paymentDate Date) (*IncomeTaxReturn, *Response, error) + func (s *IncomeTaxReturnService) Meta() ResourceMeta + type Int64 int64 + func Int64Of(v int64) Int64 + func (n *Int64) UnmarshalJSON(b []byte) error + func (n Int64) MarshalJSON() ([]byte, error) + func (n Int64) Value() int64 + type Invoice struct + AlwaysShowBICAndIBAN *bool + BankAccount ResourceURL + CISDeduction *Decimal + CISDeductionRate *Decimal + CISDeductionSuffered *Decimal + CISRate string + ClientContactName string + Comments string + Contact ResourceURL + ContactName string + CreatedAt Time + Currency string + DatedOn Date + DiscountPercent *Decimal + DueOn Date + DueValue *Decimal + ECStatus string + ExchangeRate *Decimal + IncludeEstimates string + IncludeExpenses string + IncludeTimeslips string + InvoiceItems []InvoiceItem + InvolvesSalesTax *bool + IsInterimUKVAT *bool + LongStatus string + NetValue *Decimal + OmitHeader *bool + POReference string + PaidOn Date + PaidValue *Decimal + PaymentMethods *InvoicePaymentMethods + PaymentTerms string + PaymentTermsInDays *int + PaymentURL string + PlaceOfSupply string + Project ResourceURL + Property ResourceURL + RecurringInvoice ResourceURL + Reference string + SalesTaxValue *Decimal + SecondSalesTaxValue *Decimal + SendNewInvoiceEmails *bool + SendReminderEmails *bool + SendThankYouEmails *bool + ShowProjectName *bool + Status string + TotalValue *Decimal + URL ResourceURL + UpdatedAt Time + WrittenOffDate Date + type InvoiceItem struct + Category ResourceURL + Description string + Destroy *int + ID *int64 + ItemType string + Position *Decimal + Price *Decimal + Project ResourceURL + Quantity *Decimal + SalesTaxRate *Decimal + SalesTaxStatus string + SecondSalesTaxRate *Decimal + SecondSalesTaxStatus string + StockItem ResourceURL + URL ResourceURL + type InvoicePaymentMethods struct + GoCardlessInstantBankPay bool + GoCardlessPreauth bool + PayPal bool + Stripe bool + Tyl bool + type InvoiceService struct + func (s *InvoiceService) ConvertToCreditNote(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) Duplicate(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) MarkAsCancelled(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) MarkAsDraft(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) MarkAsScheduled(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) MarkAsSent(ctx context.Context, id int64) (*Invoice, *Response, error) + func (s *InvoiceService) PDF(ctx context.Context, id int64) (*PDF, *Response, error) + func (s *InvoiceService) SendEmail(ctx context.Context, id int64, opts *EmailOptions) (*Response, error) + type JournalEntry struct + BankAccount ResourceURL + CapitalAssetType ResourceURL + Category ResourceURL + Contact ResourceURL + DebitValue *Decimal + Description string + Destroy *bool + Property ResourceURL + StockAlteringQuantity *int + StockItem ResourceURL + URL ResourceURL + User ResourceURL + type JournalSet struct + BankAccounts []JournalSetBalance + DatedOn Date + Description string + JournalEntries []JournalEntry + StockItems []JournalSetBalance + Tag string + URL ResourceURL + UpdatedAt Time + type JournalSetBalance struct + DebitValue *Decimal + Description string + URL ResourceURL + type JournalSetService struct + func (s *JournalSetService) OpeningBalances(ctx context.Context) (*JournalSet, *Response, error) + type ListOptions struct + Extra url.Values + FromDate Date + Page int + PerPage int + Sort string + ToDate Date + UpdatedSince Time + View string + func (o *ListOptions) Values() (url.Values, error) + type MemoryStore struct + func NewMemoryStore(token *oauth2.Token) *MemoryStore + func (m *MemoryStore) Load(context.Context) (*oauth2.Token, error) + func (m *MemoryStore) Save(_ context.Context, token *oauth2.Token) error + type MileagePeriod struct + From Date + To Date + Value T + func (p MileagePeriod[T]) RatesFor(vehicleType string) (MileageRate, bool) + type MileageRate struct + AdditionalRate *Decimal + BasicRate *Decimal + type MileageSettings struct + EngineTypeAndSizeOptions []MileagePeriod[map[string][]string] + MileageRates []MileagePeriod[map[string]json.RawMessage] + type Note struct + Author string + CreatedAt Time + Note string + ParentURL ResourceURL + URL ResourceURL + UpdatedAt Time + type NoteService struct + func (s *NoteService) All(context.Context, *ListOptions) iter.Seq2[Note, error] + func (s *NoteService) AllForParent(ctx context.Context, parent ResourceURL, opts *ListOptions) iter.Seq2[Note, error] + func (s *NoteService) Create(context.Context, *Note) (*Note, *Response, error) + func (s *NoteService) CreateForParent(ctx context.Context, parent ResourceURL, in *Note) (*Note, *Response, error) + func (s *NoteService) List(context.Context, *ListOptions) ([]Note, *Response, error) + func (s *NoteService) ListForParent(ctx context.Context, parent ResourceURL, opts *ListOptions) ([]Note, *Response, error) + type Option func(*Client) error + func WithAPIVersion(v string) Option + func WithBaseURL(raw string) Option + func WithHTTPClient(h *http.Client) Option + func WithMaxResponseBytes(n int64) Option + func WithRateLimitTest(on bool) Option + func WithRateLimits(perMinute, perHour int) Option + func WithReadOnly() Option + func WithRetryPolicy(p RetryPolicy) Option + func WithSandbox() Option + func WithTokenSource(ts oauth2.TokenSource) Option + func WithUserAgent(ua string) Option + func WithoutAuth() Option + func WithoutRateLimit() Option + func WithoutRetry() Option + type PDF struct + Content string + func (p *PDF) Bytes() ([]byte, error) + type PayrollPeriod struct + ConstructionIndustrySchemeDeduction *Decimal + CreatedAt Time + DatedOn Date + EmploymentAllowanceAmount *Decimal + EmploymentAllowanceClaimed *bool + Frequency string + Payslips []Payslip + Period *int + Status string + URL ResourceURL + UpdatedAt Time + type PayrollProfile struct + AddressLine1 string + AddressLine2 string + AddressLine3 string + AddressLine4 string + Country string + CreatedAt Time + DateOfBirth Date + EmploymentEndsOn Date + EmploymentStartsOn Date + Gender string + PayrollReference string + Postcode string + Title string + TotalPayInPreviousEmployment *Decimal + TotalTaxInPreviousEmployment *Decimal + UpdatedAt Time + User ResourceURL + type PayrollProfileService struct + func (s *PayrollProfileService) Meta() ResourceMeta + func (s *PayrollProfileService) Year(ctx context.Context, year int, user ResourceURL) ([]PayrollProfile, *Response, error) + type PayrollService struct + func (s *PayrollService) MarkPaymentAsPaid(ctx context.Context, year int, paymentDate Date) (*Response, error) + func (s *PayrollService) MarkPaymentAsUnpaid(ctx context.Context, year int, paymentDate Date) (*Response, error) + func (s *PayrollService) Meta() ResourceMeta + func (s *PayrollService) Payslips(ctx context.Context, year, period int) ([]Payslip, *Response, error) + func (s *PayrollService) Period(ctx context.Context, year, period int) (*PayrollPeriod, *Response, error) + func (s *PayrollService) Year(ctx context.Context, year int) (*PayrollYear, *Response, error) + type PayrollYear struct + Payments []FilingPayment + Periods []PayrollPeriod + type Payslip struct + AbsencePayments *Decimal + AdditionalStatutoryPaternityPay *Decimal + Allowance *Decimal + Attachments *Decimal + BasicPay *Decimal + Bonus *Decimal + Commission *Decimal + CreatedAt Time + DatedOn Date + DeductPostgradLoan *bool + DeductStudentLoan *bool + DeductionFreePay *Decimal + DeductionsSubjectToNICButNotPAYE *Decimal + EmployeeNI *Decimal + EmployeePension *Decimal + EmployeePensionNotUnderNetPay *Decimal + EmployeePensionSalarySacrifice *Decimal + EmployerNI *Decimal + EmployerPension *Decimal + Frequency string + HoursWorked *Decimal + LeavingPayslip *bool + NICalcType string + NILetter string + OtherDeductions *Decimal + OtherDeductionsFromNetPay *Decimal + OtherPayments *Decimal + OtherSalarySacrificeDeductions *Decimal + Overtime *Decimal + PayrollGiving *Decimal + PostgradLoanDeduction *Decimal + StatutoryAdoptionPay *Decimal + StatutoryMaternityPay *Decimal + StatutoryNeonatalCarePay *Decimal + StatutoryParentalBereavementPay *Decimal + StatutoryParentalBereavementPayNIreland *Decimal + StatutoryPaternityPay *Decimal + StatutorySickPay *Decimal + StudentLoanDeduction *Decimal + StudentLoanDeductionPlan string + TaxCode string + TaxDeducted *Decimal + UpdatedAt Time + User ResourceURL + Week1Month1Basis *bool + type PriceListItem struct + Category ResourceURL + Code string + CreatedAt Time + Description string + ItemType string + Price *Decimal + Quantity *Decimal + SalesTaxRate *Decimal + SecondSalesTaxRate *Decimal + StockItem ResourceURL + URL ResourceURL + UpdatedAt Time + VATStatus string + type PriceListItemService struct + type ProfitAndLoss struct + Expenses *Decimal + From Date + Income *Decimal + Less []ProfitAndLossRow + OperatingProfit *Decimal + RetainedProfit *Decimal + RetainedProfitBroughtForward *Decimal + RetainedProfitCarriedForward *Decimal + To Date + type ProfitAndLossRow struct + Title string + Total *Decimal + type Project struct + BillingPeriod string + Budget *Decimal + BudgetUnits string + Contact ResourceURL + ContactName string + ContractPOReference string + CreatedAt Time + Currency string + EndsOn Date + HoursPerDay *Decimal + IncludeUnbilledTimeInProfitability *bool + IsDeletable *bool + IsIR35 *bool + Name string + NormalBillingRate *Decimal + StartsOn Date + Status string + URL ResourceURL + UpdatedAt Time + UsesProjectInvoiceSequence *bool + type ProjectService struct + type Property struct + Address1 string + Address2 string + Address3 string + Country string + Name string + Postcode string + Region string + Town string + URL ResourceURL + type PropertyService struct + type RateLimit struct + Limit int + Remaining int + Reset time.Time + type ReadCollection struct + func (c *ReadCollection[T]) All(ctx context.Context, opts *ListOptions) iter.Seq2[T, error] + func (c *ReadCollection[T]) Get(ctx context.Context, id int64) (*T, *Response, error) + func (c *ReadCollection[T]) GetURL(ctx context.Context, ref ResourceURL) (*T, *Response, error) + func (c *ReadCollection[T]) List(ctx context.Context, opts *ListOptions) ([]T, *Response, error) + func (c *ReadCollection[T]) Meta() ResourceMeta + type Reader struct + func (r *Reader[T]) Get(ctx context.Context, params url.Values) (*T, *Response, error) + func (r *Reader[T]) Meta() ResourceMeta + type RecurringInvoice struct + AlwaysShowBICAndIBAN *bool + Contact ResourceURL + ContactName string + Currency string + DatedOn Date + ExchangeRate *Decimal + Frequency string + InvoiceItems []InvoiceItem + NetValue *Decimal + NextRecursOn Date + OmitHeader *bool + PaymentMethods *InvoicePaymentMethods + PaymentTermsInDays *int + RecurringEndDate Date + RecurringStatus string + Reference string + SalesTaxValue *Decimal + TotalValue *Decimal + URL ResourceURL + type RecurringInvoiceService struct + type ReportOptions struct + AccountingPeriod string + Extra url.Values + FromDate Date + ToDate Date + type ReportService struct + func (s *ReportService) BalanceSheet(ctx context.Context, opts *ReportOptions) (*BalanceSheet, *Response, error) + func (s *ReportService) Cashflow(ctx context.Context, from, to Date) (*Cashflow, *Response, error) + func (s *ReportService) ProfitAndLoss(ctx context.Context, opts *ReportOptions) (*ProfitAndLoss, *Response, error) + func (s *ReportService) TrialBalance(ctx context.Context, opts *ReportOptions) ([]TrialBalanceEntry, *Response, error) + type ResourceMeta struct + CustomEnvelope bool + Doc string + Grouped bool + Name string + NoList bool + Path string + Plural string + ReadOnly bool + RequiresBankAccount bool + Singleton bool + Singular string + func LookupResource(name string) (ResourceMeta, bool) + type ResourceURL string + func (r ResourceURL) ID() (int64, error) + func (r ResourceURL) IsZero() bool + func (r ResourceURL) Kind() string + func (r ResourceURL) String() string + type Response struct + FirstPage int + LastPage int + NextPage int + PrevPage int + RateLimit RateLimit + TotalCount int + type RetryPolicy struct + BaseDelay time.Duration + MaxAttempts int + MaxDelay time.Duration + MaxRetryAfter time.Duration + type SalesTaxPeriod struct + EffectiveDate Date + IsLocked *bool + LockedReason string + SalesTaxIsValueAdded *bool + SalesTaxName string + SalesTaxRate1 *Decimal + SalesTaxRate2 *Decimal + SalesTaxRate3 *Decimal + SalesTaxRegistrationNumber string + SalesTaxRegistrationStatus string + SecondSalesTaxIsCompound *bool + SecondSalesTaxName string + SecondSalesTaxRate1 *Decimal + SecondSalesTaxRate2 *Decimal + SecondSalesTaxRate3 *Decimal + URL ResourceURL + type SalesTaxPeriodService struct + type SalesTaxService struct + func (s *SalesTaxService) ECMossRates(ctx context.Context, country string, on Date) (*ECMossRates, *Response, error) + type StatementLine struct + Amount Decimal + DatedOn Date + Description string + FitID string + func (l StatementLine) MarshalJSON() ([]byte, error) + type StockItem struct + CostOfSaleCategory ResourceURL + CreatedAt Time + Description string + OpeningBalance *Decimal + OpeningQuantity *Decimal + StockOnHand *Decimal + URL ResourceURL + UpdatedAt Time + type StockItemService struct + type Task struct + BillingPeriod string + BillingRate *Decimal + CreatedAt Time + Currency string + IsBillable *bool + IsDeletable *bool + Name string + Project ResourceURL + Status string + URL ResourceURL + UpdatedAt Time + type TaskService struct + func (s *TaskService) Create(context.Context, *Task) (*Task, *Response, error) + func (s *TaskService) CreateForProject(ctx context.Context, project ResourceURL, in *Task) (*Task, *Response, error) + type TaxTimelineItem struct + AmountDue *Decimal + DatedOn Date + Description string + IsPersonal *bool + Nature string + type Time struct + func ParseTime(s string) (Time, error) + func TimeOf(t time.Time) Time + func (t *Time) UnmarshalJSON(b []byte) error + func (t Time) MarshalJSON() ([]byte, error) + func (t Time) String() string + type Timeslip struct + BilledOnInvoice ResourceURL + Comment string + CreatedAt Time + DatedOn Date + Hours *Decimal + Project ResourceURL + Task ResourceURL + Timer *TimeslipTimer + URL ResourceURL + UpdatedAt Time + User ResourceURL + type TimeslipService struct + func (s *TimeslipService) StartTimer(ctx context.Context, id int64) (*Timeslip, *Response, error) + func (s *TimeslipService) StopTimer(ctx context.Context, id int64) (*Timeslip, *Response, error) + type TimeslipTimer struct + Running *bool + StartFrom Time + type TokenSource struct + func NewTokenSource(ctx context.Context, cfg *oauth2.Config, store TokenStore) (*TokenSource, error) + func (s *TokenSource) AuthCodeURL(state string) string + func (s *TokenSource) Exchange(ctx context.Context, code string) (*oauth2.Token, error) + func (s *TokenSource) Peek() (*oauth2.Token, error) + func (s *TokenSource) Token() (*oauth2.Token, error) + type TokenStore interface + Load func(ctx context.Context) (*oauth2.Token, error) + Save func(ctx context.Context, token *oauth2.Token) error + type Transaction struct + Category ResourceURL + CategoryName string + CreatedAt Time + DatedOn Date + DebitValue *Decimal + Description string + ForeignCurrencyData *TransactionForeignCurrency + NominalCode string + SourceItemURL ResourceURL + URL ResourceURL + UpdatedAt Time + type TransactionForeignCurrency struct + CurrencyCode string + DebitValue *Decimal + type TransactionService struct + type TrialBalanceEntry struct + BankAccount ResourceURL + Category ResourceURL + DisplayNominalCode string + Name string + NominalCode string + StockItem ResourceURL + Total *Decimal + User ResourceURL + type User struct + CreatedAt Time + CurrentPayrollProfile *UserPayrollProfile + Email string + FirstName string + Hidden *bool + LastName string + NINumber string + OpeningMileage *Decimal + PermissionLevel *int + Role string + SendInvitation *bool + URL ResourceURL + UniqueTaxReference string + UpdatedAt Time + type UserPayrollProfile struct + TotalPayInPreviousEmployment *Decimal + TotalTaxInPreviousEmployment *Decimal + type UserService struct + func (s *UserService) Me(ctx context.Context) (*User, *Response, error) + func (s *UserService) UpdateMe(ctx context.Context, in *User) (*User, *Response, error) + type VATBreakdown struct + Rows []VATBreakdownRow + Title string + type VATBreakdownRow struct + BoxNumber Int64 + Key string + Title string + Value *Decimal + type VATReturn struct + Breakdown *VATBreakdown + FiledAt Time + FiledReference string + FilingDueOn Date + FilingStatus string + Payments []FilingPayment + PeriodEndsOn Date + PeriodStartsOn Date + URL ResourceURL + type VATReturnService struct + func (s *VATReturnService) Get(ctx context.Context, periodEndsOn Date) (*VATReturn, *Response, error) + func (s *VATReturnService) List(ctx context.Context) ([]VATReturn, *Response, error) + func (s *VATReturnService) MarkAsFiled(ctx context.Context, periodEndsOn Date) (*VATReturn, *Response, error) + func (s *VATReturnService) MarkAsUnfiled(ctx context.Context, periodEndsOn Date) (*VATReturn, *Response, error) + func (s *VATReturnService) MarkPaymentAsPaid(ctx context.Context, periodEndsOn, paymentDate Date) (*VATReturn, *Response, error) + func (s *VATReturnService) MarkPaymentAsUnpaid(ctx context.Context, periodEndsOn, paymentDate Date) (*VATReturn, *Response, error) + func (s *VATReturnService) Meta() ResourceMeta