Versions in this module Expand all Collapse all v1 v1.1.0 Oct 23, 2024 v1.0.3 Oct 23, 2024 v1.0.2 Oct 23, 2024 Changes in this version + const BadRequestError + const EditContext + const HashAlgorithm + const InternalServerError + const MethodNotImplementedError + const NotFoundError + const SortAsc + const SortDesc + const UnauthorizedError + const UserAgent + const Version + const ViewContext + var ErrNotFound = errors.New("WooCommerce: not found") + func ErrorWrap(code int, message string) error + func IsValidateTime(dateStr string) error + func ToISOTimeString(dateStr string, addMinTimeString, addMaxTimeString bool) (s string) + type BatchCouponsCreateItem = CreateCouponRequest + type BatchCouponsRequest struct + Create []BatchCouponsCreateItem + Delete []int + Update []BatchCouponsUpdateItem + func (m BatchCouponsRequest) Validate() error + type BatchCouponsResult struct + Create []entity.Coupon + Delete []entity.Coupon + Update []entity.Coupon + type BatchCouponsUpdateItem struct + ID string + type BatchCreateCustomerRequest = CreateCustomerRequest + type BatchCustomerRequest struct + Create []BatchCreateCustomerRequest + Delete []int + Update []BatchUpdateCustomerRequest + func (m BatchCustomerRequest) Validate() error + type BatchCustomerResult struct + Create []entity.Customer + Delete []entity.Customer + Update []entity.Customer + type BatchProductAttributeTermsCreateItem = CreateProductAttributeTermRequest + type BatchProductAttributeTermsRequest struct + Create []BatchProductAttributeTermsCreateItem + Delete []int + Update []BatchProductAttributeTermsUpdateItem + func (m BatchProductAttributeTermsRequest) Validate() error + type BatchProductAttributeTermsResult struct + Create []entity.ProductAttributeTerm + Delete []entity.ProductAttributeTerm + Update []entity.ProductAttributeTerm + type BatchProductAttributeTermsUpdateItem struct + ID string + type BatchProductAttributesCreateItem = CreateProductAttributeRequest + type BatchProductAttributesRequest struct + Create []BatchProductAttributesCreateItem + Delete []int + Update []BatchProductAttributesUpdateItem + func (m BatchProductAttributesRequest) Validate() error + type BatchProductAttributesResult struct + Create []entity.ProductAttribute + Delete []entity.ProductAttribute + Update []entity.ProductAttribute + type BatchProductAttributesUpdateItem struct + ID string + type BatchProductCategoriesCreateItem = UpsertProductCategoryRequest + type BatchProductCategoriesRequest struct + Create []BatchProductCategoriesCreateItem + Delete []int + Update []BatchProductCategoriesUpdateItem + func (m BatchProductCategoriesRequest) Validate() error + type BatchProductCategoriesResult struct + Create []entity.ProductTag + Delete []entity.ProductTag + Update []entity.ProductTag + type BatchProductCategoriesUpdateItem struct + ID int + type BatchProductCreateItem = CreateProductRequest + type BatchProductRequest struct + Create []BatchProductCreateItem + Delete []int + Update []BatchProductUpdateItem + func (m BatchProductRequest) Validate() error + type BatchProductResult struct + Create []entity.Product + Delete []entity.Product + Update []entity.Product + type BatchProductReviewsCreateItem = CreateProductReviewRequest + type BatchProductReviewsRequest struct + Create []BatchProductReviewsCreateItem + Delete []int + Update []BatchProductReviewsUpdateItem + func (m BatchProductReviewsRequest) Validate() error + type BatchProductReviewsResult struct + Create []entity.ProductReview + Delete []entity.ProductReview + Update []entity.ProductReview + type BatchProductReviewsUpdateItem struct + ID string + type BatchProductShippingClassesCreateItem = CreateProductShippingClassRequest + type BatchProductShippingClassesRequest struct + Create []BatchProductShippingClassesCreateItem + Delete []int + Update []BatchProductShippingClassesUpdateItem + func (m BatchProductShippingClassesRequest) Validate() error + type BatchProductShippingClassesResult struct + Create []entity.ProductShippingClass + Delete []entity.ProductShippingClass + Update []entity.ProductShippingClass + type BatchProductShippingClassesUpdateItem struct + ID string + type BatchProductTagsCreateItem = UpsertProductTagRequest + type BatchProductTagsRequest struct + Create []BatchProductTagsCreateItem + Delete []int + Update []BatchProductTagsUpdateItem + func (m BatchProductTagsRequest) Validate() error + type BatchProductTagsResult struct + Create []entity.ProductTag + Delete []entity.ProductTag + Update []entity.ProductTag + type BatchProductTagsUpdateItem struct + ID int + type BatchProductUpdateItem struct + ID int + type BatchProductVariationsCreateItem = CreateProductVariationRequest + type BatchProductVariationsRequest struct + Create []BatchProductVariationsCreateItem + Delete []int + Update []BatchProductVariationsUpdateItem + func (m BatchProductVariationsRequest) Validate() error + type BatchProductVariationsResult struct + Create []entity.ProductVariation + Delete []entity.ProductVariation + Update []entity.ProductVariation + type BatchProductVariationsUpdateItem struct + ID int + type BatchTaxRatesCreateItem = CreateTaxRateRequest + type BatchTaxRatesRequest struct + Create []BatchTaxRatesCreateItem + Delete []int + Update []BatchTaxRatesUpdateItem + func (m BatchTaxRatesRequest) Validate() error + type BatchTaxRatesResult struct + Create []entity.TaxRate + Delete []entity.TaxRate + Update []entity.TaxRate + type BatchTaxRatesUpdateItem struct + ID string + type BatchUpdateCustomerRequest struct + ID string + type BatchWebhooksCreateItem = CreateWebhookRequest + type BatchWebhooksRequest struct + Create []BatchWebhooksCreateItem + Delete []int + Update []BatchWebhooksUpdateItem + func (m BatchWebhooksRequest) Validate() error + type BatchWebhooksResult struct + Create []entity.Webhook + Delete []entity.Webhook + Update []entity.Webhook + type BatchWebhooksUpdateItem struct + ID string + type CouponsQueryParams struct + After string + Before string + Code string + Exclude []int + Include []int + Search string + func (m CouponsQueryParams) Validate() error + type CreateCouponRequest struct + Amount float64 + Code string + DiscountType string + ExcludeSaleItems bool + IndividualUse bool + MinimumAmount float64 + func (m CreateCouponRequest) Validate() error + type CreateCustomerRequest struct + Billing *entity.Billing + Email string + FirstName string + LastName string + MetaData []entity.MetaData + Password string + Shipping *entity.Shipping + Username string + func (m CreateCustomerRequest) Validate() error + type CreateOrderNoteRequest struct + Note string + func (m CreateOrderNoteRequest) Validate() error + type CreateOrderRefundRequest struct + Amount float64 + LineItems []entity.OrderRefundLineItem + MetaData []entity.MetaData + Reason string + RefundedBy int + func (m CreateOrderRefundRequest) Validate() error + type CreateOrderRequest struct + Billing *entity.Billing + CouponLines []entity.CouponLine + Currency string + CurrencySymbol string + CustomerId int + CustomerNote string + FeeLines []entity.FeeLine + LineItems []entity.LineItem + MetaData []entity.MetaData + PaymentMethod string + PaymentMethodTitle string + PricesIncludeTax bool + SetPaid bool + Shipping *entity.Shipping + ShippingLines []entity.ShippingLine + Status string + TaxLines []entity.TaxLine + TransactionId string + func (m CreateOrderRequest) Validate() error + type CreateProductAttributeRequest struct + HasArchives bool + Name string + OrderBy string + Slug string + Type string + func (m CreateProductAttributeRequest) Validate() error + type CreateProductAttributeTermRequest struct + Description string + MenuOrder int + Name string + Slug string + func (m CreateProductAttributeTermRequest) Validate() error + type CreateProductCategoryRequest = UpsertProductCategoryRequest + type CreateProductRequest struct + Attributes []entity.ProductAttributeItem + Backorders string + ButtonText string + CatalogVisibility string + Categories []entity.ProductCategory + CrossSellIds []int + DateOnSaleFrom string + DateOnSaleFromGMT string + DateOnSaleTo string + DateOnSaleToGMT string + DefaultAttributes []entity.ProductDefaultAttribute + Description string + Dimensions *entity.ProductDimension + DownloadExpiry int + DownloadLimit int + Downloadable bool + Downloads []entity.ProductDownload + ExternalUrl string + Featured bool + GroupedProducts []int + Images []entity.ProductImage + ManageStock bool + MenuOrder int + MetaData []entity.MetaData + Name string + ParentId int + PurchaseNote string + RegularPrice string + ReviewsAllowed bool + SKU string + SalePrice string + ShippingClass string + ShortDescription string + Slug string + SoldIndividually bool + Status string + StockQuantity int + StockStatus string + Tags []entity.ProductTag + TaxClass string + TaxStatus string + Type string + UpsellIds []int + Virtual bool + Weight string + func (m CreateProductRequest) Validate() error + type CreateProductReviewRequest struct + ProductId int + Rating int + Review string + Reviewer string + ReviewerEmail string + Status string + Verified bool + func (m CreateProductReviewRequest) Validate() error + type CreateProductShippingClassRequest struct + Description string + Name string + Slug string + func (m CreateProductShippingClassRequest) Validate() error + type CreateProductTagRequest = UpsertProductTagRequest + type CreateProductVariationRequest struct + Attributes []entity.ProductVariationAttribute + Backorders string + Description string + Dimension *entity.ProductDimension + DownloadExpiry int + DownloadLimit int + Downloadable bool + Downloads []entity.ProductDownload + Image *entity.ProductImage + ManageStock bool + MenuOrder int + MetaData []entity.MetaData + RegularPrice float64 + SKU string + SalePrice float64 + ShippingClass string + Status string + StockQuantity int + StockStatus string + TaxClass string + TaxStatus string + Virtual bool + Weight float64 + func (m CreateProductVariationRequest) Validate() error + type CreateShippingZoneRequest struct + Name string + Order int + func (m CreateShippingZoneRequest) Validate() error + type CreateTaxClassRequest struct + Name string + func (m CreateTaxClassRequest) Validate() error + type CreateTaxRateRequest struct + Cities []string + City string + Class string + Compound bool + Country string + Name string + Order int + Postcode string + Postcodes []string + Priority int + Rate string + Shipping bool + State string + func (m CreateTaxRateRequest) Validate() error + type CreateWebhookRequest struct + DeliveryURL string + Name string + Secret string + Status string + Topic string + func (m CreateWebhookRequest) Validate() error + type CustomersQueryParams struct + Email string + Exclude []int + Include []int + Role string + Search string + func (m CustomersQueryParams) Validate() error + type OrderNotesQueryParams struct + Type string + func (m OrderNotesQueryParams) Validate() error + type OrderRefundsQueryParams struct + After string + Before string + DecimalPoint int + Exclude []int + Include []int + Parent []int + ParentExclude []int + Search string + func (m OrderRefundsQueryParams) Validate() error + type OrdersQueryParams struct + After string + Before string + Customer int + DecimalPoint int + Exclude []int + Include []int + Parent []int + ParentExclude []int + Product int + Search string + Status []string + func (m OrdersQueryParams) Validate() error + type ProductAttributeTermsQueryParaTerms struct + Exclude []int + HideEmpty bool + Include []int + Parent int + Product int + Search string + Slug string + func (m ProductAttributeTermsQueryParaTerms) Validate() error + type ProductAttributesQueryParams struct + func (m ProductAttributesQueryParams) Validate() error + type ProductCategoriesQueryParams struct + Exclude []int + HideEmpty bool + Include []int + Parent int + Product int + Search string + Slug string + func (m ProductCategoriesQueryParams) Validate() error + type ProductReviewsQueryParams struct + After string + Before string + Exclude []int + Include []int + Product []int + Reviewer []int + ReviewerEmail []string + ReviewerExclude []int + Search string + Status string + func (m ProductReviewsQueryParams) Validate() error + type ProductShippingClassesQueryParams struct + Exclude []int + HideEmpty bool + Include []int + Parent int + Product int + Search string + Slug string + func (m ProductShippingClassesQueryParams) Validate() error + type ProductTagsQueryParams struct + Exclude []int + HideEmpty bool + Include []int + Product int + Search string + Slug string + func (m ProductTagsQueryParams) Validate() error + type ProductVariationsQueryParams struct + After string + Before string + Exclude []int + Include []int + MaxPrice float64 + MinPrice float64 + OnSale string + Parent []int + ParentExclude []int + SKU string + Search string + Slug string + Status string + StockStatus string + TaxClass string + func (m ProductVariationsQueryParams) Validate() error + type ProductsQueryParams struct + After string + Attribute string + AttributeTerm string + Before string + Category string + Exclude []int + Featured bool + Include []int + MaxPrice float64 + MinPrice float64 + OnSale bool + Parent []int + ParentExclude []int + SKU string + Search string + ShippingClass string + Slug string + Status string + StockStatus string + Tag string + TaxClass string + Type string + func (m ProductsQueryParams) Validate() error + type QueryParams struct + Context string + Offset int + Order string + OrderBy string + Page int + PerPage int + func (q *QueryParams) TidyVars() *QueryParams + type ReportsQueryParams struct + Context string + DateMax string + DateMin string + Period string + func (m ReportsQueryParams) Validate() error + type SalesReportsQueryParams = ReportsQueryParams + type ShippingZoneMethodIncludeRequest struct + MethodId string + func (m ShippingZoneMethodIncludeRequest) Validate() error + type TaxRatesQueryParams struct + Class string + func (m TaxRatesQueryParams) Validate() error + type TopSellerReportsQueryParams = SalesReportsQueryParams + type UpdateCouponRequest struct + Amount float64 + Code string + DiscountType string + ExcludeSaleItems bool + IndividualUse bool + MinimumAmount float64 + func (m UpdateCouponRequest) Validate() error + type UpdateCustomerRequest struct + Billing *entity.Billing + Email string + FirstName string + LastName string + MetaData []entity.MetaData + Shipping *entity.Shipping + func (m UpdateCustomerRequest) Validate() error + type UpdateOrderRequest = CreateOrderRequest + type UpdatePaymentGatewayRequest struct + Description string + Enabled bool + MethodDescription string + MethodSupports []string + MethodTitle string + Order int + Settings map[string]entity.PaymentGatewaySetting + Title string + func (m UpdatePaymentGatewayRequest) Validate() error + type UpdateProductAttributeRequest = CreateProductAttributeRequest + type UpdateProductAttributeTermRequest = CreateProductAttributeTermRequest + type UpdateProductCategoryRequest = UpsertProductCategoryRequest + type UpdateProductRequest = CreateProductRequest + type UpdateProductReviewRequest = CreateProductReviewRequest + type UpdateProductShippingClassRequest = CreateProductShippingClassRequest + type UpdateProductTagRequest = UpsertProductTagRequest + type UpdateProductVariationRequest = CreateProductVariationRequest + type UpdateSettingOptionRequest struct + Value string + func (m UpdateSettingOptionRequest) Validate() error + type UpdateShippingZoneLocationsRequest []entity.ShippingZoneLocation + func (m UpdateShippingZoneLocationsRequest) Validate() error + type UpdateShippingZoneMethodRequest struct + Enabled bool + Order int + Settings UpdateShippingZoneMethodSetting + func (m UpdateShippingZoneMethodRequest) Validate() error + type UpdateShippingZoneMethodSetting struct + Value string + type UpdateShippingZoneRequest = CreateShippingZoneRequest + type UpdateTaxRateRequest = CreateTaxRateRequest + type UpdateWebhookRequest = CreateWebhookRequest + type UpsertProductCategoryRequest struct + Description string + Display string + Image *entity.ProductImage + MenuOrder int + Name string + Parent int + Slug string + func (m UpsertProductCategoryRequest) Validate() error + type UpsertProductTagRequest struct + Description string + Name string + Slug string + func (m UpsertProductTagRequest) Validate() error + type WebhooksQueryParams struct + After string + Before string + Exclude []int + Include []int + Search string + Status string + func (m WebhooksQueryParams) Validate() error + type WooCommerce struct + Debug bool + Logger *log.Logger + Services services + func NewClient(config config.Config) *WooCommerce