Documentation
¶
Index ¶
- Constants
- type AddFileData
- type AddFileUrl
- type AddressTo
- type ApiRequest
- type Blueprint
- type CatalogPlaceholder
- type CatalogVariant
- type CatalogVariantOption
- type Client
- func (c *Client) AddUpload(path string) (*Upload, error)
- func (c *Client) AddUploads(uploadItems []Upload) (*Upload, error)
- func (c *Client) CalculateShippingCosts(shopId int, order *OrderSubmission) (*ShippingCost, error)
- func (c *Client) CancelOrder(shopId, orderId int) (*Order, error)
- func (c *Client) CreateProduct(shopId int, product ProductCreation) (*Product, error)
- func (c *Client) DeleteProduct(shopId int, productId string) error
- func (c *Client) DeleteShop(Id int) error
- func (c *Client) GetAllProducts(shopId int) ([]Product, error)
- func (c *Client) GetAllUploads() ([]Upload, error)
- func (c *Client) GetAvailablePrintProviders() ([]*PrintProvider, error)
- func (c *Client) GetBlueprint(Id int) (*Blueprint, error)
- func (c *Client) GetOrderDetails(shopId, orderId int) (*Order, error)
- func (c *Client) GetPrintProvider(Id int) (*PrintProvider, error)
- func (c *Client) GetPrintProviders(blueprintId int) ([]*PrintProvider, error)
- func (c *Client) GetProduct(shopId int, productId string) (*Product, error)
- func (c *Client) GetProducts(shopId int, page *int) (*ProductsResponse, error)
- func (c *Client) GetShippingInformation(blueprintId, providerId int) (*ShippingProperties, error)
- func (c *Client) GetUploads(page *int) (*UploadsResponse, error)
- func (c *Client) GetVariants(blueprintId, providerId int) (*PrintProvider, error)
- func (c *Client) ListBluePrints() ([]*Blueprint, error)
- func (c *Client) ListShopOrders(shopId int, page, limit *int, statusFilter *string) ([]*Order, error)
- func (c *Client) ListShops() ([]*Shop, error)
- func (c *Client) PublishProduct(shopId int, productId string, publishProperties PublishingProperties) error
- func (c *Client) SendOrderToProduction(shopId, orderId int) (*Order, error)
- func (c *Client) SetProductPublishFailre(shopId int, productId string, reason string) error
- func (c *Client) SetProductPublishSuccess(shopId int, productId string, external External) error
- func (c *Client) SubmitOrder(shopId int, order *OrderSubmission) error
- func (c *Client) UnPublish(shopId int, productId string) error
- func (c *Client) UpdateProduct(shopId int, product *Product) (*Product, error)
- type External
- type LineItem
- type LineItemMetadata
- type Order
- type OrderMetadata
- type OrderSubmission
- type PrintArea
- type PrintDetails
- type PrintProvider
- type Product
- type ProductCreation
- type ProductCreationVariant
- type ProductImage
- type ProductMockUpImage
- type ProductPlaceholder
- type ProductVariant
- type ProductsResponse
- type PublishingProperties
- type Shipment
- type ShippingCost
- type ShippingProperties
- type Shop
- type Upload
- type UploadsResponse
Constants ¶
const ( BlueprintProviderVariantsPath = "catalog/blueprints/%d/print_providers/%d/variants.json" BluePrintProviderShippingPath = "catalog/blueprints/%d/print_providers/%d/shipping.json" PrintProvidersPath = "catalog/print_providers.json" PrintProviderPath = "catalog/print_providers/%d.json" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AddFileData ¶
type AddFileUrl ¶
type AddressTo ¶
type AddressTo struct {
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
Country string `json:"country,omitempty"`
Region string `json:"region,omitempty"`
Address1 string `json:"address1,omitempty"`
Address2 string `json:"address2,omitempty"`
City string `json:"city,omitempty"`
Zip string `json:"zip,omitempty"`
}
type ApiRequest ¶
type CatalogPlaceholder ¶
type CatalogVariant ¶
type CatalogVariant struct {
Id int `json:"id"`
Title string `json:"title"`
Options *CatalogVariantOption `json:"options"`
Placeholders []*CatalogPlaceholder `json:"placeholders"`
}
type CatalogVariantOption ¶
type Client ¶
type Client struct {
BaseURL *url.URL
ApiVersion string
UserAgent string
// contains filtered or unexported fields
}
func (*Client) CalculateShippingCosts ¶
func (c *Client) CalculateShippingCosts(shopId int, order *OrderSubmission) (*ShippingCost, error)
Calculate the shipping cost of an order
func (*Client) CancelOrder ¶
Cancel an order
func (*Client) CreateProduct ¶
func (c *Client) CreateProduct(shopId int, product ProductCreation) (*Product, error)
Create a new product
func (*Client) DeleteProduct ¶
Delete a product
func (*Client) GetAllProducts ¶
Retrieve a list of products
func (*Client) GetAllUploads ¶
func (*Client) GetAvailablePrintProviders ¶
func (c *Client) GetAvailablePrintProviders() ([]*PrintProvider, error)
Retrieve a list of available print providers
func (*Client) GetBlueprint ¶
Retrieve a specific blueprint
func (*Client) GetOrderDetails ¶
Get order details by ID
func (*Client) GetPrintProvider ¶
func (c *Client) GetPrintProvider(Id int) (*PrintProvider, error)
Retrieve a specific print provider and a list of associated blueprint offerings
func (*Client) GetPrintProviders ¶
func (c *Client) GetPrintProviders(blueprintId int) ([]*PrintProvider, error)
Retrieve a list of all print providers that fulfill orders for a specific blueprint
func (*Client) GetProduct ¶
Retrieve a product
func (*Client) GetProducts ¶
func (c *Client) GetProducts(shopId int, page *int) (*ProductsResponse, error)
func (*Client) GetShippingInformation ¶
func (c *Client) GetShippingInformation(blueprintId, providerId int) (*ShippingProperties, error)
Retrieve shipping information
func (*Client) GetUploads ¶
func (c *Client) GetUploads(page *int) (*UploadsResponse, error)
func (*Client) GetVariants ¶
func (c *Client) GetVariants(blueprintId, providerId int) (*PrintProvider, error)
Retrieve a list of variants of a blueprint from a specific print provider
func (*Client) ListBluePrints ¶
Retrieve a list of available blueprints
func (*Client) ListShopOrders ¶
func (c *Client) ListShopOrders(shopId int, page, limit *int, statusFilter *string) ([]*Order, error)
Retrieve a list of orders
func (*Client) PublishProduct ¶
func (c *Client) PublishProduct(shopId int, productId string, publishProperties PublishingProperties) error
Publish a product
func (*Client) SendOrderToProduction ¶
Send an existing order to production
func (*Client) SetProductPublishFailre ¶
Set product publish status to failed
func (*Client) SetProductPublishSuccess ¶
Set product publish status to succeeded
func (*Client) SubmitOrder ¶
func (c *Client) SubmitOrder(shopId int, order *OrderSubmission) error
Submit an order
type LineItem ¶
type LineItem struct {
Id *int `json:"id,omitempty"`
VariantId *int `json:"variant_id,omitempty"`
ProductId *string `json:"product_id,omitempty"`
BlueprintId *int `json:"blueprint_id,omitempty"`
Quantity int `json:"quantity"`
PrintProviderId *int `json:"print_provider_id,omitempty"`
PrintAreas *map[string]string `json:"print_areas,omitempty"`
PrintDetails *PrintDetails `json:"print_details,omitempty"`
Cost *float32 `json:"cost,omitempty"`
Sku *string `json:"sku,omitempty"`
ShippingCost *float32 `json:"shipping_cost,omitempty"`
Status *string `json:"status,omitempty"`
Metadata *LineItemMetadata `json:"metadata,omitempty"`
SentToProductionAt *time.Time `json:"sent_to_production_at,omitempty"`
FulfilledAt *time.Time `json:"fulfilled_at,omitempty"`
}
type LineItemMetadata ¶
type Order ¶
type Order struct {
Id *int `json:"id,omitempty"`
LineItems []*LineItem `json:"line_items"`
AddressTo *AddressTo `json:"address_to,omitempty"`
Metadata *OrderMetadata `json:"metadata,omitempty"`
TotalPrice *float32 `json:"total_price,omitempty"`
TotalShipping *float32 `json:"total_shipping,omitempty"`
TotalTax *float32 `json:"total_tax,omitempty"`
Status *string `json:"status,omitempty"`
ShippingMethod int `json:"shipping_method,omitempty"`
SendShippingNotification *bool `json:"send_shipping_notification,omitempty"`
Shipments []*Shipment `json:"shipments,omitempty"`
CreatedAt *time.Time `json:"created_at,omitempty"`
SentToProductionAt *time.Time `json:"sent_to_production_at,omitempty"`
FulfilledAt *time.Time `json:"fulfilled_at,omitempty"`
}
type OrderMetadata ¶
type OrderSubmission ¶
type OrderSubmission struct {
ExternalID string `json:"external_id,omitempty"`
Label string `json:"label,omitempty"`
LineItems []*LineItem `json:"line_items"`
ShippingMethod int `json:"shipping_method,omitempty"`
SendShippingNotification *bool `json:"send_shipping_notification,omitempty"`
AddressTo *AddressTo `json:"address_to"`
}
type PrintArea ¶
type PrintArea struct {
VariantIds []int `json:"variant_ids"`
Placeholders []ProductPlaceholder `json:"placeholders"`
}
type PrintDetails ¶
type PrintDetails struct {
PrintOnSide string `json:"print_on_side"`
}
type PrintProvider ¶
type PrintProvider struct {
Id int `json:"id"`
Title string `json:"title"`
Location *map[string]string `json:"location,omitempty"`
Variants []*CatalogVariant `json:"variants,omitempty"`
}
type Product ¶
type Product struct {
Id string `json:"id,omitempty"`
Title string `json:"title"`
Description string `json:"description"`
Tags []string `json:"tags"`
Options []map[string]interface{} `json:"options"`
Variants []ProductVariant `json:"variants"`
Images []ProductMockUpImage `json:"images"`
CreatedAt string `json:"created_at,omitempty"`
UpdatedAt string `json:"updated_at,omitempty"`
Visible bool `json:"visible"`
BlueprintId int `json:"blueprint_id"`
PrintProviderId int `json:"print_provider_id"`
UserId int `json:"user_id"`
ShopId int `json:"shop_id"`
PrintAreas []PrintArea `json:"print_areas"`
PrintDetails []PrintDetails `json:"print_details"`
External *External `json:"external,omitempty"`
IsLocked bool `json:"is_locked"`
SalesChannelProperties []string `json:"sales_channel_properties,omitempty"`
}
type ProductCreation ¶
type ProductCreationVariant ¶
type ProductImage ¶
type ProductMockUpImage ¶
type ProductPlaceholder ¶
type ProductPlaceholder struct {
Position string `json:"position"`
Images []ProductImage `json:"images"`
}
type ProductVariant ¶
type ProductVariant struct {
Id int `json:"id"`
Sku string `json:"sku"`
Price float32 `json:"price"`
Cost float32 `json:"cost"`
Title string `json:"title"`
Grams int `json:"grams"`
IsEnabled bool `json:"is_enabled"`
InStock bool `json:"in_stock"` // Deprecated
IsDefault bool `json:"is_default"`
IsAvailable bool `json:"is_available"`
Options []int `json:"options"`
}
type ProductsResponse ¶
type ProductsResponse struct {
CurrentPage int `json:"current_page"`
Data []Product `json:"data"`
FirstPageUrl string `json:"first_page_url"`
LastPageUrl string `json:"last_page_url"`
NextPageUrl string `json:"next_page_url"`
From int `json:"from"`
LastPage int `json:"last_page"`
Path string `json:"path"`
PerPage int `json:"per_page"`
PrevPageUrl string `json:"prev_page_url"`
To int `json:"to"`
Total int `json:"total"`
}
type PublishingProperties ¶
type ShippingCost ¶
type ShippingProperties ¶
type ShippingProperties struct {
HandlingTime struct {
Value int `json:"value"`
Unit string `json:"unit"`
} `json:"handling_time"`
Profiles struct {
VariantIds []int `json:"variant_ids"`
FirstItem priceTag `json:"first_item"`
AdditionalItems priceTag `json:"additional_items"`
Countries []string `json:"countries"`
} `json:"profiles"`
}
type UploadsResponse ¶
type UploadsResponse struct {
CurrentPage int `json:"current_page"`
Data []Upload `json:"data"`
FirstPageUrl string `json:"first_page_url"`
LastPageUrl string `json:"last_page_url"`
NextPageUrl string `json:"next_page_url"`
From int `json:"from"`
LastPage int `json:"last_page"`
Path string `json:"path"`
PerPage int `json:"per_page"`
PrevPageUrl string `json:"prev_page_url"`
To int `json:"to"`
Total int `json:"total"`
}