procountor

package module
v0.0.0-...-8b048e2 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	BaseURL = url.URL{
		Scheme: "https",
		Host:   "api.procountor.com",
		Path:   "/api",
	}
)

Functions

func CheckResponse

func CheckResponse(r *http.Response) error

CheckResponse checks the Client response for errors, and returns them if present. A response is considered an error if it has a status code outside the 200 range. Client error responses are expected to have either no response body, or a json response body that maps to ErrorResponse. Any other response body will be silently ignored.

Types

type Address

type Address struct {
	Name        string `json:"name"`
	Specifier   string `json:"specifier"`
	Street      string `json:"street"`
	Zip         string `json:"zip"`
	City        string `json:"city"`
	Country     string `json:"country"`
	Subdivision string `json:"subdivision"`
}

func (Address) IsEmpty

func (a Address) IsEmpty() bool

func (Address) MarshalJSON

func (a Address) MarshalJSON() ([]byte, error)

type BankAccount

type BankAccount struct {
	ID                int    `json:"id,omitempty"`
	AccountNumber     string `json:"accountNumber,omitempty"`
	IBAN              string `json:"iban,omitempty"`
	BIC               string `json:"bic,omitempty"`
	BankName          string `json:"bankName,omitempty"`
	Currency          string `json:"currency,omitempty"`
	DefaultForInvoice bool   `json:"defaultForInvoice,omitempty"`
	DefaultForPayment bool   `json:"defaultForPayment,omitempty"`
	Status            string `json:"status,omitempty"`
	OrderNo           int    `json:"orderNo,omitempty"`
	Version           string `json:"version,omitempty"`
}

func (BankAccount) IsEmpty

func (a BankAccount) IsEmpty() bool

func (BankAccount) MarshalJSON

func (a BankAccount) MarshalJSON() ([]byte, error)

type BankAccounts

type BankAccounts []BankAccount

type BankAccountsGetRequest

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

func (*BankAccountsGetRequest) Do

func (*BankAccountsGetRequest) Method

func (r *BankAccountsGetRequest) Method() string

func (BankAccountsGetRequest) NewPathParams

func (BankAccountsGetRequest) NewQueryParams

func (BankAccountsGetRequest) NewRequestBody

func (*BankAccountsGetRequest) NewResponseBody

func (*BankAccountsGetRequest) PathParams

func (*BankAccountsGetRequest) PathParamsInterface

func (r *BankAccountsGetRequest) PathParamsInterface() PathParams

func (*BankAccountsGetRequest) QueryParams

func (*BankAccountsGetRequest) RequestBody

func (*BankAccountsGetRequest) RequestBodyInterface

func (r *BankAccountsGetRequest) RequestBodyInterface() interface{}

func (*BankAccountsGetRequest) SetMethod

func (r *BankAccountsGetRequest) SetMethod(method string)

func (*BankAccountsGetRequest) SetRequestBody

func (r *BankAccountsGetRequest) SetRequestBody(body BankAccountsGetRequestBody)

func (*BankAccountsGetRequest) URL

func (r *BankAccountsGetRequest) URL() *url.URL

type BankAccountsGetRequestBody

type BankAccountsGetRequestBody struct {
}

type BankAccountsGetRequestPathParams

type BankAccountsGetRequestPathParams struct {
}

func (*BankAccountsGetRequestPathParams) Params

type BankAccountsGetRequestQueryParams

type BankAccountsGetRequestQueryParams struct{}

func (BankAccountsGetRequestQueryParams) ToURLValues

type BankAccountsGetResponseBody

type BankAccountsGetResponseBody struct {
	Results BankAccounts `json:"results"`
	Meta    Meta         `json:"meta"`
}

type BeforeRequestDoCallback

type BeforeRequestDoCallback func(*http.Client, *http.Request, interface{})

type ChartOfAccountsGetRequest

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

func (*ChartOfAccountsGetRequest) Do

func (*ChartOfAccountsGetRequest) Method

func (r *ChartOfAccountsGetRequest) Method() string

func (ChartOfAccountsGetRequest) NewPathParams

func (ChartOfAccountsGetRequest) NewQueryParams

func (ChartOfAccountsGetRequest) NewRequestBody

func (*ChartOfAccountsGetRequest) NewResponseBody

func (*ChartOfAccountsGetRequest) PathParams

func (*ChartOfAccountsGetRequest) PathParamsInterface

func (r *ChartOfAccountsGetRequest) PathParamsInterface() PathParams

func (*ChartOfAccountsGetRequest) QueryParams

func (*ChartOfAccountsGetRequest) RequestBody

func (*ChartOfAccountsGetRequest) RequestBodyInterface

func (r *ChartOfAccountsGetRequest) RequestBodyInterface() interface{}

func (*ChartOfAccountsGetRequest) SetMethod

func (r *ChartOfAccountsGetRequest) SetMethod(method string)

func (*ChartOfAccountsGetRequest) SetRequestBody

func (*ChartOfAccountsGetRequest) URL

func (r *ChartOfAccountsGetRequest) URL() *url.URL

type ChartOfAccountsGetRequestBody

type ChartOfAccountsGetRequestBody struct {
}

type ChartOfAccountsGetRequestPathParams

type ChartOfAccountsGetRequestPathParams struct {
}

func (*ChartOfAccountsGetRequestPathParams) Params

type ChartOfAccountsGetRequestQueryParams

type ChartOfAccountsGetRequestQueryParams struct{}

func (ChartOfAccountsGetRequestQueryParams) ToURLValues

type ChartOfAccountsGetResponseBody

type ChartOfAccountsGetResponseBody struct {
	LedgerAccounts LedgerAccounts `json:"ledgerAccounts"`
}

type Client

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

Client manages communication with Exact Globe Client

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient returns a new Exact Globe Client client

func (Client) BaseURL

func (c Client) BaseURL() url.URL

func (Client) Charset

func (c Client) Charset() string

func (Client) Debug

func (c Client) Debug() bool

func (*Client) Do

func (c *Client) Do(req *http.Request, body interface{}) (*http.Response, error)

Do sends an Client request and returns the Client response. The Client response is json decoded and stored in the value pointed to by v, or returned as an error if an Client error has occurred. If v implements the io.Writer interface, the raw response will be written to v, without attempting to decode it.

func (*Client) GetEndpointURL

func (c *Client) GetEndpointURL(p string, pathParams PathParams) url.URL

func (Client) MediaType

func (c Client) MediaType() string

func (*Client) NewBankAccountsGetRequest

func (c *Client) NewBankAccountsGetRequest() BankAccountsGetRequest

func (*Client) NewChartOfAccountsGetRequest

func (c *Client) NewChartOfAccountsGetRequest() ChartOfAccountsGetRequest

func (*Client) NewCompanyGetRequest

func (c *Client) NewCompanyGetRequest() CompanyGetRequest

func (*Client) NewDimensionsGetRequest

func (c *Client) NewDimensionsGetRequest() DimensionsGetRequest

func (*Client) NewInvoicesGetRequest

func (c *Client) NewInvoicesGetRequest() InvoicesGetRequest

func (*Client) NewInvoicesPostRequest

func (c *Client) NewInvoicesPostRequest() InvoicesPostRequest

func (*Client) NewLedgerReceiptsPostRequest

func (c *Client) NewLedgerReceiptsPostRequest() LedgerReceiptsPostRequest

func (*Client) NewRequest

func (c *Client) NewRequest(ctx context.Context, req Request) (*http.Request, error)

func (*Client) NewVatsDefaultGetRequest

func (c *Client) NewVatsDefaultGetRequest() VatsDefaultGetRequest

func (*Client) SetBaseURL

func (c *Client) SetBaseURL(baseURL url.URL)

func (*Client) SetBeforeRequestDo

func (c *Client) SetBeforeRequestDo(fun BeforeRequestDoCallback)

func (*Client) SetCharset

func (c *Client) SetCharset(charset string)

func (*Client) SetDebug

func (c *Client) SetDebug(debug bool)

func (*Client) SetDisallowUnknownFields

func (c *Client) SetDisallowUnknownFields(disallowUnknownFields bool)

func (*Client) SetHTTPClient

func (c *Client) SetHTTPClient(client *http.Client)

func (*Client) SetMediaType

func (c *Client) SetMediaType(mediaType string)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(userAgent string)

func (*Client) Unmarshal

func (c *Client) Unmarshal(r io.Reader, vv ...interface{}) error

func (Client) UserAgent

func (c Client) UserAgent() string

type Company

type Company struct {
	ID                   int    `json:"id"`
	Name                 string `json:"name"`
	Country              string `json:"country"`
	ProductVersion       string `json:"productVersion"`
	OperationType        string `json:"operationType"`
	AccountingOfficeName string `json:"accountingOfficeName"`
	AccountingOfficeID   int    `json:"accountingOfficeId"`
	CompanyAddress       struct {
		Street  string `json:"street"`
		Zip     string `json:"zip"`
		City    string `json:"city"`
		Country string `json:"country"`
	} `json:"companyAddress"`
	BillingAddress struct {
		Street string `json:"street"`
		Zip    string `json:"zip"`
		City   string `json:"city"`
	} `json:"billingAddress"`
	Mva                bool `json:"mva"`
	InTradeRegister    bool `json:"inTradeRegister"`
	BusinessIdentifier struct {
		BrnType string `json:"brnType"`
		Code    string `json:"code"`
	} `json:"businessIdentifier"`
}

type CompanyGetRequest

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

func (*CompanyGetRequest) Do

func (*CompanyGetRequest) Method

func (r *CompanyGetRequest) Method() string

func (CompanyGetRequest) NewPathParams

func (CompanyGetRequest) NewQueryParams

func (r CompanyGetRequest) NewQueryParams() *CompanyGetRequestQueryParams

func (CompanyGetRequest) NewRequestBody

func (r CompanyGetRequest) NewRequestBody() CompanyGetRequestBody

func (*CompanyGetRequest) NewResponseBody

func (r *CompanyGetRequest) NewResponseBody() *CompanyGetResponseBody

func (*CompanyGetRequest) PathParams

func (*CompanyGetRequest) PathParamsInterface

func (r *CompanyGetRequest) PathParamsInterface() PathParams

func (*CompanyGetRequest) QueryParams

func (*CompanyGetRequest) RequestBody

func (r *CompanyGetRequest) RequestBody() *CompanyGetRequestBody

func (*CompanyGetRequest) RequestBodyInterface

func (r *CompanyGetRequest) RequestBodyInterface() interface{}

func (*CompanyGetRequest) SetMethod

func (r *CompanyGetRequest) SetMethod(method string)

func (*CompanyGetRequest) SetRequestBody

func (r *CompanyGetRequest) SetRequestBody(body CompanyGetRequestBody)

func (*CompanyGetRequest) URL

func (r *CompanyGetRequest) URL() *url.URL

type CompanyGetRequestBody

type CompanyGetRequestBody struct {
}

type CompanyGetRequestPathParams

type CompanyGetRequestPathParams struct {
}

func (*CompanyGetRequestPathParams) Params

func (p *CompanyGetRequestPathParams) Params() map[string]string

type CompanyGetRequestQueryParams

type CompanyGetRequestQueryParams struct{}

func (CompanyGetRequestQueryParams) ToURLValues

func (p CompanyGetRequestQueryParams) ToURLValues() (url.Values, error)

type CompanyGetResponseBody

type CompanyGetResponseBody Company

type CounterParty

type CounterParty struct {
	ContactPersonName   string      `json:"contactPersonName"`
	Identifier          string      `json:"identifier"`
	TaxCode             string      `json:"taxCode"`
	CustomerNumber      string      `json:"customerNumber"`
	Email               string      `json:"email"`
	CounterPartyAddress Address     `json:"counterPartyAddress"`
	BankAccount         BankAccount `json:"bankAccount,omitempty"`
	EinvoiceAddress     struct {
		Operator string `json:"operator"`
		Address  string `json:"address"`
		EdiID    string `json:"ediId"`
	} `json:"einvoiceAddress"`
}

func (CounterParty) IsEmpty

func (cp CounterParty) IsEmpty() bool

func (CounterParty) MarshalJSON

func (cp CounterParty) MarshalJSON() ([]byte, error)

type Date

type Date struct {
	time.Time
}

func (Date) IsEmpty

func (d Date) IsEmpty() bool

func (*Date) MarshalJSON

func (d *Date) MarshalJSON() ([]byte, error)

func (Date) MarshalSchema

func (d Date) MarshalSchema() string

func (*Date) UnmarshalJSON

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

type DateTime

type DateTime struct {
	time.Time
}

func (*DateTime) MarshalJSON

func (dt *DateTime) MarshalJSON() ([]byte, error)

func (DateTime) MarshalSchema

func (d DateTime) MarshalSchema() string

func (*DateTime) UnmarshalJSON

func (dt *DateTime) UnmarshalJSON(text []byte) (err error)

type DeliveryTermsInfo

type DeliveryTermsInfo struct {
	Name         string `json:"name"`
	Municipality string `json:"municipality"`
}

func (DeliveryTermsInfo) IsEmpty

func (i DeliveryTermsInfo) IsEmpty() bool

func (DeliveryTermsInfo) MarshalJSON

func (i DeliveryTermsInfo) MarshalJSON() ([]byte, error)

type Dimension

type Dimension struct {
	ID    int    `json:"id"`
	Name  string `json:"name"`
	Items []struct {
		ID          int    `json:"id"`
		CodeName    string `json:"codeName"`
		Status      string `json:"status,omitempty"`
		Description string `json:"description,omitempty"`
	} `json:"items,omitempty"`
}

type Dimensions

type Dimensions []Dimension

type DimensionsGetRequest

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

func (*DimensionsGetRequest) Do

func (*DimensionsGetRequest) Method

func (r *DimensionsGetRequest) Method() string

func (DimensionsGetRequest) NewPathParams

func (DimensionsGetRequest) NewQueryParams

func (DimensionsGetRequest) NewRequestBody

func (*DimensionsGetRequest) NewResponseBody

func (r *DimensionsGetRequest) NewResponseBody() *DimensionsGetResponseBody

func (*DimensionsGetRequest) PathParams

func (*DimensionsGetRequest) PathParamsInterface

func (r *DimensionsGetRequest) PathParamsInterface() PathParams

func (*DimensionsGetRequest) QueryParams

func (*DimensionsGetRequest) RequestBody

func (*DimensionsGetRequest) RequestBodyInterface

func (r *DimensionsGetRequest) RequestBodyInterface() interface{}

func (*DimensionsGetRequest) SetMethod

func (r *DimensionsGetRequest) SetMethod(method string)

func (*DimensionsGetRequest) SetRequestBody

func (r *DimensionsGetRequest) SetRequestBody(body DimensionsGetRequestBody)

func (*DimensionsGetRequest) URL

func (r *DimensionsGetRequest) URL() *url.URL

type DimensionsGetRequestBody

type DimensionsGetRequestBody struct {
}

type DimensionsGetRequestPathParams

type DimensionsGetRequestPathParams struct {
}

func (*DimensionsGetRequestPathParams) Params

type DimensionsGetRequestQueryParams

type DimensionsGetRequestQueryParams struct{}

func (DimensionsGetRequestQueryParams) ToURLValues

func (p DimensionsGetRequestQueryParams) ToURLValues() (url.Values, error)

type DimensionsGetResponseBody

type DimensionsGetResponseBody Dimensions

type Error

type Error struct {
	Status  int    `json:"status"`
	Field   string `json:"field"`
	Message string `json:"message"`
}

func (*Error) Error

func (e *Error) Error() string

type ErrorResponse

type ErrorResponse struct {
	// HTTP response that caused this error
	Response *http.Response

	Errors Errors
}
{
  "errors": [
    {
      "status": 400,
      "message": "Value of the 'depreciation' field is invalid: "
    }
  ]
}

func (*ErrorResponse) Error

func (r *ErrorResponse) Error() string

type Errors

type Errors []Error

type ExtraInfo

type ExtraInfo struct {
	AccountingByRow      bool `json:"accountingByRow"`
	UnitPricesIncludeVat bool `json:"unitPricesIncludeVat"`
}

func (ExtraInfo) IsEmpty

func (i ExtraInfo) IsEmpty() bool

func (ExtraInfo) MarshalJSON

func (i ExtraInfo) MarshalJSON() ([]byte, error)

type Invoice

type Invoice struct {
	ID                     int                    `json:"id,omitempty"`
	PartnerID              int                    `json:"partnerId,omitempty"`
	Type                   string                 `json:"type"`
	Status                 string                 `json:"status"`
	Date                   string                 `json:"date"`
	DueDate                string                 `json:"dueDate,omitempty"`
	CounterParty           CounterParty           `json:"counterParty"`
	BillingAddress         Address                `json:"billingAddress,omitempty"`
	DeliveryAddress        Address                `json:"deliveryAddress,omitempty"`
	PaymentInfo            PaymentInfo            `json:"paymentInfo"`
	DeliveryTermsInfo      DeliveryTermsInfo      `json:"deliveryTermsInfo,omitempty"`
	ExtraInfo              ExtraInfo              `json:"extraInfo"`
	DiscountPercent        int                    `json:"discountPercent"`
	OrderReference         string                 `json:"orderReference"`
	InvoiceRows            InvoiceRows            `json:"invoiceRows"`
	VatStatus              int                    `json:"vatStatus"`
	InvoiceNumber          int                    `json:"invoiceNumber"`
	OriginalInvoiceNumber  string                 `json:"originalInvoiceNumber"`
	DeliveryStartDate      string                 `json:"deliveryStartDate,omitempty"`
	DeliveryEndDate        string                 `json:"deliveryEndDate,omitempty"`
	DeliveryMethod         string                 `json:"deliveryMethod,omitempty"`
	DeliveryInstructions   string                 `json:"deliveryInstructions,omitempty"`
	InvoiceChannel         string                 `json:"invoiceChannel,omitempty"`
	InvoiceOperatorInfo    InvoiceOperatorInfo    `json:"invoiceOperatorInfo,omitempty"`
	PenaltyPercent         int                    `json:"penaltyPercent,omitempty"`
	Language               string                 `json:"language,omitempty"`
	InvoiceTemplateID      int                    `json:"invoiceTemplateId,omitempty"`
	AdditionalInformation  string                 `json:"additionalInformation,omitempty"`
	VatCountry             string                 `json:"vatCountry,omitempty"`
	Notes                  string                 `json:"notes,omitempty"`
	FactoringContractID    int                    `json:"factoringContractId,omitempty"`
	FactoringText          string                 `json:"factoringText,omitempty"`
	TravelInformationItems TravelInformationItems `json:"travelInformationItems,omitempty"`
	// InvoiceApprovalInformation struct {
	// 	Acceptors []struct {
	// 		UserID int `json:"userId"`
	// 	} `json:"acceptors"`
	// 	Verifiers []struct {
	// 		UserID int `json:"userId"`
	// 	} `json:"verifiers"`
	// } `json:"invoiceApprovalInformation,omitempty"`
	OrderNumber     string `json:"orderNumber,omitempty"`
	AgreementNumber string `json:"agreementNumber,omitempty"`
	AccountingCode  string `json:"accountingCode,omitempty"`
	DeliverySite    string `json:"deliverySite,omitempty"`
	TenderReference string `json:"tenderReference,omitempty"`
	IsOffer         bool   `json:"isOffer,omitempty"`
	Created         string `json:"created,omitempty"`
	Version         string `json:"version,omitempty"`
}

func (Invoice) IsEmpty

func (i Invoice) IsEmpty() bool

func (Invoice) MarshalJSON

func (i Invoice) MarshalJSON() ([]byte, error)

type InvoiceOperatorInfo

type InvoiceOperatorInfo struct {
	Operator         string `json:"operator"`
	ReceivingAddress string `json:"receivingAddress"`
}

func (InvoiceOperatorInfo) IsEmpty

func (i InvoiceOperatorInfo) IsEmpty() bool

func (InvoiceOperatorInfo) MarshalJSON

func (i InvoiceOperatorInfo) MarshalJSON() ([]byte, error)

type InvoiceRow

type InvoiceRow struct {
	ProductID       int     `json:"productId,omitempty"`
	Product         string  `json:"product"`
	ProductCode     string  `json:"productCode,omitempty"`
	Quantity        int     `json:"quantity"`
	Unit            string  `json:"unit"`
	UnitPrice       float64 `json:"unitPrice"`
	DiscountPercent float64 `json:"discountPercent"`
	VatPercent      float64 `json:"vatPercent"`
	VatStatus       int     `json:"vatStatus,omitempty"`
	Comment         string  `json:"comment"`
	StartDate       string  `json:"startDate,omitempty"`
	EndDate         string  `json:"endDate,omitempty"`
}

type InvoiceRows

type InvoiceRows []InvoiceRow

type Invoices

type Invoices []Invoice

type InvoicesGetRequest

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

func (*InvoicesGetRequest) All

func (*InvoicesGetRequest) Do

func (*InvoicesGetRequest) Method

func (r *InvoicesGetRequest) Method() string

func (InvoicesGetRequest) NewPathParams

func (InvoicesGetRequest) NewQueryParams

func (InvoicesGetRequest) NewRequestBody

func (r InvoicesGetRequest) NewRequestBody() InvoicesGetRequestBody

func (*InvoicesGetRequest) NewResponseBody

func (r *InvoicesGetRequest) NewResponseBody() *InvoicesGetResponseBody

func (*InvoicesGetRequest) PathParams

func (*InvoicesGetRequest) PathParamsInterface

func (r *InvoicesGetRequest) PathParamsInterface() PathParams

func (*InvoicesGetRequest) QueryParams

func (*InvoicesGetRequest) RequestBody

func (r *InvoicesGetRequest) RequestBody() *InvoicesGetRequestBody

func (*InvoicesGetRequest) RequestBodyInterface

func (r *InvoicesGetRequest) RequestBodyInterface() interface{}

func (*InvoicesGetRequest) SetMethod

func (r *InvoicesGetRequest) SetMethod(method string)

func (*InvoicesGetRequest) SetRequestBody

func (r *InvoicesGetRequest) SetRequestBody(body InvoicesGetRequestBody)

func (*InvoicesGetRequest) URL

func (r *InvoicesGetRequest) URL() *url.URL

type InvoicesGetRequestBody

type InvoicesGetRequestBody struct {
}

type InvoicesGetRequestPathParams

type InvoicesGetRequestPathParams struct {
}

func (*InvoicesGetRequestPathParams) Params

func (p *InvoicesGetRequestPathParams) Params() map[string]string

type InvoicesGetRequestQueryParams

type InvoicesGetRequestQueryParams struct {
	Status                []string `schema:"status,omitempty"`
	StartDate             string   `schema:"startDate,omitempty"`
	EndDate               string   `schema:"endDate,omitempty"`
	CreatedStartDate      string   `schema:"createdStartDate,omitempty"`
	CreatedEndDate        string   `schema:"createdEndDate,omitempty"`
	VersionStartDate      string   `schema:"versionStartDate,omitempty"`
	VersionEndDate        string   `schema:"versionEndDate,omitempty"`
	Types                 []string `schema:"types,omitempty"`
	BusinessPartnerId     int      `schema:"businessPartnerId,omitempty"`
	FactoringContractID   int      `schema:"factoringContractId,omitempty"`
	OriginalInvoiceNumber string   `schema:"originalInvoiceNumber,omitempty"`
	InvoiceNumber         string   `schema:"invoiceNumber,omitempty"`
	PreviousId            int      `schema:"previousId,omitempty"`
	OrderById             string   `schema:"orderById,omitempty"`
	OrderByDate           string   `schema:"orderByDate,omitempty"`
	OrderByCreated        string   `schema:"orderByCreated,omitempty"`
	OrderByVersion        string   `schema:"orderByVersion,omitempty"`
	Size                  int      `schema:"size,omitempty"`
	Page                  int      `schema:"page,omitempty"`
	InvoiceChannelID      []string `schema:"invoiceChannelId,omitempty"`
}

func (InvoicesGetRequestQueryParams) ToURLValues

func (p InvoicesGetRequestQueryParams) ToURLValues() (url.Values, error)

type InvoicesGetResponseBody

type InvoicesGetResponseBody struct {
	Results Invoices `json:"results"`
	Meta    Meta     `json:"meta"`
}

type InvoicesPostRequest

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

func (*InvoicesPostRequest) Do

func (*InvoicesPostRequest) Method

func (r *InvoicesPostRequest) Method() string

func (InvoicesPostRequest) NewPathParams

func (InvoicesPostRequest) NewQueryParams

func (InvoicesPostRequest) NewRequestBody

func (r InvoicesPostRequest) NewRequestBody() InvoicesPostRequestBody

func (*InvoicesPostRequest) NewResponseBody

func (r *InvoicesPostRequest) NewResponseBody() *InvoicesPostResponseBody

func (*InvoicesPostRequest) PathParams

func (*InvoicesPostRequest) PathParamsInterface

func (r *InvoicesPostRequest) PathParamsInterface() PathParams

func (*InvoicesPostRequest) QueryParams

func (*InvoicesPostRequest) RequestBody

func (r *InvoicesPostRequest) RequestBody() *InvoicesPostRequestBody

func (*InvoicesPostRequest) RequestBodyInterface

func (r *InvoicesPostRequest) RequestBodyInterface() interface{}

func (*InvoicesPostRequest) SetMethod

func (r *InvoicesPostRequest) SetMethod(method string)

func (*InvoicesPostRequest) SetRequestBody

func (r *InvoicesPostRequest) SetRequestBody(body InvoicesPostRequestBody)

func (*InvoicesPostRequest) URL

func (r *InvoicesPostRequest) URL() *url.URL

type InvoicesPostRequestBody

type InvoicesPostRequestBody Invoice

func (InvoicesPostRequestBody) IsEmpty

func (rb InvoicesPostRequestBody) IsEmpty() bool

func (InvoicesPostRequestBody) MarshalJSON

func (rb InvoicesPostRequestBody) MarshalJSON() ([]byte, error)

type InvoicesPostRequestPathParams

type InvoicesPostRequestPathParams struct {
}

func (*InvoicesPostRequestPathParams) Params

type InvoicesPostRequestQueryParams

type InvoicesPostRequestQueryParams struct{}

func (InvoicesPostRequestQueryParams) ToURLValues

func (p InvoicesPostRequestQueryParams) ToURLValues() (url.Values, error)

type InvoicesPostResponseBody

type InvoicesPostResponseBody Invoice

type LedgerAccount

type LedgerAccount struct {
	LedgerAccountCode string `json:"ledgerAccountCode"`
	Name              string `json:"name"`
}

type LedgerAccounts

type LedgerAccounts []LedgerAccount

type LedgerReceiptsPostRequest

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

func (*LedgerReceiptsPostRequest) Do

func (*LedgerReceiptsPostRequest) Method

func (r *LedgerReceiptsPostRequest) Method() string

func (LedgerReceiptsPostRequest) NewPathParams

func (LedgerReceiptsPostRequest) NewQueryParams

func (LedgerReceiptsPostRequest) NewRequestBody

func (*LedgerReceiptsPostRequest) NewResponseBody

func (*LedgerReceiptsPostRequest) PathParams

func (*LedgerReceiptsPostRequest) PathParamsInterface

func (r *LedgerReceiptsPostRequest) PathParamsInterface() PathParams

func (*LedgerReceiptsPostRequest) QueryParams

func (*LedgerReceiptsPostRequest) RequestBody

func (*LedgerReceiptsPostRequest) RequestBodyInterface

func (r *LedgerReceiptsPostRequest) RequestBodyInterface() interface{}

func (*LedgerReceiptsPostRequest) SetMethod

func (r *LedgerReceiptsPostRequest) SetMethod(method string)

func (*LedgerReceiptsPostRequest) SetRequestBody

func (*LedgerReceiptsPostRequest) URL

func (r *LedgerReceiptsPostRequest) URL() *url.URL

type LedgerReceiptsPostRequestBody

type LedgerReceiptsPostRequestBody struct {
	// readOnly: true
	// Unique identifier of the ledger receipt. Generated by Procountor and
	// present in the object returned.
	ID int `json:"id,omitempty"`
	// Ledger receipt type. Use JOURNAL for creating ledger receipts (vouchers)
	// containing ledger transactions without linkage to pre-existing resources.
	// Other types are automatically generated by Procountor for holding
	// accounting information for e.g. invoices. Types allowed for POST =
	// JOURNAL. Types allowed for PUT = JOURNAL, SALES_INVOICE,
	// PURCHASE_INVOICE, TRAVEL_INVOICE, BILL_OF_CHARGES Types allowed for GET
	// listed below:
	// [ JOURNAL, PURCHASE_INVOICE, SALES_INVOICE, PERIODIC_TAX_RETURN,
	// TRAVEL_INVOICE, BILL_OF_CHARGES, VAT_FORM, SALARY, EMPLOYER_CONTRIBUTION,
	// PURCHASE_ORDER, SALES_ORDER, BANK_STATEMENT_AS_RECEIPT,
	// RECEIPT_FOR_OPENING_ACCOUNTS, REFERENCE_PAYMENT,
	// TRACKING_PERIOD_OPENING_RECEIPT, VAT_SUMMARY ]
	Type string `json:"type"`
	// readOnly: true
	// Ledger receipt status. Status of a ledger receipt equals the status of
	// the linked invoice. All ledger receipts are initially created with status
	// UNFINISHED. For journals, possible statuses are UNFINISHED, APPROVED and
	// INVALIDATED. Ledger receipt statuses cannot be directly modified through
	// the API.
	Status string `json:"status,omitempty"`
	// Ledger receipt name.
	Name string `json:"name"`
	// Ledger receipt date. Must not be in a closed fiscal period. See GET
	// /fiscalyears for a list of fiscal years.
	ReceiptDate string `json:"receiptDate"`
	// Ledger receipt VAT type.
	// [ SALES, PURCHASE ]
	// Ledger receipt VAT status. This can be overridden on transaction level.
	// Use here the numeric parts of VAT status codes listed in "VAT defaults"
	// in Procountor. For example, for VAT status code "vat_12", use value 12.
	// The VAT status used must be enabled for the current receipt type
	// (sales/purchase).
	VatType   string `json:"vatType"`
	VatStatus int    `json:"vatStatus"`
	// Ledger receipt VAT country. Only for JOURNAL types of ledger receipts.
	// Requires a special right for foreign VATs. See Address.country in POST
	// /invoices for a list of allowable values.
	VatProcessing string `json:"vatProcessing,omitempty"`
	// readOnly: true
	// ID of the linked invoice. For sales and purchase invoice ledger receipts,
	// this refers to the invoice the receipt holds accounting data for. For
	// journal receipts, an invoice is automatically generated to store certain
	// data fields. Use this ID in POST /attachments endpoint.
	InvoiceID int `json:"invoiceId,omitempty"`
	// readOnly: true
	// Receipt number of bank statement as receipt.
	ReceiptNumber int `json:"receiptNumber,omitempty"`
	// Invoice notes. Linked to Invoice.notes. Not visible on ledger receipt
	// printouts. Use \n as line break. Max length 10000.
	InvoiceNotes string `json:"invoiceNotes"`
	// readOnly: true
	// Number of the linked invoice. Automatically generated by Procountor.
	InvoiceNumber int `json:"invoiceNumber,omitempty"`
	// Notes made by the accountant. Visible on ledger receipt printouts.
	AccountantsNotes string `json:"accountantsNotes"`
	// Transaction description. This is a summary description for any
	// transactions belonging to the ledger receipt.
	TransactionDescription string `json:"transactionDescription"`
	// Receipt validity time.
	// [ EMPTY, IMMEDIATELY, SERVICE_PERIOD, OVER_3_YEARS ]
	ReceiptValidity string `json:"receiptValidity,omitempty"`
	// Start date of the receipt period. If set, must precede the end date of
	// the period.
	PeriodStartDate string `json:"periodStartDate"`
	// End date of the receipt period. If this and the start date are set, this
	// must be after the start date.
	PeriodEndDate string `json:"periodEndDate"`
	// Partner code. Identifier for the related company or person. May represent
	// a business ID, national identification number (HETU in Finland) or an
	// account number, depending on the receipt type.
	PartnerCode string `json:"partnerCode,omitempty"`
	// Ledger receipt version timestamp. Automatically generated by Procountor
	// and updated every time the receipt is modified. When using PUT
	// /ledgerreceipts, it is required to include the latest version timestamp
	// of the receipt to the request. This prevents conflicts if the receipt is
	// being modified from several sources.
	Version time.Time `json:"version,omitempty"`
	// Accounting depreciation method for the receipt.
	Depreciation string `json:"depreciation,omitempty"`
	// VAT date to be used if payment based VAT is enabled
	VatDate      string `json:"vatDate,omitempty"`
	Transactions []struct {
		// readOnly: true
		// Unique identifier for the ledger transaction. Automatically generated
		// by Procountor and present in the object returned.
		ID int `json:"id,omitempty"`
		// Transaction type. Depends on the transaction and the ledger account
		// in question. Type REVERSING_ENTRY is used to indicate the first row
		// of a ledger receipt for a specific logic on the UI. Typically, it
		// represents a transaction for a balance sheet account. Note that
		// ledger receipts with no transactions marked as reversing entries are
		// possible. Type ENTRY is the general type for transactions. It can be
		// used even on the first rows of ledger receipts. Type
		// RECONCILIATION_ENTRY is used for getting the sum of transactions on a
		// receipt to reconcile (to equal zero). Generally, all ledger receipts
		// should reconcile. Procountor can create reconciliation entries
		// automatically for ledger receipts when "createReconciliation=true"
		// query parameter is specified. If VAT is used, a reconciliation row
		// might be necessary due to remainders and rounding. For both
		// REVERSING_ENTRY and RECONCILIATION_ENTRY transactions, vatStatus
		// cannot be defined and vatPercent must be 0. Additionally, a ledger
		// can have maximum of one REVERSING_ENTRY and maximum of one
		// RECONCILIATION_ENTRY transaction. Transactions of these types cannot
		// be removed from a ledger receipt using UI once created.
		// [ RECONCILIATION_ENTRY, REVERSING_ENTRY, ENTRY ]
		TransactionType string `json:"transactionType"`
		// Ledger account number for the transaction. Must be valid for the
		// current Procountor environment. Use GET /coa to obtain the chart of
		// accounts.
		Account string `json:"account"`
		// Transaction accounting value. This value is net. Scale: 2.
		AccountingValue float64 `json:"accountingValue"`
		// Transaction VAT percentage. Must be a percentage currently in use for
		// the company.
		VatPercent float64 `json:"vatPercent"`
		// Transaction VAT type.
		// [ SALES, PURCHASE ]
		VatType string `json:"vatType"`
		// Transaction VAT status. This overrides the VAT status set for the
		// parent ledger receipt. Use here the numeric parts of VAT status codes
		// listed in "VAT defaults" in Procountor. For example, for VAT status
		// code "vat_12", use value 12. The VAT status used must be enabled for
		// the current receipt type (sales/purchase).
		VatStatus int `json:"vatStatus"`
		// Transaction description. Visible on ledger receipt printouts.
		Description string `json:"description"`
		// Transaction balance code. Only available if the use balance sheet
		// setting is enabled.
		BalanceCode string `json:"balanceCode,omitempty"`
		// Technical ID for the partner. Can be provided in Norwegian
		// environments only. The given partner id must match a partner of type
		// different than PERSON, existing in the current Procountor
		// environment.
		PartnerID int `json:"partnerId,omitempty"`
		// Values of dimension items associated with this transaction. The
		// number of provided dimension items must be within the dimension max
		// count defined by the purchased Procountor license. Provided dimension
		// pairs (dimension id - item id) must be unique within the list
		// provided.
		DimensionItemValues []struct {
			// Dimension ID. Must exist in the current environment. For a list
			// of available dimensions, see the GET /dimensions endpoint.
			DimensionID int `json:"dimensionId"`
			// Dimension item ID. Must exist in the current environment. For a
			// list of available dimensions, see the GET /dimensions endpoint.
			ItemID int `json:"itemId"`
			// Dimension item value with maximum two decimal places. Use
			// absolute values instead of percentages. The sum of dimension item
			// values on a dimension must equal the accounting value of the
			// parent transaction.
			Value float64 `json:"value"`
		} `json:"dimensionItemValues"`
		// VAT deduction percentage for the transaction.
		VatDeductionPercent int `json:"vatDeductionPercent,omitempty"`
		// Start date of accrual/delivery periods of transaction.
		StartDate string `json:"startDate,omitempty"`
		// End date of accrual/delivery periods of transaction.
		EndDate string `json:"endDate,omitempty"`
	} `json:"transactions"`
}

type LedgerReceiptsPostRequestPathParams

type LedgerReceiptsPostRequestPathParams struct {
}

func (*LedgerReceiptsPostRequestPathParams) Params

type LedgerReceiptsPostRequestQueryParams

type LedgerReceiptsPostRequestQueryParams struct{}

func (LedgerReceiptsPostRequestQueryParams) ToURLValues

type LedgerReceiptsPostResponseBody

type LedgerReceiptsPostResponseBody Dimensions

type Meta

type Meta struct {
	PageNumber  int `json:"pageNumber"`
	PageSize    int `json:"pageSize"`
	ResultCount int `json:"resultCount"`
}

type Number

type Number float64

func (Number) MarshalJSON

func (i Number) MarshalJSON() ([]byte, error)

func (*Number) UnmarshalJSON

func (i *Number) UnmarshalJSON(data []byte) error

type Oauth2Config

type Oauth2Config struct {
	oauth2.Config
	APIKey string
}

func NewOauth2Config

func NewOauth2Config() *Oauth2Config

func (*Oauth2Config) Client

func (c *Oauth2Config) Client(ctx context.Context, token *oauth2.Token) *http.Client

The token will auto-refresh as necessary. The underlying HTTP transport will be obtained using the provided context. The returned client and its Transport should not be modified.

type PathParams

type PathParams interface {
	Params() map[string]string
}

type PaymentInfo

type PaymentInfo struct {
	PaymentMethod         string      `json:"paymentMethod"`
	Currency              string      `json:"currency"`
	BankAccount           BankAccount `json:"bankAccount,omitempty"`
	DueDate               string      `json:"dueDate"`
	CurrencyRate          int         `json:"currencyRate"`
	PaymentTermPercentage int         `json:"paymentTermPercentage,omitempty"`
	CashDiscount          struct {
		DiscountPercentage int `json:"discountPercentage,omitempty"`
	} `json:"cashDiscount,omitempty"`
	BankReferenceCode     string `json:"bankReferenceCode"`
	BankReferenceCodeType string `json:"bankReferenceCodeType,omitempty"`
	ClearingCode          string `json:"clearingCode,omitempty"`
}

func (PaymentInfo) IsEmpty

func (i PaymentInfo) IsEmpty() bool

func (PaymentInfo) MarshalJSON

func (i PaymentInfo) MarshalJSON() ([]byte, error)

type QueryParams

type QueryParams interface {
	ToURLValues() (url.Values, error)
}

type Request

type Request interface {
	Method() string
	// QueryParams() QueryParams
	PathParamsInterface() PathParams
	RequestBodyInterface() interface{}
	URL() *url.URL
}

type RequestCompletionCallback

type RequestCompletionCallback func(*http.Request, *http.Response)

RequestCompletionCallback defines the type of the request callback function

type TravelInformationItem

type TravelInformationItem struct {
	Departure string `json:"departure"`
	Arrival   string `json:"arrival"`
	Places    string `json:"places"`
	Purpose   string `json:"purpose"`
}

func (TravelInformationItem) IsEmpty

func (i TravelInformationItem) IsEmpty() bool

func (TravelInformationItem) MarshalJSON

func (i TravelInformationItem) MarshalJSON() ([]byte, error)

type TravelInformationItems

type TravelInformationItems []TravelInformationItem

type VatInformation

type VatInformation struct {
	Country     string `json:"country"`
	Percentages []struct {
		VatPercent float64 `json:"vatPercent"`
		Sales      bool    `json:"sales"`
		Purchase   bool    `json:"purchase"`
	} `json:"percentages"`
}

type VatInformations

type VatInformations []VatInformation

type VatStatus

type VatStatus struct {
	VatStatus   int    `json:"vatStatus"`
	Description string `json:"description"`
	Sales       bool   `json:"sales"`
	Purchase    bool   `json:"purchase"`
}

type VatStatuses

type VatStatuses []VatStatus

type VatsDefaultGetRequest

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

func (*VatsDefaultGetRequest) Do

func (*VatsDefaultGetRequest) Method

func (r *VatsDefaultGetRequest) Method() string

func (VatsDefaultGetRequest) NewPathParams

func (VatsDefaultGetRequest) NewQueryParams

func (VatsDefaultGetRequest) NewRequestBody

func (*VatsDefaultGetRequest) NewResponseBody

func (r *VatsDefaultGetRequest) NewResponseBody() *VatsDefaultGetResponseBody

func (*VatsDefaultGetRequest) PathParams

func (*VatsDefaultGetRequest) PathParamsInterface

func (r *VatsDefaultGetRequest) PathParamsInterface() PathParams

func (*VatsDefaultGetRequest) QueryParams

func (*VatsDefaultGetRequest) RequestBody

func (*VatsDefaultGetRequest) RequestBodyInterface

func (r *VatsDefaultGetRequest) RequestBodyInterface() interface{}

func (*VatsDefaultGetRequest) SetMethod

func (r *VatsDefaultGetRequest) SetMethod(method string)

func (*VatsDefaultGetRequest) SetRequestBody

func (r *VatsDefaultGetRequest) SetRequestBody(body VatsDefaultGetRequestBody)

func (*VatsDefaultGetRequest) URL

func (r *VatsDefaultGetRequest) URL() *url.URL

type VatsDefaultGetRequestBody

type VatsDefaultGetRequestBody struct {
}

type VatsDefaultGetRequestPathParams

type VatsDefaultGetRequestPathParams struct {
}

func (*VatsDefaultGetRequestPathParams) Params

type VatsDefaultGetRequestQueryParams

type VatsDefaultGetRequestQueryParams struct{}

func (VatsDefaultGetRequestQueryParams) ToURLValues

func (p VatsDefaultGetRequestQueryParams) ToURLValues() (url.Values, error)

type VatsDefaultGetResponseBody

type VatsDefaultGetResponseBody struct {
	VatInformation VatInformations `json:"vatInformation"`
	VatStatuses    VatStatuses     `json:"vatStatuses"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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