-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathinvoice.go
More file actions
53 lines (45 loc) · 1.88 KB
/
invoice.go
File metadata and controls
53 lines (45 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
package whmcs
// CreateInvoiceRequest contains all available fields for creating a new invoice.
type CreateInvoiceRequest struct {
UserID int64 `json:"userid,string"`
Date InvoiceDate `json:"date"`
DueDate InvoiceDate `json:"duedate"`
PaymentMethod string `json:"paymentmethod"`
ItemDescription1 string `json:"itemdescription1"`
ItemAmount1 float64 `json:"itemamount1,string"`
ItemTaxed1 int64 `json:"itemtaxed1,string"`
// Optional attributes
TaxRate int64 `json:"taxrate,string,omitempty"`
TaxRate2 int64 `json:"taxrate2,string,omitempty"`
Notes string `json:"notes,omitempty"`
SendInvoice bool `json:"sendinvoice,string,omitempty"`
AutoApplyCredit bool `json:"autoapplycredit,string,omitempty"`
ItemDescription2 string `json:"itemdescription2,omitempty"`
ItemAmount2 float64 `json:"itemamount2,string,omitempty"`
ItemTaxed2 int64 `json:"itemtaxed2,string,omitempty"`
}
func (r *CreateInvoiceRequest) Error() error {
return nil
}
// CreateInvoiceResponse is the WHMCS response when creating an invoice.
type CreateInvoiceResponse struct {
Result string `json:"result"`
InvoiceID int64 `json:"invoiceid"`
}
// UpdateInvoiceResponse is the WHMCS response when updating an invoice.
type UpdateInvoiceResponse struct {
Result string `json:"result"`
InvoiceID int64 `json:"invoiceid,string"`
}
// UpdateInvoiceRequest contains the parameters available to update an existing invoice.
type UpdateInvoiceRequest struct {
InvoiceID int64 `json:"invoiceid,string"`
// Optional attributes
Status string `json:"status,omitempty"`
Date InvoiceDate `json:"date,omitempty"`
DueDate InvoiceDate `json:"duedate,omitempty"`
PaymentMethod string `json:"paymentmethod,omitempty"`
}
func (r *UpdateInvoiceRequest) Error() error {
return nil
}