Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3816c67b95 | ||
|
|
c18376739b | ||
|
|
6d85149be8 | ||
|
|
cf4ad9642d | ||
|
|
e1adf8cf4f | ||
|
|
73195a090f | ||
|
|
db81f246bf | ||
|
|
9c7218f937 | ||
|
|
543935289f |
@@ -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"`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -26,35 +26,44 @@ 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"`
|
Invoice string `json:"invoiceNumber"`
|
||||||
Subtotal float64 `json:"subtotal,omitempty"`
|
Subtotal float64 `json:"subtotal,omitempty"`
|
||||||
Currency string `json:"currency,omitempty"`
|
Currency string `json:"currency,omitempty"`
|
||||||
Total float64 `json:"grandTotal,omitempty"`
|
Total float64 `json:"grandTotal,omitempty"`
|
||||||
Status string `json:"status"`
|
TotalTaxable float64 `json:"taxableTotal,omitempty"`
|
||||||
TotalWeight float64 `json:"totalWeight"`
|
Status string `json:"status"`
|
||||||
ShippingAddress Address `json:"shippingAddress,omitempty"`
|
TotalWeight float64 `json:"totalWeight"`
|
||||||
Name string `json:"shippingAddressName,omitempty"`
|
ShippingAddress Address `json:"shippingAddress,omitempty"`
|
||||||
Company string `json:"shippingAddressCompanyName,omitempty"`
|
Name string `json:"shippingAddressName,omitempty"`
|
||||||
Address1 string `json:"shippingAddressAddress1,omitempty"`
|
Company string `json:"shippingAddressCompanyName,omitempty"`
|
||||||
Address2 string `json:"shippingAddressAddress2,omitempty"`
|
Address1 string `json:"shippingAddressAddress1,omitempty"`
|
||||||
City string `json:"shippingAddressCity,omitempty"`
|
Address2 string `json:"shippingAddressAddress2,omitempty"`
|
||||||
Province string `json:"shippingAddressProvince,omitempty"`
|
City string `json:"shippingAddressCity,omitempty"`
|
||||||
Country string `json:"shippingAddressCountry,omitempty"`
|
Province string `json:"shippingAddressProvince,omitempty"`
|
||||||
PostalCode string `json:"shippingAddressPostalCode,omitempty"`
|
Country string `json:"shippingAddressCountry,omitempty"`
|
||||||
Phone string `json:"shippingAddressPhone,omitempty"`
|
PostalCode string `json:"shippingAddressPostalCode,omitempty"`
|
||||||
Email string `json:"email,omitempty"`
|
Phone string `json:"shippingAddressPhone,omitempty"`
|
||||||
TrackingNumber string `json:"trackingNumber"`
|
Email string `json:"email,omitempty"`
|
||||||
TrackingUrl string `json:"trackingUrl"`
|
TrackingNumber string `json:"trackingNumber"`
|
||||||
ShippingCost float64 `json:"shippingFees"`
|
TrackingUrl string `json:"trackingUrl"`
|
||||||
ShippingProvider string `json:"shippingProvider,omitempty"`
|
ShippingCost float64 `json:"shippingFees"`
|
||||||
ShippingMethod string `json:"shippingMethod,omitempty"`
|
ShippingProvider string `json:"shippingProvider,omitempty"`
|
||||||
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
|
ShippingMethod string `json:"shippingMethod,omitempty"`
|
||||||
Items []Item `json:"items"`
|
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
|
||||||
Metadata any `json:"metadata"`
|
Items []Item `json:"items"`
|
||||||
|
Taxes []OrderTax `json:"taxes,omitempty"`
|
||||||
|
Metadata any `json:"metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderUpdate struct {
|
type OrderUpdate struct {
|
||||||
@@ -68,6 +77,8 @@ type OrderUpdate struct {
|
|||||||
|
|
||||||
type Orders struct {
|
type Orders struct {
|
||||||
TotalItems int
|
TotalItems int
|
||||||
|
Offest int
|
||||||
|
Limit int
|
||||||
Items []Order
|
Items []Order
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -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"`
|
||||||
@@ -38,6 +46,10 @@ type TaxContent struct {
|
|||||||
Metadata any `json:"metadata"`
|
Metadata any `json:"metadata"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type TaxWebhook struct {
|
||||||
|
Content TaxContent `json:"content"`
|
||||||
|
}
|
||||||
|
|
||||||
type Tax struct {
|
type Tax struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Amount float64 `json:"amount"`
|
Amount float64 `json:"amount"`
|
||||||
|
|||||||
Reference in New Issue
Block a user