Compare commits

..

9 Commits

Author SHA1 Message Date
Bastian de Byl
805491571c added missing Completed field for completion date of order 2023-07-29 17:34:01 -04:00
Bastian de Byl
10a9427598 corrected CustomField.Options field to string from []string 2023-07-27 13:48:13 -04:00
Bastian de Byl
3816c67b95 added more data types to CustomField struct 2023-07-27 13:44:06 -04:00
Bastian de Byl
c18376739b added TotalTaxable to Order 2023-07-03 13:31:26 -04:00
Bastian de Byl
6d85149be8 corrected Taxes to Order (new OrderTax struct) 2023-07-03 13:21:06 -04:00
Bastian de Byl
cf4ad9642d added Taxes to Order (omitempty) 2023-07-03 13:18:42 -04:00
Bastian de Byl
e1adf8cf4f added Offset and Limit to Orders struct 2023-07-03 12:14:40 -04:00
Bastian de Byl
73195a090f added ShippingError and ShippingErrors struct 2023-06-06 19:54:21 -04:00
Bastian de Byl
db81f246bf corrected TaxContent time for epoch (unix time) int from time.Time 2023-06-06 19:12:01 -04:00
3 changed files with 56 additions and 33 deletions

View File

@@ -37,6 +37,9 @@ type Client struct {
} }
type CustomField struct { type CustomField struct {
Name string `json:"name"` Name string `json:"name"`
Value string `json:"value"` Value string `json:"value"`
Type string `json:"type,omitempty"`
Options string `json:"options,omitempty"`
Required bool `json:"required"`
} }

View File

@@ -26,35 +26,45 @@ type Item struct {
Shippable bool `json:"shippable,omitempty"` Shippable bool `json:"shippable,omitempty"`
} }
type OrderTax struct {
Name string `json:"taxName"`
Rate float64 `json:"taxRate"`
Amount float64 `json:"amount"`
NumberForInvoice string `json:"numberForInvoice"`
}
type Order struct { type Order struct {
Token string `json:"token"` Token string `json:"token"`
Created time.Time `json:"creationDate"` Created time.Time `json:"creationDate"`
Modified time.Time `json:"modificationDate"` Modified time.Time `json:"modificationDate"`
Invoice string `json:"invoiceNumber"` Completed time.Time `json:"completionDate"`
Subtotal float64 `json:"subtotal,omitempty"` Invoice string `json:"invoiceNumber"`
Currency string `json:"currency,omitempty"` Subtotal float64 `json:"subtotal,omitempty"`
Total float64 `json:"grandTotal,omitempty"` Currency string `json:"currency,omitempty"`
Status string `json:"status"` Total float64 `json:"grandTotal,omitempty"`
TotalWeight float64 `json:"totalWeight"` TotalTaxable float64 `json:"taxableTotal,omitempty"`
ShippingAddress Address `json:"shippingAddress,omitempty"` Status string `json:"status"`
Name string `json:"shippingAddressName,omitempty"` TotalWeight float64 `json:"totalWeight"`
Company string `json:"shippingAddressCompanyName,omitempty"` ShippingAddress Address `json:"shippingAddress,omitempty"`
Address1 string `json:"shippingAddressAddress1,omitempty"` Name string `json:"shippingAddressName,omitempty"`
Address2 string `json:"shippingAddressAddress2,omitempty"` Company string `json:"shippingAddressCompanyName,omitempty"`
City string `json:"shippingAddressCity,omitempty"` Address1 string `json:"shippingAddressAddress1,omitempty"`
Province string `json:"shippingAddressProvince,omitempty"` Address2 string `json:"shippingAddressAddress2,omitempty"`
Country string `json:"shippingAddressCountry,omitempty"` City string `json:"shippingAddressCity,omitempty"`
PostalCode string `json:"shippingAddressPostalCode,omitempty"` Province string `json:"shippingAddressProvince,omitempty"`
Phone string `json:"shippingAddressPhone,omitempty"` Country string `json:"shippingAddressCountry,omitempty"`
Email string `json:"email,omitempty"` PostalCode string `json:"shippingAddressPostalCode,omitempty"`
TrackingNumber string `json:"trackingNumber"` Phone string `json:"shippingAddressPhone,omitempty"`
TrackingUrl string `json:"trackingUrl"` Email string `json:"email,omitempty"`
ShippingCost float64 `json:"shippingFees"` TrackingNumber string `json:"trackingNumber"`
ShippingProvider string `json:"shippingProvider,omitempty"` TrackingUrl string `json:"trackingUrl"`
ShippingMethod string `json:"shippingMethod,omitempty"` ShippingCost float64 `json:"shippingFees"`
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"` ShippingProvider string `json:"shippingProvider,omitempty"`
Items []Item `json:"items"` ShippingMethod string `json:"shippingMethod,omitempty"`
Metadata any `json:"metadata"` ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
Items []Item `json:"items"`
Taxes []OrderTax `json:"taxes,omitempty"`
Metadata any `json:"metadata"`
} }
type OrderUpdate struct { type OrderUpdate struct {
@@ -68,6 +78,8 @@ type OrderUpdate struct {
type Orders struct { type Orders struct {
TotalItems int TotalItems int
Offest int
Limit int
Items []Order Items []Order
} }

View File

@@ -4,17 +4,25 @@ import (
"encoding/base64" "encoding/base64"
"fmt" "fmt"
"net/http" "net/http"
"time"
) )
type ShippingError struct {
Key string `json:"key"`
Message string `json:"message"`
}
type ShippingErrors struct {
Errors []ShippingError `json:"errors"`
}
type TaxShippingInfo struct { type TaxShippingInfo struct {
Fees float64 `json:"fees"` Fees float64 `json:"fees"`
Method string `json:"method"` Method string `json:"method"`
} }
type TaxContent struct { type TaxContent struct {
Created time.Time `json:"creationDate"` Created int `json:"creationDate"`
Modified time.Time `json:"modificationDate"` Modified int `json:"modificationDate"`
Token string `json:"token"` Token string `json:"token"`
Email string `json:"email"` Email string `json:"email"`
ShipToBillingAddress bool `json:"shipToBillingAddress"` ShipToBillingAddress bool `json:"shipToBillingAddress"`