Documentation ¶
Index ¶
- Constants
- type Address
- type Client
- func (s *Client) GetOrder(token string) (*Order, error)
- func (s *Client) GetOrderNotifications(token string) (*OrderNotifications, error)
- func (s *Client) GetOrders(queries map[string]string) (*Orders, error)
- func (s *Client) GetOrdersByStatus(status OrderStatus) (*Orders, error)
- func (s *Client) GetProductById(id string) (*Product, error)
- func (s *Client) GetProducts(queries map[string]string) (*ProductsResponse, error)
- func (s *Client) SendNotification(token string, notification *Notification) (*NotificationResponse, error)
- func (s *Client) UpdateOrder(token string, orderUpdate *OrderUpdate) (*Order, error)
- func (s *Client) ValidateWebhook(token string) error
- type CustomField
- type Item
- type Notification
- type NotificationResponse
- type NotificationType
- type Order
- type OrderNotification
- type OrderNotifications
- type OrderStatus
- type OrderTax
- type OrderUpdate
- type Orders
- type Product
- type ProductCustomField
- type ProductVariant
- type ProductsResponse
- type ShippingError
- type ShippingErrors
- type Tax
- type TaxContent
- type TaxResponse
- type TaxShippingInfo
- type TaxWebhook
Constants ¶
View Source
const ( Processed OrderStatus = "Processed" Disputed OrderStatus = "Disputed" Shipped OrderStatus = "Shipped" Delivered OrderStatus = "Delivered" Pending OrderStatus = "Pending" Cancelled OrderStatus = "Cancelled" Dispatched OrderStatus = "Dispatched" Comment NotificationType = "Comment" OrderStatusChanged NotificationType = "OrderStatusChanged" OrderShipped NotificationType = "OrderShipped" TrackingNumber NotificationType = "TrackingNumber" Invoice NotificationType = "Invice" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶ added in v0.3.1
type Address struct { FullName string `json:"fullName"` FirstName string `json:"firstName"` Name string `json:"name"` Company string `json:"company"` Address1 string `json:"address1"` Address2 string `json:"address2"` FullAddress string `json:"fullAddress"` City string `json:"city"` Country string `json:"country"` PostalCode string `json:"postalCode"` Province string `json:"province"` Phone string `json:"phone"` VatNumber string `json:"vatNumber,omitempty"` }
type Client ¶ added in v0.1.0
func (*Client) GetOrderNotifications ¶ added in v0.4.0
func (s *Client) GetOrderNotifications(token string) (*OrderNotifications, error)
func (*Client) GetOrdersByStatus ¶ added in v0.1.0
func (s *Client) GetOrdersByStatus(status OrderStatus) (*Orders, error)
func (*Client) GetProductById ¶ added in v0.2.2
func (*Client) GetProducts ¶ added in v0.2.1
func (s *Client) GetProducts(queries map[string]string) (*ProductsResponse, error)
func (*Client) SendNotification ¶ added in v0.1.15
func (s *Client) SendNotification(token string, notification *Notification) (*NotificationResponse, error)
func (*Client) UpdateOrder ¶ added in v0.1.0
func (s *Client) UpdateOrder(token string, orderUpdate *OrderUpdate) (*Order, error)
func (*Client) ValidateWebhook ¶ added in v0.1.16
type CustomField ¶ added in v0.3.1
type Item ¶ added in v0.3.1
type Item struct { UUID string `json:"uniqueId"` ID string `json:"id"` Name string `json:"name"` Quantity int `json:"quantity"` TotalWeight float64 `json:"totalWeight,omitempty"` TotalPrice float64 `json:"totalPrice,omitempty"` CustomFields []CustomField `json:"customFields"` Length float64 `json:"length,omitempty"` Width float64 `json:"width,omitempty"` Height float64 `json:"height,omitempty"` Weight float64 `json:"weight,omitempty"` Shippable bool `json:"shippable,omitempty"` }
type Notification ¶ added in v0.3.1
type Notification struct { Type NotificationType `json:"type"` DeliveryMethod string `json:"deliveryMethod"` Message string `json:"message,omitempty"` }
type NotificationResponse ¶ added in v0.3.1
type NotificationResponse struct { Id string `json:"id"` Created time.Time `json:"creationDate"` Type NotificationType `json:"type"` DeliveryMethod string `json:"deliveryMethod"` Body string `json:"body"` Message string `json:"message"` Subject string `json:"subject"` SentOn time.Time `json:"sentOn"` }
type NotificationType ¶ added in v0.1.15
type NotificationType string
type Order ¶ added in v0.3.1
type Order struct { Token string `json:"token"` Created time.Time `json:"creationDate"` Modified time.Time `json:"modificationDate"` Completed time.Time `json:"completionDate"` Invoice string `json:"invoiceNumber"` Subtotal float64 `json:"subtotal,omitempty"` Currency string `json:"currency,omitempty"` Total float64 `json:"grandTotal,omitempty"` TotalTaxable float64 `json:"taxableTotal,omitempty"` TotalTaxes float64 `json:"taxesTotal,omitempty"` Status string `json:"status"` TotalWeight float64 `json:"totalWeight"` ShippingAddressSameAsBilling bool `json:"shippingAddressSameAsBilling,omitempty"` ShippingAddress Address `json:"shippingAddress,omitempty"` Name string `json:"shippingAddressName,omitempty"` Company string `json:"shippingAddressCompanyName,omitempty"` Address1 string `json:"shippingAddressAddress1,omitempty"` Address2 string `json:"shippingAddressAddress2,omitempty"` City string `json:"shippingAddressCity,omitempty"` Province string `json:"shippingAddressProvince,omitempty"` Country string `json:"shippingAddressCountry,omitempty"` PostalCode string `json:"shippingAddressPostalCode,omitempty"` Phone string `json:"shippingAddressPhone,omitempty"` Email string `json:"email,omitempty"` TrackingNumber string `json:"trackingNumber"` TrackingUrl string `json:"trackingUrl"` ShippingCost float64 `json:"shippingFees"` ShippingProvider string `json:"shippingProvider,omitempty"` ShippingMethod string `json:"shippingMethod,omitempty"` ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"` Items []Item `json:"items"` Taxes []OrderTax `json:"taxes,omitempty"` Metadata any `json:"metadata"` }
func (*Order) TokenPNGBase64 ¶ added in v0.3.1
type OrderNotification ¶ added in v0.4.0
type OrderNotification struct { Id string `json:"id"` Created time.Time `json:"creationDate"` Type NotificationType `json:"type"` DeliveryMethod string `json:"deliveryMethod"` Message string `json:"message,omitempty"` SendDate time.Time `json:"sentOn,omitempty"` Subject string `json:"subject,omitempty"` }
type OrderNotifications ¶ added in v0.4.0
type OrderNotifications struct { TotalNotifications int `json:"totalItems"` Offset int `json:"offset"` Limit int `json:"limit"` Notifications []OrderNotification `json:"items"` }
type OrderStatus ¶
type OrderStatus string
type OrderUpdate ¶ added in v0.3.1
type OrderUpdate struct { Status OrderStatus `json:"status"` PaymentStatus string `json:"paymentStatus,omitempty"` TrackingNumber string `json:"trackingNumber,omitempty"` TrackingUrl string `json:"trackingUrl,omitempty"` ShippingRateId string `json:"shippingRateUserDefinedId,omitempty"` Metadata any `json:"metadata,omitempty"` }
type Product ¶ added in v0.3.1
type Product struct { Token string `json:"id"` Id string `json:"userDefinedId"` Name string `json:"name"` Stock int `json:"stock"` TotalStock int `json:"totalStock"` AllowBackorder bool `json:"allowOutOfStockPurchases"` CustomFields []ProductCustomField `json:"customFields"` Variants []ProductVariant `json:"variants"` }
type ProductCustomField ¶ added in v0.3.1
type ProductCustomField struct { Name string `json:"name"` Placeholder string `json:"placeholder"` DisplayValue string `json:"displayValue"` Type string `json:"type"` Options string `json:"options"` Required bool `json:"required"` Value string `json:"value"` Operation float64 `json:"operation"` OptionsArray []string `json:"optionsArray"` }
type ProductVariant ¶ added in v0.3.1
type ProductsResponse ¶ added in v0.3.1
type ProductsResponse struct { Keywords string `json:"keywords"` UserDefinedId string `json:"userDefinedId"` Archived bool `json:"archived"` From time.Time `json:"from"` To time.Time `json:"to"` OrderBy string `json:"orderBy"` Paginated bool `json:"hasMoreResults"` TotalItems int `json:"totalItems"` Offset int `json:"offset"` Limit int `json:"limit"` Sort []any `json:"sort"` Items []Product `json:"items"` }
type ShippingError ¶ added in v0.3.4
type ShippingErrors ¶ added in v0.3.4
type ShippingErrors struct {
Errors []ShippingError `json:"errors"`
}
type TaxContent ¶ added in v0.3.1
type TaxContent struct { Created int `json:"creationDate"` Modified int `json:"modificationDate"` Token string `json:"token"` Email string `json:"email"` ShipToBillingAddress bool `json:"shipToBillingAddress"` BillingAddress Address `json:"billingAddress"` ShippingAddress Address `json:"shippingAddress"` InvoiceNumber string `json:"invoiceNumber"` ShippingInformation TaxShippingInfo `json:"shippingInformation"` Items []Item `json:"items"` Discounts []any `json:"discounts"` CustomFields []CustomField `json:"customFields"` Plans []any `json:"plans"` Refunds []any `json:"refunds"` Taxes []any `json:"taxes"` Currency string `json:"currency"` Total float64 `json:"total"` DiscountsTotal float64 `json:"discountsTotal"` ItemsTotal float64 `json:"itemsTotal"` TaxesTotal float64 `json:"taxesTotal"` PlansTotal float64 `json:"plansTotal"` TaxProvider any `json:"taxProvider"` Metadata any `json:"metadata"` }
type TaxResponse ¶ added in v0.3.1
type TaxResponse struct {
Taxes []Tax `json:"taxes"`
}
type TaxShippingInfo ¶ added in v0.3.1
type TaxWebhook ¶ added in v0.3.2
type TaxWebhook struct {
Content TaxContent `json:"content"`
}
Click to show internal directories.
Click to hide internal directories.