Documentation
¶
Index ¶
- type Config
- type OrderNotesBody
- type OrderNotesReturn
- type OrdersReturn
- type ProductAttributeTermBody
- type ProductAttributeTermsReturn
- func CreateProductAttributeTerms(attributeId int, body ProductAttributeTermBody, r Request) (ProductAttributeTermsReturn, error)
- func DeleteProductAttributeTerms(attributeId, termId int, force bool, r Request) (ProductAttributeTermsReturn, error)
- func ProductAttributeTerms(attributeId int, r Request) ([]ProductAttributeTermsReturn, error)
- func UpdateProductAttributeTerms(attributeId, termId int, body ProductAttributeTermBody, r Request) (ProductAttributeTermsReturn, error)
- type ProductAttributesBody
- type ProductAttributesReturn
- func CreateProductAttributes(body ProductAttributesBody, r Request) (ProductAttributesReturn, error)
- func DeleteProductAttributes(id int, r Request) (ProductAttributesReturn, error)
- func ProductAttributes(r Request) ([]ProductAttributesReturn, error)
- func UpdateProductAttributes(id int, body ProductAttributesBody, r Request) (ProductAttributesReturn, error)
- type ProductCategoriesReturn
- func AddProductCategory(body ProductCategory, r Request) (ProductCategoriesReturn, error)
- func DeleteProductCategory(id int, force bool, r Request) (ProductCategoriesReturn, error)
- func ProductCategories(r Request) ([]ProductCategoriesReturn, error)
- func UpdateProductCategory(id int, body ProductCategory, r Request) (ProductCategoriesReturn, error)
- type ProductCategory
- type ProductCategoryImage
- type ProductTagsBody
- type ProductTagsReturn
- func CreateProductTag(body ProductTagsBody, r Request) (ProductTagsReturn, error)
- func DeleteProductTag(id int, force bool, r Request) (ProductTagsReturn, error)
- func ProductTag(id int, r Request) (ProductTagsReturn, error)
- func ProductTags(r Request) ([]ProductTagsReturn, error)
- func UpdateProductTag(id int, body ProductTagsBody, r Request) (ProductTagsReturn, error)
- type ProductVariationsBody
- type ProductVariationsBodyAttributes
- type ProductVariationsBodyDimensions
- type ProductVariationsBodyImages
- type ProductVariationsReturn
- func CreateProductVariations(productId int, body ProductVariationsBody, r Request) (ProductVariationsReturn, error)
- func DeleteProductVariations(productId, variantId int, r Request) (ProductVariationsReturn, error)
- func ProductVariations(productId, page int, r Request) ([]ProductVariationsReturn, error)
- func UpdateProductVariations(productId, variantId int, body ProductVariationsBody, r Request) (ProductVariationsReturn, error)
- type ProductsBody
- type ProductsBodyAttributes
- type ProductsBodyCategories
- type ProductsBodyDimensions
- type ProductsBodyImages
- type ProductsBodyTags
- type ProductsReturn
- type Request
- type UpdateOrderBody
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrderNotesBody ¶ added in v1.2.9
type OrderNotesBody struct {
Note string `json:"note"`
CustomerNote bool `json:"customer_note"`
AddedByUser bool `json:"added_by_user"`
}
OrderNotesBody is to structure the data
type OrderNotesReturn ¶ added in v1.2.9
type OrderNotesReturn struct {
Id int `json:"id"`
Author string `json:"author"`
DateCreated string `json:"date_created"`
DateCreatedGmt string `json:"date_created_gmt"`
Note string `json:"note"`
CustomerNote bool `json:"customer_note"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
Up []struct {
Href string `json:"href"`
} `json:"up"`
} `json:"_links"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Data struct {
Status int `json:"status,omitempty"`
} `json:"data,omitempty"`
}
OrderNotesReturn is to decode the json return
func CreateOrderNote ¶ added in v1.2.9
func CreateOrderNote(id int, body OrderNotesBody, r Request) (OrderNotesReturn, error)
CreateOrderNote is to create an order note
type OrdersReturn ¶
type OrdersReturn struct {
Id int `json:"id"`
ParentId int `json:"parent_id"`
Status string `json:"status"`
Currency string `json:"currency"`
Version string `json:"version"`
PricesIncludeTax bool `json:"prices_include_tax"`
DateCreated string `json:"date_created"`
DateModified string `json:"date_modified"`
DiscountTotal string `json:"discount_total"`
DiscountTax string `json:"discount_tax"`
ShippingTotal string `json:"shipping_total"`
ShippingTax string `json:"shipping_tax"`
CartTax string `json:"cart_tax"`
Total string `json:"total"`
TotalTax string `json:"total_tax"`
CustomerId int `json:"customer_id"`
OrderKey string `json:"order_key"`
Billing struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Company string `json:"company"`
Address1 string `json:"address_1"`
Address2 string `json:"address_2"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Country string `json:"country"`
Email string `json:"email"`
Phone string `json:"phone"`
} `json:"billing"`
Shipping struct {
FirstName string `json:"first_name"`
LastName string `json:"last_name"`
Company string `json:"company"`
Address1 string `json:"address_1"`
Address2 string `json:"address_2"`
City string `json:"city"`
State string `json:"state"`
Postcode string `json:"postcode"`
Country string `json:"country"`
Phone string `json:"phone"`
} `json:"shipping"`
PaymentMethod string `json:"payment_method"`
PaymentMethodTitle string `json:"payment_method_title"`
TransactionId string `json:"transaction_id"`
CustomerIpAddress string `json:"customer_ip_address"`
CustomerUserAgent string `json:"customer_user_agent"`
CreatedVia string `json:"created_via"`
CustomerNote string `json:"customer_note"`
DateCompleted interface{} `json:"date_completed"`
DatePaid interface{} `json:"date_paid"`
CartHash string `json:"cart_hash"`
Number string `json:"number"`
MetaData []interface{} `json:"meta_data"`
LineItems []struct {
Id int `json:"id"`
Name string `json:"name"`
ProductId int `json:"product_id"`
VariationId int `json:"variation_id"`
Quantity int `json:"quantity"`
TaxClass string `json:"tax_class"`
Subtotal string `json:"subtotal"`
SubtotalTax string `json:"subtotal_tax"`
Total string `json:"total"`
TotalTax string `json:"total_tax"`
Taxes []struct {
Id int `json:"id"`
Total string `json:"total"`
Subtotal string `json:"subtotal"`
} `json:"taxes"`
MetaData []interface{} `json:"meta_data"`
Sku string `json:"sku"`
Price float64 `json:"price"`
ParentName interface{} `json:"parent_name"`
} `json:"line_items"`
TaxLines []struct {
Id int `json:"id"`
RateCode string `json:"rate_code"`
RateId int `json:"rate_id"`
Label string `json:"label"`
Compound bool `json:"compound"`
TaxTotal string `json:"tax_total"`
ShippingTaxTotal string `json:"shipping_tax_total"`
RatePercent int `json:"rate_percent"`
MetaData []interface{} `json:"meta_data"`
} `json:"tax_lines"`
ShippingLines []interface{} `json:"shipping_lines"`
FeeLines []interface{} `json:"fee_lines"`
CouponLines []interface{} `json:"coupon_lines"`
Refunds []interface{} `json:"refunds"`
DateCreatedGmt string `json:"date_created_gmt"`
DateModifiedGmt string `json:"date_modified_gmt"`
DateCompletedGmt interface{} `json:"date_completed_gmt"`
DatePaidGmt interface{} `json:"date_paid_gmt"`
CurrencySymbol string `json:"currency_symbol"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
}
OrdersReturn is to decode the json data
func Orders ¶
func Orders(page int, afterDate string, r Request) ([]OrdersReturn, error)
Orders is to get all orders since id
func UpdateOrder ¶ added in v1.2.8
func UpdateOrder(body UpdateOrderBody, r Request) (OrdersReturn, error)
UpdateOrder is to update the status of an order
type ProductAttributeTermBody ¶
type ProductAttributeTermBody struct {
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
MenuOrder int `json:"menu_order,omitempty"`
}
ProductAttributeTermBody is to structure the request data
type ProductAttributeTermsReturn ¶
type ProductAttributeTermsReturn struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
MenuOrder int `json:"menu_order"`
Count int `json:"count"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
}
ProductAttributeTermsReturn is to decode the data
func CreateProductAttributeTerms ¶
func CreateProductAttributeTerms(attributeId int, body ProductAttributeTermBody, r Request) (ProductAttributeTermsReturn, error)
CreateProductAttributeTerms is to create a new term
func DeleteProductAttributeTerms ¶
func DeleteProductAttributeTerms(attributeId, termId int, force bool, r Request) (ProductAttributeTermsReturn, error)
DeleteProductAttributeTerms is to delete a term
func ProductAttributeTerms ¶
func ProductAttributeTerms(attributeId int, r Request) ([]ProductAttributeTermsReturn, error)
ProductAttributeTerms is to get all terms
func UpdateProductAttributeTerms ¶
func UpdateProductAttributeTerms(attributeId, termId int, body ProductAttributeTermBody, r Request) (ProductAttributeTermsReturn, error)
UpdateProductAttributeTerms is to update a term
type ProductAttributesBody ¶
type ProductAttributesBody struct {
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Type string `json:"type,omitempty"`
OrderBy string `json:"order_by,omitempty"`
HasArchives bool `json:"has_archives,omitempty"`
}
ProductAttributesBody is to structure the data
type ProductAttributesReturn ¶
type ProductAttributesReturn struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Type string `json:"type"`
OrderBy string `json:"order_by"`
HasArchives bool `json:"has_archives"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
}
ProductAttributesReturn is to decode the data
func CreateProductAttributes ¶
func CreateProductAttributes(body ProductAttributesBody, r Request) (ProductAttributesReturn, error)
CreateProductAttributes is to create a new attribute
func DeleteProductAttributes ¶
func DeleteProductAttributes(id int, r Request) (ProductAttributesReturn, error)
DeleteProductAttributes is to delete a product attribute
func ProductAttributes ¶
func ProductAttributes(r Request) ([]ProductAttributesReturn, error)
ProductAttributes is to get a list of all product attributes
func UpdateProductAttributes ¶
func UpdateProductAttributes(id int, body ProductAttributesBody, r Request) (ProductAttributesReturn, error)
UpdateProductAttributes is to update a attribute
type ProductCategoriesReturn ¶
type ProductCategoriesReturn struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Parent int `json:"parent"`
Description string `json:"description"`
Display string `json:"display"`
Image interface{} `json:"image"`
MenuOrder int `json:"menu_order"`
Count int `json:"count"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
}
ProductCategoriesReturn is to decode the json data
func AddProductCategory ¶
func AddProductCategory(body ProductCategory, r Request) (ProductCategoriesReturn, error)
AddProductCategory is to create a new category
func DeleteProductCategory ¶
func DeleteProductCategory(id int, force bool, r Request) (ProductCategoriesReturn, error)
DeleteProductCategory is to delete a product category
func ProductCategories ¶
func ProductCategories(r Request) ([]ProductCategoriesReturn, error)
ProductCategories is to get a list of all product categories
func UpdateProductCategory ¶
func UpdateProductCategory(id int, body ProductCategory, r Request) (ProductCategoriesReturn, error)
UpdateProductCategory is to update an existing category
type ProductCategory ¶
type ProductCategory struct {
Name string `json:"name,omitempty"`
Parent int `json:"parent,omitempty"`
Description string `json:"description,omitempty"`
Display string `json:"display,omitempty"`
MenuOrder int `json:"menu_order,omitempty"`
Image ProductCategoryImage `json:"image,omitempty"`
}
ProductCategory is to structure the category data
type ProductCategoryImage ¶
type ProductCategoryImage struct {
Src string `json:"src,omitempty"`
}
type ProductTagsBody ¶
type ProductTagsBody struct {
Name string `json:"name"`
Slug string `json:"slug,omitempty"`
Description string `json:"description,omitempty"`
}
ProductTagsBody is to structure the body data
type ProductTagsReturn ¶
type ProductTagsReturn struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Description string `json:"description"`
Count int `json:"count"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
}
ProductTagsReturn is to decode the json data
func CreateProductTag ¶
func CreateProductTag(body ProductTagsBody, r Request) (ProductTagsReturn, error)
CreateProductTag is to create a new product tag
func DeleteProductTag ¶
func DeleteProductTag(id int, force bool, r Request) (ProductTagsReturn, error)
DeleteProductTag is to delete an existing product tag
func ProductTag ¶
func ProductTag(id int, r Request) (ProductTagsReturn, error)
ProductTag is get a product tag
func ProductTags ¶
func ProductTags(r Request) ([]ProductTagsReturn, error)
ProductTags is get a list of all product tags
func UpdateProductTag ¶
func UpdateProductTag(id int, body ProductTagsBody, r Request) (ProductTagsReturn, error)
UpdateProductTag is to update an existing product tag
type ProductVariationsBody ¶
type ProductVariationsBody struct {
Description string `json:"description,omitempty"`
Permalink string `json:"permalink,omitempty"`
Sku string `json:"sku,omitempty"`
Price string `json:"price,omitempty"`
RegularPrice string `json:"regular_price,omitempty"`
SalePrice string `json:"sale_price,omitempty"`
DateOnSaleFrom interface{} `json:"date_on_sale_from,omitempty"`
DateOnSaleFromGmt interface{} `json:"date_on_sale_from_gmt,omitempty"`
DateOnSaleTo interface{} `json:"date_on_sale_to,omitempty"`
DateOnSaleToGmt interface{} `json:"date_on_sale_to_gmt,omitempty"`
OnSale bool `json:"on_sale,omitempty"`
Status string `json:"status,omitempty"`
Purchasable bool `json:"purchasable,omitempty"`
Virtual bool `json:"virtual,omitempty"`
Downloadable bool `json:"downloadable,omitempty"`
Downloads []interface{} `json:"downloads,omitempty"`
DownloadLimit int `json:"download_limit,omitempty"`
DownloadExpiry int `json:"download_expiry,omitempty"`
TaxStatus string `json:"tax_status,omitempty"`
TaxClass string `json:"tax_class,omitempty"`
ManageStock bool `json:"manage_stock,omitempty"`
StockQuantity interface{} `json:"stock_quantity,omitempty"`
StockStatus string `json:"stock_status,omitempty"`
Backorders string `json:"backorders,omitempty"`
BackordersAllowed bool `json:"backorders_allowed,omitempty"`
Backordered bool `json:"backordered,omitempty"`
Weight string `json:"weight,omitempty"`
Dimensions ProductVariationsBodyDimensions `json:"dimensions,omitempty"`
ShippingClass string `json:"shipping_class,omitempty"`
ShippingClassId int `json:"shipping_class_id,omitempty"`
Image ProductVariationsBodyImages `json:"image,omitempty"`
Attributes []ProductVariationsBodyAttributes `json:"attributes,omitempty"`
MenuOrder int `json:"menu_order,omitempty"`
MetaData []interface{} `json:"meta_data,omitempty"`
}
ProductVariationsBody are to structure the data
type ProductVariationsReturn ¶
type ProductVariationsReturn struct {
Id int `json:"id"`
DateCreated string `json:"date_created"`
DateCreatedGmt string `json:"date_created_gmt"`
DateModified string `json:"date_modified"`
DateModifiedGmt string `json:"date_modified_gmt"`
Description string `json:"description"`
Permalink string `json:"permalink"`
Sku string `json:"sku"`
Price string `json:"price"`
RegularPrice string `json:"regular_price"`
SalePrice string `json:"sale_price"`
DateOnSaleFrom interface{} `json:"date_on_sale_from"`
DateOnSaleFromGmt interface{} `json:"date_on_sale_from_gmt"`
DateOnSaleTo interface{} `json:"date_on_sale_to"`
DateOnSaleToGmt interface{} `json:"date_on_sale_to_gmt"`
OnSale bool `json:"on_sale"`
Status string `json:"status"`
Purchasable bool `json:"purchasable"`
Virtual bool `json:"virtual"`
Downloadable bool `json:"downloadable"`
Downloads []interface{} `json:"downloads"`
DownloadLimit int `json:"download_limit"`
DownloadExpiry int `json:"download_expiry"`
TaxStatus string `json:"tax_status"`
TaxClass string `json:"tax_class"`
ManageStock bool `json:"manage_stock"`
StockQuantity int `json:"stock_quantity"`
StockStatus string `json:"stock_status"`
Backorders string `json:"backorders"`
BackordersAllowed bool `json:"backorders_allowed"`
Backordered bool `json:"backordered"`
LowStockAmount interface{} `json:"low_stock_amount"`
Weight string `json:"weight"`
Dimensions struct {
Length string `json:"length"`
Width string `json:"width"`
Height string `json:"height"`
} `json:"dimensions"`
ShippingClass string `json:"shipping_class"`
ShippingClassId int `json:"shipping_class_id"`
Image struct {
Id int `json:"id"`
DateCreated string `json:"date_created"`
DateCreatedGmt string `json:"date_created_gmt"`
DateModified string `json:"date_modified"`
DateModifiedGmt string `json:"date_modified_gmt"`
Src string `json:"src"`
Name string `json:"name"`
Alt string `json:"alt"`
} `json:"image"`
Attributes []struct {
Id int `json:"id"`
Name string `json:"name"`
Option string `json:"option"`
} `json:"attributes"`
MenuOrder int `json:"menu_order"`
MetaData []interface{} `json:"meta_data"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
Up []struct {
Href string `json:"href"`
} `json:"up"`
} `json:"_links"`
Code string `json:"code,omitempty"`
Message string `json:"message,omitempty"`
Data struct {
Status int `json:"status"`
Params struct {
StockStatus string `json:"stock_status"`
} `json:"params"`
Details struct {
StockStatus struct {
Code string `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
} `json:"stock_status"`
} `json:"details"`
} `json:"data,omitempty"`
}
ProductVariationsReturn is to decode the json data
func CreateProductVariations ¶
func CreateProductVariations(productId int, body ProductVariationsBody, r Request) (ProductVariationsReturn, error)
CreateProductVariations is to create a new variant to a product
func DeleteProductVariations ¶
func DeleteProductVariations(productId, variantId int, r Request) (ProductVariationsReturn, error)
DeleteProductVariations is to remove a variant from a product
func ProductVariations ¶
func ProductVariations(productId, page int, r Request) ([]ProductVariationsReturn, error)
ProductVariations is to get a list of all product variations
func UpdateProductVariations ¶
func UpdateProductVariations(productId, variantId int, body ProductVariationsBody, r Request) (ProductVariationsReturn, error)
UpdateProductVariations is to create a new variant to a product
type ProductsBody ¶
type ProductsBody struct {
Name string `json:"name"`
Slug string `json:"slug"`
Type string `json:"type"`
Status string `json:"status"`
Featured bool `json:"featured"`
CatalogVisibility string `json:"catalog_visibility"`
Description string `json:"description"`
ShortDescription string `json:"short_description"`
Sku string `json:"sku"`
Price string `json:"price"`
RegularPrice string `json:"regular_price"`
SalePrice string `json:"sale_price"`
DateOnSaleFrom interface{} `json:"date_on_sale_from"`
DateOnSaleFromGmt interface{} `json:"date_on_sale_from_gmt"`
DateOnSaleTo interface{} `json:"date_on_sale_to"`
DateOnSaleToGmt interface{} `json:"date_on_sale_to_gmt"`
OnSale bool `json:"on_sale"`
Purchasable bool `json:"purchasable"`
TotalSales int `json:"total_sales"`
Virtual bool `json:"virtual"`
Downloadable bool `json:"downloadable"`
Downloads []interface{} `json:"downloads"`
DownloadLimit int `json:"download_limit"`
DownloadExpiry int `json:"download_expiry"`
ExternalUrl string `json:"external_url"`
ButtonText string `json:"button_text"`
TaxStatus string `json:"tax_status"`
TaxClass string `json:"tax_class"`
ManageStock bool `json:"manage_stock"`
StockQuantity interface{} `json:"stock_quantity"`
Backorders string `json:"backorders"`
BackordersAllowed bool `json:"backorders_allowed"`
Backordered bool `json:"backordered"`
LowStockAmount interface{} `json:"low_stock_amount"`
SoldIndividually bool `json:"sold_individually"`
Weight string `json:"weight"`
Dimensions ProductsBodyDimensions `json:"dimensions,omitempty"`
ShippingRequired bool `json:"shipping_required"`
ShippingTaxable bool `json:"shipping_taxable"`
ShippingClass string `json:"shipping_class"`
ShippingClassId int `json:"shipping_class_id"`
ReviewsAllowed bool `json:"reviews_allowed"`
AverageRating string `json:"average_rating"`
RatingCount int `json:"rating_count"`
UpsellIds []interface{} `json:"upsell_ids"`
CrossSellIds []interface{} `json:"cross_sell_ids"`
ParentId int `json:"parent_id"`
PurchaseNote string `json:"purchase_note"`
Categories []ProductsBodyCategories `json:"categories,omitempty"`
Tags []ProductsBodyTags `json:"tags,omitempty"`
Images []ProductsBodyImages `json:"images,omitempty"`
Attributes []ProductsBodyAttributes `json:"attributes,omitempty"`
DefaultAttributes []interface{} `json:"default_attributes"`
Variations []interface{} `json:"variations"`
GroupedProducts []interface{} `json:"grouped_products"`
MenuOrder int `json:"menu_order"`
RelatedIds []interface{} `json:"related_ids"`
MetaData []interface{} `json:"meta_data"`
StockStatus string `json:"stock_status"`
}
ProductsBody is to structure the request data
type ProductsBodyAttributes ¶
type ProductsBodyCategories ¶
type ProductsBodyDimensions ¶
type ProductsBodyImages ¶
type ProductsBodyTags ¶
type ProductsReturn ¶
type ProductsReturn struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
Permalink string `json:"permalink"`
DateCreated string `json:"date_created"`
DateCreatedGmt string `json:"date_created_gmt"`
DateModified string `json:"date_modified"`
DateModifiedGmt string `json:"date_modified_gmt"`
Type string `json:"type"`
Status string `json:"status"`
Featured bool `json:"featured"`
CatalogVisibility string `json:"catalog_visibility"`
Description string `json:"description"`
ShortDescription string `json:"short_description"`
Sku string `json:"sku"`
Price string `json:"price"`
RegularPrice string `json:"regular_price"`
SalePrice string `json:"sale_price"`
DateOnSaleFrom interface{} `json:"date_on_sale_from"`
DateOnSaleFromGmt interface{} `json:"date_on_sale_from_gmt"`
DateOnSaleTo interface{} `json:"date_on_sale_to"`
DateOnSaleToGmt interface{} `json:"date_on_sale_to_gmt"`
OnSale bool `json:"on_sale"`
Purchasable bool `json:"purchasable"`
TotalSales int `json:"total_sales"`
Virtual bool `json:"virtual"`
Downloadable bool `json:"downloadable"`
Downloads []interface{} `json:"downloads"`
DownloadLimit int `json:"download_limit"`
DownloadExpiry int `json:"download_expiry"`
ExternalUrl string `json:"external_url"`
ButtonText string `json:"button_text"`
TaxStatus string `json:"tax_status"`
TaxClass string `json:"tax_class"`
ManageStock bool `json:"manage_stock"`
StockQuantity interface{} `json:"stock_quantity"`
Backorders string `json:"backorders"`
BackordersAllowed bool `json:"backorders_allowed"`
Backordered bool `json:"backordered"`
LowStockAmount interface{} `json:"low_stock_amount"`
SoldIndividually bool `json:"sold_individually"`
Weight string `json:"weight"`
Dimensions struct {
Length string `json:"length"`
Width string `json:"width"`
Height string `json:"height"`
} `json:"dimensions"`
ShippingRequired bool `json:"shipping_required"`
ShippingTaxable bool `json:"shipping_taxable"`
ShippingClass string `json:"shipping_class"`
ShippingClassId int `json:"shipping_class_id"`
ReviewsAllowed bool `json:"reviews_allowed"`
AverageRating string `json:"average_rating"`
RatingCount int `json:"rating_count"`
UpsellIds []interface{} `json:"upsell_ids"`
CrossSellIds []interface{} `json:"cross_sell_ids"`
ParentId int `json:"parent_id"`
PurchaseNote string `json:"purchase_note"`
Categories []struct {
Id int `json:"id"`
Name string `json:"name"`
Slug string `json:"slug"`
} `json:"categories"`
Tags []interface{} `json:"tags"`
Images []interface{} `json:"images"`
Attributes []interface{} `json:"attributes"`
DefaultAttributes []interface{} `json:"default_attributes"`
Variations []interface{} `json:"variations"`
GroupedProducts []interface{} `json:"grouped_products"`
MenuOrder int `json:"menu_order"`
PriceHtml string `json:"price_html"`
RelatedIds []interface{} `json:"related_ids"`
MetaData []interface{} `json:"meta_data"`
StockStatus string `json:"stock_status"`
Links struct {
Self []struct {
Href string `json:"href"`
} `json:"self"`
Collection []struct {
Href string `json:"href"`
} `json:"collection"`
} `json:"_links"`
Code string `json:"code"`
Message string `json:"message"`
Data struct {
Status int `json:"status"`
Params struct {
Backorders string `json:"backorders"`
} `json:"params"`
Details struct {
Backorders struct {
Code string `json:"code"`
Message string `json:"message"`
Data interface{} `json:"data"`
} `json:"backorders"`
} `json:"details"`
} `json:"data"`
}
ProductsReturn is to decode the product return
func CreateProduct ¶
func CreateProduct(body ProductsBody, r Request) (ProductsReturn, error)
CreateProduct is to create a new product
func DeleteProduct ¶
func DeleteProduct(id int, force bool, r Request) (ProductsReturn, error)
DeleteProduct is to remove a product from woocommerce
func Products ¶
func Products(page int, r Request) ([]ProductsReturn, error)
Products are to get a list of all products per page
func UpdateProduct ¶
func UpdateProduct(id int, body ProductsBody, r Request) (ProductsReturn, error)
UpdateProduct is to update a product
type Request ¶
type Request struct {
BaseUrl, ConsumerKey, ConsumerSecret string
}
Request is to define the request data
type UpdateOrderBody ¶ added in v1.2.8
UpdateOrderBody is to structure the data