Compare commits

..

2 Commits

Author SHA1 Message Date
Bastian de Byl
b08b64f5b2 added SnipcartTax and SnipcartWebhookTaxResponse 2023-04-06 17:59:48 -04:00
Bastian de Byl
ad93704f41 renamed Order.ShippingRate to Order.ShippingRateId 2023-04-03 21:20:22 -04:00
2 changed files with 12 additions and 1 deletions

View File

@@ -70,7 +70,7 @@ type SnipcartOrder struct {
ShippingCost float64 `json:"shippingFees"`
ShippingProvider string `json:"shippingProvider,omitempty"`
ShippingMethod string `json:"shippingMethod,omitempty"`
ShippingRate string `json:"shippingRateUserDefinedId,omitempty"`
ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"`
Items []SnipcartItem `json:"items"`
Metadata any `json:"metadata"`
}
@@ -88,6 +88,13 @@ type SnipcartOrders struct {
Items []SnipcartOrder
}
type SnipcartTax struct {
Name string `json:"name"`
Amount float64 `json:"amount"`
NumberForInvoice string `json:"numberForInvoice"`
Rate float64 `json:"rate"`
}
func NewClient(snipcartApiKey string) Client {
return Client{
SnipcartKey: snipcartApiKey,

View File

@@ -15,3 +15,7 @@ type SnipcartShippingAddress struct {
Phone string `json:"phone"`
VatNumber string `json:"vatNumber,omitempty"`
}
type SnipcartWebhookTaxResponse struct {
Taxes []SnipcartTax `json:"taxes"`
}