invdapi

package module
v1.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 11, 2022 License: MIT Imports: 18 Imported by: 31

README

invoiced-go

This repository contains the Go client library for the Invoiced API.

Build Status Coverage Status

Installing

The Invoiced package can be installed like this:

go get -u https://github.com/Invoiced/invoiced-go

Requirements

  • Go 1.11+

Usage

First, you must instantiate a new client

import "github.com/Invoiced/invoiced-go"

conn := invdapi.NewConnection("API_KEY", false)

Then, API calls can be made like this:

import "github.com/Invoiced/invoiced-go/invdendpoint"
import "fmt"

//Get All The Invoices With Auto Pagination
invoiceConn := conn.NewInvoice()
invoices, err := invoiceConn.ListAll(nil, nil)

if err != nil {
    panic(err)
}

//Let's print all the invoices
for _, invoice := range invoices {
    fmt.Println(invoice)
}

//Let's create a new customer
customerConn := conn.NewCustomer()

customerToCreate := conn.NewCustomer()
customerToCreate.Name = "Test Customer"

customerResponse, err := customerConn.Create(customerToCreate)

if err != nil {
    panic(err)
}

fmt.Println("Customer Response => ", customerResponse.Customer)

//Let's create a new invoice
invoiceToCreate := conn.NewInvoice()
invoiceToCreate.Customer = customerResponse.Id

//Create a Line Item
lineItem := invdendpoint.LineItem{}
lineItem.Description = "Retina MacBook Pro"
lineItem.Quantity = 5
lineItem.UnitCost = 1999.22

lineItems := append([]invdendpoint.LineItem{}, lineItem)

invoiceToCreate.Items = lineItems

//Add a Payment Term
invoiceToCreate.PaymentTerms = "NET15"

invoiceResponse, err := invoiceConn.Create(invoiceToCreate)

if err != nil {
    panic(err)
}

fmt.Println("Invoice Response => ", invoiceResponse.Invoice)

If you want to use the sandbox API instead then you must set the second argument on the client to true like this:

conn := invdapi.NewConnection("SANDBOX_API_KEY", false)

Developing

The test suite can be ran with:

go test ./...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SafeContactForCreation added in v1.0.1

func SafeContactForCreation(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeContactForUpdate added in v1.0.1

func SafeContactForUpdate(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeCouponForCreation added in v1.0.1

func SafeCouponForCreation(coupon *invdendpoint.Coupon) (*invdendpoint.Coupon, error)

SafeCouponForCreation prunes coupon data for just fields that can be used for creation of a coupon

func SafeCouponForUpdating added in v1.0.1

func SafeCouponForUpdating(coupon *invdendpoint.Coupon) (*invdendpoint.Coupon, error)

SafeTaxRateForUpdating prunes coupon data for just fields that can be used for updating of a plan

func SafeCreditNoteForCreation added in v1.0.1

func SafeCreditNoteForCreation(creditNote *invdendpoint.CreditNote) (*invdendpoint.CreditNote, error)

SafeEstimateForCreation prunes credit note data for just fields that can be used for creation of a credit note

func SafeCreditNoteForUpdate added in v1.0.1

func SafeCreditNoteForUpdate(creditNote *invdendpoint.CreditNote) (*invdendpoint.CreditNote, error)

SafeCreditNoteForUpdate prunes creditnote data for just fields that can be used for updating a credit note

func SafeCustomerForCreation added in v1.0.1

func SafeCustomerForCreation(cust *invdendpoint.Customer) (*invdendpoint.Customer, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeCustomerForUpdate added in v1.0.1

func SafeCustomerForUpdate(cust *invdendpoint.Customer) (*invdendpoint.Customer, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeEstimateForCreation added in v1.0.1

func SafeEstimateForCreation(estimate *invdendpoint.Estimate) (*invdendpoint.Estimate, error)

SafeEstimateForCreation prunes estimate data for just fields that can be used for creation of a invoice

func SafeEstimateForUpdate added in v1.0.1

func SafeEstimateForUpdate(estimate *invdendpoint.Estimate) (*invdendpoint.Estimate, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeFileForCreation added in v1.0.1

func SafeFileForCreation(file *invdendpoint.File) (*invdendpoint.File, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeInvoiceForCreation added in v1.0.1

func SafeInvoiceForCreation(inv *invdendpoint.Invoice) (*invdendpoint.Invoice, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeInvoiceForUpdate added in v1.0.1

func SafeInvoiceForUpdate(inv *invdendpoint.Invoice) (*invdendpoint.Invoice, error)

SafeInvoiceForCreation prunes invoice data for just fields that can be used for creation of a invoice

func SafeItemForCreation added in v1.0.1

func SafeItemForCreation(item *invdendpoint.Item) (*invdendpoint.Item, error)

SafeForCreation prunes item data for just fields that can be used for creation of an item

func SafeItemForUpdating added in v1.0.1

func SafeItemForUpdating(item *invdendpoint.Item) (*invdendpoint.Item, error)

SafeForUpdating prunes item data for just fields that can be used for updating of an item

func SafeNoteForUpdating added in v1.0.1

func SafeNoteForUpdating(note *invdendpoint.Note) (*invdendpoint.Note, error)

SafeCustomerForCreation prunes note data for just fields that can be used for creation of a note

func SafePaymentForCreation added in v1.0.1

func SafePaymentForCreation(payment *invdendpoint.Payment) (*invdendpoint.Payment, error)

SafePaymentForCreation prunes payment data for just fields that can be used for creation of a payment

func SafePaymentForUpdate added in v1.0.1

func SafePaymentForUpdate(payment *invdendpoint.Payment) (*invdendpoint.Payment, error)

SafePaymentForUpdate prunes payment data for just fields that can be used for creation of a payment

func SafePendingLineItemForCreation added in v1.0.1

func SafePendingLineItemForCreation(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafePendingLineItemForUpdate added in v1.0.1

func SafePendingLineItemForUpdate(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafePlanForCreation added in v1.0.1

func SafePlanForCreation(plan *invdendpoint.Plan) (*invdendpoint.Plan, error)

SafeCustomerForCreation prunes plan data for just fields that can be used for creation of a plan

func SafePlanForUpdating added in v1.0.1

func SafePlanForUpdating(plan *invdendpoint.Plan) (*invdendpoint.Plan, error)

SafeTaskForUpdating prunes plan data for just fields that can be used for updating of a plan

func SafeSourceForCreation added in v1.0.1

func SafeSourceForCreation(source *invdendpoint.PaymentSource) (*invdendpoint.PaymentSource, error)

SafeSourceForCreation prunes source object for just fields that can be used for creation

func SafeSubscriptionForCreation added in v1.0.1

func SafeSubscriptionForCreation(sub *invdendpoint.Subscription) (*invdendpoint.Subscription, error)

SafeSubscriptionForCreation prunes subscription data for just fields that can be used for creation of a subscription

func SafeSubscriptionsForUpdate added in v1.0.1

func SafeSubscriptionsForUpdate(sub *invdendpoint.Subscription) (*invdendpoint.Subscription, error)

SafeSubscriptionsForUpdate prunes subscription data for just fields that can be used for updating of a subscription

func SafeTaskForCreation added in v1.0.1

func SafeTaskForCreation(task *invdendpoint.Task) (*invdendpoint.Task, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeTaskForUpdating added in v1.0.1

func SafeTaskForUpdating(task *invdendpoint.Task) (*invdendpoint.Task, error)

SafeCustomerForCreation prunes customer data for just fields that can be used for creation of a customer

func SafeTaxRateForCreation added in v1.0.1

func SafeTaxRateForCreation(taxRate *invdendpoint.TaxRate) (*invdendpoint.TaxRate, error)

SafetaxRateForCreation prunes tax TaxRate data for just fields that can be used for creation of a tax TaxRate

func SafeTaxRateForUpdating added in v1.0.1

func SafeTaxRateForUpdating(taxRate *invdendpoint.TaxRate) (*invdendpoint.TaxRate, error)

SafeTaxRateForUpdating prunes plan data for just fields that can be used for updating of a plan

func Version

func Version() string

Types

type APIError

type APIError struct {
	Type    string `json:"type"`
	Message string `json:"message"`
	Param   string `json:"param"`
}

func NewAPIError

func NewAPIError(typeE, message, param string) *APIError

func (*APIError) Error

func (apiErr *APIError) Error() string

type Charge added in v1.0.1

type Charge struct {
	*Connection
	*invdendpoint.Charge
}

func (*Charge) Create added in v1.0.1

func (c *Charge) Create(chargeRequest *invdendpoint.ChargeRequest) (*Payment, error)

type ChasingCadence added in v1.0.1

type ChasingCadence struct {
	*Connection
	*invdendpoint.ChasingCadence
}

func (*ChasingCadence) ListAll added in v1.0.1

type ChasingCadences added in v1.0.1

type ChasingCadences []*ChasingCadence

type Connection

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

func NewConnection

func NewConnection(key string, sandbox bool) *Connection

func (*Connection) CreateFormFile added in v1.8.0

func (c *Connection) CreateFormFile(w *multipart.Writer, fieldname, filename string, fileType string) (io.Writer, error)

CreateFormFile is a convenience wrapper around CreatePart. It creates a new form-data header with the provided field name and file name.

func (*Connection) NewCharge added in v1.0.1

func (c *Connection) NewCharge() *Charge

func (*Connection) NewChasingCadence added in v1.0.1

func (c *Connection) NewChasingCadence() *ChasingCadence

func (*Connection) NewContact added in v1.0.1

func (c *Connection) NewContact() *invdendpoint.Contact

func (*Connection) NewCoupon added in v1.0.1

func (c *Connection) NewCoupon() *Coupon

func (*Connection) NewCreditNote added in v1.0.1

func (c *Connection) NewCreditNote() *CreditNote

func (*Connection) NewCustomer

func (c *Connection) NewCustomer() *Customer

func (*Connection) NewEstimate added in v1.0.1

func (c *Connection) NewEstimate() *Estimate

func (*Connection) NewEvent added in v1.0.1

func (c *Connection) NewEvent() *Event

func (*Connection) NewFile added in v1.0.1

func (c *Connection) NewFile() *File

func (*Connection) NewInvoice

func (c *Connection) NewInvoice() *Invoice

func (*Connection) NewItem added in v1.0.1

func (c *Connection) NewItem() *Item

func (*Connection) NewNote added in v1.0.1

func (c *Connection) NewNote() *Note

func (*Connection) NewNotification added in v1.0.1

func (c *Connection) NewNotification() *Notification

func (*Connection) NewPayment added in v1.0.1

func (c *Connection) NewPayment() *Payment

func (*Connection) NewPaymentPlanRequest added in v1.0.1

func (c *Connection) NewPaymentPlanRequest() *invdendpoint.PaymentPlanRequest

func (*Connection) NewPaymentSource added in v1.0.1

func (c *Connection) NewPaymentSource() *invdendpoint.PaymentSource

func (*Connection) NewPendingLineItem added in v1.0.1

func (c *Connection) NewPendingLineItem() *invdendpoint.PendingLineItem

func (*Connection) NewPlan added in v1.0.1

func (c *Connection) NewPlan() *Plan

func (*Connection) NewPreviewRequest added in v1.0.1

func (c *Connection) NewPreviewRequest() *invdendpoint.SubscriptionPreviewRequest

func (*Connection) NewRefund added in v1.0.1

func (c *Connection) NewRefund() *Refund

func (*Connection) NewRole added in v1.0.1

func (c *Connection) NewRole() *Role

func (*Connection) NewSubscription

func (c *Connection) NewSubscription() *Subscription

func (*Connection) NewTask added in v1.0.1

func (c *Connection) NewTask() *Task

func (*Connection) NewTaxRate added in v1.0.1

func (c *Connection) NewTaxRate() *TaxRate

func (*Connection) NewUser added in v1.0.1

func (c *Connection) NewUser() *User

func (*Connection) NewWebhookAttempt added in v1.0.1

func (c *Connection) NewWebhookAttempt() *WebhookAttempt

type Coupon added in v1.0.1

type Coupon struct {
	*Connection
	*invdendpoint.Coupon
}

func (*Coupon) Create added in v1.0.1

func (c *Coupon) Create(coupon *Coupon) (*Coupon, error)

func (*Coupon) Delete added in v1.0.1

func (c *Coupon) Delete() error

func (*Coupon) ListAll added in v1.0.1

func (c *Coupon) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Coupons, error)

func (*Coupon) Retrieve added in v1.0.1

func (c *Coupon) Retrieve(id string) (*Coupon, error)

func (*Coupon) Save added in v1.0.1

func (c *Coupon) Save() error

type Coupons added in v1.0.1

type Coupons []*Coupon

type CreditNote added in v1.0.1

type CreditNote struct {
	*Connection
	*invdendpoint.CreditNote
}

func (*CreditNote) Count added in v1.0.1

func (c *CreditNote) Count() (int64, error)

func (*CreditNote) Create added in v1.0.1

func (c *CreditNote) Create(creditNote *CreditNote) (*CreditNote, error)

func (*CreditNote) Delete added in v1.0.1

func (c *CreditNote) Delete() error

func (*CreditNote) ListAll added in v1.0.1

func (c *CreditNote) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (CreditNotes, error)

func (*CreditNote) ListAttachments added in v1.0.1

func (c *CreditNote) ListAttachments() (Files, error)

func (*CreditNote) Retrieve added in v1.0.1

func (c *CreditNote) Retrieve(id int64) (*CreditNote, error)

func (*CreditNote) Save added in v1.0.1

func (c *CreditNote) Save() error

func (*CreditNote) SendEmail added in v1.0.1

func (c *CreditNote) SendEmail(emailReq *invdendpoint.EmailRequest) error

func (*CreditNote) SendLetter added in v1.0.1

func (c *CreditNote) SendLetter() (*invdendpoint.LetterResponse, error)

func (*CreditNote) SendText added in v1.0.1

func (*CreditNote) String added in v1.0.1

func (c *CreditNote) String() string

func (*CreditNote) Void added in v1.0.1

func (c *CreditNote) Void() (*CreditNote, error)

type CreditNotes added in v1.0.1

type CreditNotes []*CreditNote

type Customer

type Customer struct {
	*Connection
	*invdendpoint.Customer
}

func (*Customer) ConsolidateInvoices added in v1.0.1

func (c *Customer) ConsolidateInvoices() (*Invoice, error)

func (*Customer) Count

func (c *Customer) Count() (int64, error)

func (*Customer) Create

func (c *Customer) Create(customer *Customer) (*Customer, error)

func (*Customer) CreateContact added in v1.0.1

func (c *Customer) CreateContact(contact *invdendpoint.Contact) (*invdendpoint.Contact, error)

func (*Customer) CreateCreditBalanceAdjustment added in v1.0.1

func (c *Customer) CreateCreditBalanceAdjustment(amount float64) (*invdendpoint.BalanceAdjustment, error)

func (*Customer) CreatePaymentSource added in v1.0.1

func (c *Customer) CreatePaymentSource(source *invdendpoint.PaymentSource) (*invdendpoint.PaymentSource, error)

func (*Customer) CreatePendingLineItem added in v1.0.1

func (c *Customer) CreatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

func (*Customer) Delete

func (c *Customer) Delete() error

func (*Customer) DeleteBankAccount added in v1.0.1

func (c *Customer) DeleteBankAccount(acctID int64) error

func (*Customer) DeleteCard added in v1.0.1

func (c *Customer) DeleteCard(cardID int64) error

func (*Customer) DeleteContact added in v1.0.1

func (c *Customer) DeleteContact(contactID int64) error

func (*Customer) DeletePendingLineItem added in v1.0.1

func (c *Customer) DeletePendingLineItem(id int64) error

func (*Customer) FreeUpdate added in v1.0.1

func (c *Customer) FreeUpdate(customerData interface{}) error

func (*Customer) GetBalance added in v1.0.1

func (c *Customer) GetBalance() (*invdendpoint.Balance, error)

func (*Customer) List

func (c *Customer) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, string, error)

func (*Customer) ListAll

func (c *Customer) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Customers, error)

func (*Customer) ListAllContacts added in v1.0.1

func (c *Customer) ListAllContacts() (invdendpoint.Contacts, error)

func (*Customer) ListAllPaymentSources added in v1.0.1

func (c *Customer) ListAllPaymentSources() (invdendpoint.PaymentSources, error)

func (*Customer) ListAllPendingLineItems added in v1.0.1

func (c *Customer) ListAllPendingLineItems() (invdendpoint.PendingLineItems, error)

func (*Customer) ListCustomerByNumber

func (c *Customer) ListCustomerByNumber(customerNumber string) (*Customer, error)

func (*Customer) Retrieve

func (c *Customer) Retrieve(id int64) (*Customer, error)

func (*Customer) RetrieveContact added in v1.0.1

func (c *Customer) RetrieveContact(contactID int64) (*invdendpoint.Contact, error)

func (*Customer) RetrieveNotes added in v1.0.1

func (c *Customer) RetrieveNotes() (invdendpoint.Notes, error)

func (*Customer) RetrievePendingLineItem added in v1.0.1

func (c *Customer) RetrievePendingLineItem(id int64) (*invdendpoint.PendingLineItem, error)

func (*Customer) Save

func (c *Customer) Save() error

func (*Customer) SendStatementEmail added in v1.0.1

func (c *Customer) SendStatementEmail(custStmtReq *invdendpoint.EmailRequest) error

func (*Customer) SendStatementLetter added in v1.0.1

func (c *Customer) SendStatementLetter(custStmtReq *invdendpoint.LetterRequest) (*invdendpoint.LetterResponse, error)

func (*Customer) SendStatementText added in v1.0.1

func (c *Customer) SendStatementText(custStmtReq *invdendpoint.TextRequest) (invdendpoint.TextResponses, error)

func (*Customer) TriggerInvoice added in v1.0.1

func (c *Customer) TriggerInvoice() (*Invoice, error)

func (*Customer) UpdateContact added in v1.0.1

func (c *Customer) UpdateContact(contactToUpdate *invdendpoint.Contact) (*invdendpoint.Contact, error)

func (*Customer) UpdatePendingLineItem added in v1.0.1

func (c *Customer) UpdatePendingLineItem(pendingLineItem *invdendpoint.PendingLineItem) (*invdendpoint.PendingLineItem, error)

type Customers

type Customers []*Customer

type Estimate added in v1.0.1

type Estimate struct {
	*Connection
	*invdendpoint.Estimate
}

func (*Estimate) Count added in v1.0.1

func (c *Estimate) Count() (int64, error)

func (*Estimate) Create added in v1.0.1

func (c *Estimate) Create(estimate *Estimate) (*Estimate, error)

func (*Estimate) Delete added in v1.0.1

func (c *Estimate) Delete() error

func (*Estimate) GenerateInvoice added in v1.0.1

func (c *Estimate) GenerateInvoice() (*Invoice, error)

func (*Estimate) List added in v1.0.1

func (c *Estimate) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Estimates, string, error)

func (*Estimate) ListAll added in v1.0.1

func (c *Estimate) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Estimates, error)

func (*Estimate) ListAttachments added in v1.0.1

func (c *Estimate) ListAttachments() (Files, error)

func (*Estimate) Retrieve added in v1.0.1

func (c *Estimate) Retrieve(id int64) (*Estimate, error)

func (*Estimate) Save added in v1.0.1

func (c *Estimate) Save() error

func (*Estimate) SendEmail added in v1.0.1

func (c *Estimate) SendEmail(emailReq *invdendpoint.EmailRequest) error

func (*Estimate) SendLetter added in v1.0.1

func (c *Estimate) SendLetter() (*invdendpoint.LetterResponse, error)

func (*Estimate) SendText added in v1.0.1

func (*Estimate) String added in v1.0.1

func (c *Estimate) String() string

func (*Estimate) Void added in v1.0.1

func (c *Estimate) Void() (*Estimate, error)

type Estimates added in v1.0.1

type Estimates []*Estimate

type Event added in v1.0.1

type Event struct {
	*Connection
	*invdendpoint.Event
}

func (*Event) List added in v1.0.1

func (c *Event) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Events, string, error)

func (*Event) ListAll added in v1.0.1

func (c *Event) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Events, error)

func (*Event) ListAllByDatesAndUser added in v1.0.1

func (c *Event) ListAllByDatesAndUser(filter *invdendpoint.Filter, sort *invdendpoint.Sort, startDate int64, endDate int64, user string, objectType string, objectID int64) (Events, error)

func (*Event) Retrieve added in v1.0.1

func (c *Event) Retrieve(id int64) (*Event, error)

func (*Event) RetrieveWithUser added in v1.4.0

func (c *Event) RetrieveWithUser(id int64) (*Event, error)

type Events added in v1.0.1

type Events []*Event

type File added in v1.0.1

type File struct {
	*Connection
	*invdendpoint.File
}

func (*File) Create added in v1.0.1

func (c *File) Create(file *File) (*File, error)

func (*File) CreateAndUploadFile added in v1.8.0

func (c *File) CreateAndUploadFile(filePath, fileType string) (*File, error)

func (*File) Delete added in v1.0.1

func (c *File) Delete() error

func (*File) Retrieve added in v1.0.1

func (c *File) Retrieve(id int64) (*File, error)

type Files added in v1.0.1

type Files []*File

type Invoice

type Invoice struct {
	*Connection
	*invdendpoint.Invoice
}

func (*Invoice) CancelPaymentPlan added in v1.0.1

func (c *Invoice) CancelPaymentPlan() error

func (*Invoice) Count

func (c *Invoice) Count() (int64, error)

func (*Invoice) Create

func (c *Invoice) Create(invoice *Invoice) (*Invoice, error)

func (*Invoice) CreatePaymentPlan added in v1.0.1

func (c *Invoice) CreatePaymentPlan(paymentPlanRequest *invdendpoint.PaymentPlanRequest) (*invdendpoint.PaymentPlan, error)

func (*Invoice) Delete

func (c *Invoice) Delete() error

func (*Invoice) List

func (c *Invoice) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, string, error)

func (*Invoice) ListAll

func (c *Invoice) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, error)

func (*Invoice) ListAllHelper added in v1.0.1

func (c *Invoice) ListAllHelper(endpoint string, filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, error)

func (*Invoice) ListAllInvoicesEndDate added in v1.0.1

func (c *Invoice) ListAllInvoicesEndDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesStartDate added in v1.0.1

func (c *Invoice) ListAllInvoicesStartDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesStartEndDate added in v1.0.1

func (c *Invoice) ListAllInvoicesStartEndDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, startDate, endDate int64) (Invoices, error)

func (*Invoice) ListAllInvoicesUpdatedDate added in v1.0.1

func (c *Invoice) ListAllInvoicesUpdatedDate(filter *invdendpoint.Filter, sort *invdendpoint.Sort, invoiceDate int64) (Invoices, error)

func (*Invoice) ListAttachments added in v1.0.1

func (c *Invoice) ListAttachments() (Files, error)

func (*Invoice) ListHelper added in v1.0.1

func (c *Invoice) ListHelper(url string, filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Invoices, string, error)

func (*Invoice) ListInvoiceByNumber

func (c *Invoice) ListInvoiceByNumber(invoiceNumber string) (*Invoice, error)

func (*Invoice) Pay added in v1.0.1

func (c *Invoice) Pay() error

func (*Invoice) Retrieve

func (c *Invoice) Retrieve(id int64) (*Invoice, error)

func (*Invoice) RetrieveNotes added in v1.0.1

func (c *Invoice) RetrieveNotes() (Notes, error)

func (*Invoice) RetrievePaymentPlan added in v1.0.1

func (c *Invoice) RetrievePaymentPlan() (*invdendpoint.PaymentPlan, error)

func (*Invoice) Save

func (c *Invoice) Save() error

func (*Invoice) SendEmail added in v1.0.1

func (c *Invoice) SendEmail(emailReq *invdendpoint.EmailRequest) error

func (*Invoice) SendLetter added in v1.0.1

func (c *Invoice) SendLetter() (*invdendpoint.LetterResponse, error)

func (*Invoice) SendText added in v1.0.1

func (*Invoice) String added in v1.0.1

func (c *Invoice) String() string

func (*Invoice) Void added in v1.0.1

func (c *Invoice) Void() (*Invoice, error)

type Invoices

type Invoices []*Invoice

type Item added in v1.0.1

type Item struct {
	*Connection
	*invdendpoint.Item
}

func (*Item) Create added in v1.0.1

func (c *Item) Create(item *Item) (*Item, error)

func (*Item) Delete added in v1.0.1

func (c *Item) Delete() error

func (*Item) ListAll added in v1.0.1

func (c *Item) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Items, error)

func (*Item) Retrieve added in v1.0.1

func (c *Item) Retrieve(id string) (*Item, error)

func (*Item) Save added in v1.0.1

func (c *Item) Save() error

type Items added in v1.0.1

type Items []*Item

type Note added in v1.0.1

type Note struct {
	*Connection
	*invdendpoint.Note
}

func (*Note) Create added in v1.0.1

func (c *Note) Create(createNoteRequest invdendpoint.CreateNoteRequest) (*Note, error)

func (*Note) Delete added in v1.0.1

func (c *Note) Delete() error

func (*Note) ListAll added in v1.0.1

func (c *Note) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Notes, error)

func (*Note) Save added in v1.0.1

func (c *Note) Save() error

type Notes added in v1.0.1

type Notes []*Note

type Notification added in v1.0.1

type Notification struct {
	*Connection
	*invdendpoint.Notification
}

func (*Notification) Create added in v1.0.1

func (c *Notification) Create(notificationRequest *invdendpoint.NotificationRequest) (*Notification, error)

func (*Notification) Delete added in v1.0.1

func (c *Notification) Delete(id int64) error

func (*Notification) ListAll added in v1.0.1

func (c *Notification) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Notifications, error)

func (*Notification) Retrieve added in v1.0.1

func (c *Notification) Retrieve(id int64) (*Notification, error)

func (*Notification) Save added in v1.0.1

func (c *Notification) Save(notificationRequest *invdendpoint.NotificationRequest, id int64) error

type Notifications added in v1.0.1

type Notifications []*Notification

type Payment added in v1.0.1

type Payment struct {
	*Connection
	*invdendpoint.Payment
}

func (*Payment) Count added in v1.0.1

func (c *Payment) Count() (int64, error)

func (*Payment) Create added in v1.0.1

func (c *Payment) Create(payment *Payment) (*Payment, error)

func (*Payment) Delete added in v1.0.1

func (c *Payment) Delete() error

func (*Payment) List added in v1.0.1

func (c *Payment) List(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Payments, string, error)

func (*Payment) ListAll added in v1.0.1

func (c *Payment) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Payments, error)

func (*Payment) Retrieve added in v1.0.1

func (c *Payment) Retrieve(id int64) (*Payment, error)

func (*Payment) Save added in v1.0.1

func (c *Payment) Save() error

func (*Payment) SendReceipt added in v1.0.1

func (c *Payment) SendReceipt(emailReq *invdendpoint.EmailRequest) error

type Payments added in v1.0.1

type Payments []*Payment

type Plan added in v1.0.1

type Plan struct {
	*Connection
	*invdendpoint.Plan
}

func (*Plan) Create added in v1.0.1

func (c *Plan) Create(plan *Plan) (*Plan, error)

func (*Plan) Delete added in v1.0.1

func (c *Plan) Delete() error

func (*Plan) ListAll added in v1.0.1

func (c *Plan) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Plans, error)

func (*Plan) ListAllSubNumber added in v1.0.1

func (c *Plan) ListAllSubNumber(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Plans, error)

func (*Plan) Retrieve added in v1.0.1

func (c *Plan) Retrieve(id string) (*Plan, error)

func (*Plan) RetrieveWithSubNumber added in v1.0.1

func (c *Plan) RetrieveWithSubNumber(id string) (*Plan, error)

func (*Plan) Save added in v1.0.1

func (c *Plan) Save() error

type Plans added in v1.0.1

type Plans []*Plan

type Refund added in v1.0.1

type Refund struct {
	*Connection
	*invdendpoint.Refund
}

func (*Refund) Create added in v1.0.1

func (c *Refund) Create(chargeId int64, amount float64) error

type Role added in v1.0.1

type Role struct {
	*Connection
	*invdendpoint.Role
}

func (*Role) ListAll added in v1.0.1

func (c *Role) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) ([]*Role, error)

func (*Role) Retrieve added in v1.0.1

func (c *Role) Retrieve(id int64) (*Role, error)

type Roles added in v1.0.1

type Roles []*Role

type Subscription

type Subscription struct {
	*Connection
	*invdendpoint.Subscription
}

func (*Subscription) Cancel added in v1.0.1

func (c *Subscription) Cancel() error

func (*Subscription) Count

func (c *Subscription) Count() (int64, error)

func (*Subscription) Create

func (c *Subscription) Create(subscription *Subscription) (*Subscription, error)

func (*Subscription) List

func (*Subscription) ListAll

func (c *Subscription) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Subscriptions, error)

func (*Subscription) ListAllCanceled added in v1.7.0

func (c *Subscription) ListAllCanceled(filter *invdendpoint.Filter, sort *invdendpoint.Sort, canceled bool) (Subscriptions, error)

func (*Subscription) ListAllQueryParameters added in v1.11.0

func (c *Subscription) ListAllQueryParameters(parameters map[string]string) (Subscriptions, error)

func (*Subscription) Preview added in v1.0.1

func (*Subscription) Retrieve

func (c *Subscription) Retrieve(id int64) (*Subscription, error)

func (*Subscription) Save

func (c *Subscription) Save() error

type Subscriptions

type Subscriptions []*Subscription

type Task added in v1.0.1

type Task struct {
	*Connection
	*invdendpoint.Task
}

func (*Task) Create added in v1.0.1

func (c *Task) Create(task *Task) (*Task, error)

func (*Task) Delete added in v1.0.1

func (c *Task) Delete() error

func (*Task) ListAll added in v1.0.1

func (c *Task) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Tasks, error)

func (*Task) Retrieve added in v1.0.1

func (c *Task) Retrieve(id int64) (*Task, error)

func (*Task) Save added in v1.0.1

func (c *Task) Save() error

type Tasks added in v1.0.1

type Tasks []*Task

type TaxRate added in v1.0.1

type TaxRate struct {
	*Connection
	*invdendpoint.TaxRate
}

func (*TaxRate) Create added in v1.0.1

func (c *TaxRate) Create(taxRate *TaxRate) (*TaxRate, error)

func (*TaxRate) Delete added in v1.0.1

func (c *TaxRate) Delete() error

func (*TaxRate) ListAll added in v1.0.1

func (c *TaxRate) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (TaxRates, error)

func (*TaxRate) Retrieve added in v1.0.1

func (c *TaxRate) Retrieve(id string) (*TaxRate, error)

func (*TaxRate) Save added in v1.0.1

func (c *TaxRate) Save() error

type TaxRates added in v1.0.1

type TaxRates []*TaxRate

type User added in v1.0.1

type User struct {
	*Connection
	*invdendpoint.UserResponse
}

func (*User) Create added in v1.0.1

func (c *User) Create(userRequest *invdendpoint.UserRequest) (*User, error)

func (*User) Delete added in v1.0.1

func (c *User) Delete(id int64) error

func (*User) GenerateRegistrationURL added in v1.0.1

func (c *User) GenerateRegistrationURL() string

func (*User) ListAll added in v1.0.1

func (c *User) ListAll(filter *invdendpoint.Filter, sort *invdendpoint.Sort) (Users, error)

func (*User) Retrieve added in v1.0.1

func (c *User) Retrieve(id int64) (*User, error)

func (*User) Save added in v1.0.1

func (c *User) Save(userRequest *invdendpoint.UserRequest, id int64) error

func (*User) SendInvite added in v1.0.1

func (c *User) SendInvite(id int64) error

func (*User) SetUserEmailFrequency added in v1.0.1

func (c *User) SetUserEmailFrequency(userEmailFrequency string, id int64) (*User, error)

type Users added in v1.0.1

type Users []*User

type WebhookAttempt added in v1.0.1

type WebhookAttempt struct {
	*Connection
	*invdendpoint.WebhookAttempt
}

func (*WebhookAttempt) ListAll added in v1.0.1

func (*WebhookAttempt) ReAttempt added in v1.0.1

func (c *WebhookAttempt) ReAttempt(webhookId int64) error

type WebhookAttempts added in v1.0.1

type WebhookAttempts []*WebhookAttempt

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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