Documentation ¶
Overview ¶
Package exactonline provides a client for using the Exact Online API.
Usage:
import "github.com/mcnijman/go-exactonline"
Note that this library doens't directly handle authentication, see [Authentication](#authentication). We first contstruct a client and then access the various API endpoints.
client := exactonline.NewClient(nil) ctx := context.Background() // Get the last used division divisionID, err := client.GetCurrentDivisionID(ctx) // Fetch all transactions in the division transactions, err := client.FinancialTransaction.Transactions.List(ctx, divisionID, false, nil)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Bool ¶
Bool is a helper routine that allocates a new bool value to store v and returns a pointer to it.
func Date ¶
Date is a helper routine that allocates a new types.Date value to store v and returns a pointer to it.
func Float64 ¶
Float64 is a helper routine that allocates a new float64 value to store v and returns a pointer to it.
func GUID ¶
GUID is a helper routine that allocates a new types.GUID value to store v and returns a pointer to it.
func Int ¶
Int is a helper routine that allocates a new int value to store v and returns a pointer to it.
func Int64 ¶
Int64 is a helper routine that allocates a new int64 value to store v and returns a pointer to it.
Types ¶
type Client ¶
type Client struct { // Services used for talking to different parts of the Exact Online API Budget *budget.BudgetService Bulk *bulk.BulkService ContinuousMonitoring *continuousmonitoring.ContinuousMonitoringService Documents *documents.DocumentsService FinancialTransaction *financialtransaction.FinancialTransactionService General *general.GeneralService Inventory *inventory.InventoryService Accountancy *accountancy.AccountancyService Users *users.UsersService VAT *vat.VATService Workflow *workflow.WorkflowService PurchaseEntry *purchaseentry.PurchaseEntryService Payroll *payroll.PayrollService Purchase *purchase.PurchaseService SalesOrder *salesorder.SalesOrderService Logistics *logistics.LogisticsService CRM *crm.CRMService GeneralJournalEntry *generaljournalentry.GeneralJournalEntryService OpeningBalance *openingbalance.OpeningBalanceService Project *project.ProjectService Webhooks *webhooks.WebhooksService Cashflow *cashflow.CashflowService SalesInvoice *salesinvoice.SalesInvoiceService PurchaseOrder *purchaseorder.PurchaseOrderService Sales *sales.SalesService SalesEntry *salesentry.SalesEntryService Mailbox *mailbox.MailboxService Assets *assets.AssetsService Financial *financial.FinancialService HRM *hrm.HRMService Manufacturing *manufacturing.ManufacturingService Subscription *subscription.SubscriptionService System *system.SystemService Activities *activities.ActivitiesService // contains filtered or unexported fields }
A Client manages communication with the Exact Online API.
func NewClient ¶
NewClient returns a new Exact Online API client. Provide a http.Client that will perform the authentication for you (such as that provided by the golang.org/x/oauth2 library).
func NewClientFromTokenSource ¶
func NewClientFromTokenSource(ctx context.Context, tokenSource oauth2.TokenSource) *Client
NewClientFromTokenSource is a wrapper around NewClient if you have a valid token source. It will create a http.Client from the oauth2.Tokensource. If no context is available you can use context.Background()
func (*Client) GetCurrentDivisionID ¶
GetCurrentDivisionID fetches the last used division id of the user. Other divisions available can be fetched through the `Client.System.Divisions` or `Client.HRM.Divisions` endpoints.
func (*Client) SetBaseURL ¶
SetBaseURL sets the base URL for communicating with the Exact Online API. If the URL does not have a trailing slash, one is added automatically. For each country, the Exact Online solution is deployed on a separate site. Because of this, the Exact Online server URL is country dependent. The Exact Online server URLs are:
- The Netherlands: https://start.exactonline.nl (default)
- Belgium: https://start.exactonline.be
- Germany: https://start.exactonline.de
- United Kingdom: https://start.exactonline.co.uk
- United States of America: https://start.exactonline.com
- Spain: https://start.exactonline.es
Docs: https://support.exactonline.com/community/s/knowledge-base#All-All-DNO-Content-exact-online-sites
func (*Client) SetUserAgent ¶
SetUserAgent sets the useragent provided on every communication with the Exact Online API.