Compare commits

...

5 Commits

Author SHA1 Message Date
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
2 changed files with 49 additions and 31 deletions

View File

@@ -26,6 +26,13 @@ type Item struct {
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 {
Token string `json:"token"`
Created time.Time `json:"creationDate"`
@@ -54,6 +61,7 @@ type Order struct {
ShippingMethod string `json:"shippingMethod,omitempty"`
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
Items []Item `json:"items"`
Taxes []OrderTax `json:"taxes,omitempty"`
Metadata any `json:"metadata"`
}
@@ -68,6 +76,8 @@ type OrderUpdate struct {
type Orders struct {
TotalItems int
Offest int
Limit int
Items []Order
}

View File

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