Documentation
¶
Index ¶
- type BatchCouponUpdate
- type BatchCouponUpdateResponse
- type BatchCustomerUpdate
- type BatchCustomerUpdateResponse
- type BatchOrderUpdate
- type BatchOrderUpdateResponse
- type BatchProductTagsUpdate
- type BatchProductTagsUpdateResponse
- type BatchProductUpdate
- type BatchProductUpdateResponse
- type BatchProductVariationUpdate
- type BatchProductVariationUpdateResponse
- type BatchWebhookUpdate
- type BatchWebhookUpdateResponse
- type Billing
- type Client
- type ClientConfig
- type Collection
- type Coupon
- type CouponLine
- type CouponsService
- func (service *CouponsService) Batch(opts *BatchCouponUpdate) (*BatchCouponUpdateResponse, *http.Response, error)
- func (service *CouponsService) Create(coupon *Coupon) (*Coupon, *http.Response, error)
- func (service *CouponsService) Delete(couponID string, opts *DeleteCouponParams) (*Coupon, *http.Response, error)
- func (service *CouponsService) Get(couponID string) (*Coupon, *http.Response, error)
- func (service *CouponsService) List(opts *ListCouponParams) (*[]Coupon, *http.Response, error)
- func (service *CouponsService) Update(couponID string, coupon *Coupon) (*Coupon, *http.Response, error)
- type Customer
- type CustomerDownload
- type CustomersService
- func (service *CustomersService) Batch(opts *BatchCustomerUpdate) (*BatchCustomerUpdateResponse, *http.Response, error)
- func (service *CustomersService) Create(customer *Customer) (*Customer, *http.Response, error)
- func (service *CustomersService) Delete(customerId int, opts *DeleteCustomerParams) (*Customer, *http.Response, error)
- func (service *CustomersService) Get(customerId int) (*Customer, *http.Response, error)
- func (service *CustomersService) GetDownloads(customerId int) (*[]CustomerDownload, *http.Response, error)
- func (service *CustomersService) List(opts *ListCustomerParams) ([]Customer, *http.Response, error)
- func (service *CustomersService) Update(customerId int, customer *Customer) (*Customer, *http.Response, error)
- type DefaultAttributes
- type DeleteCouponParams
- type DeleteCustomerParams
- type DeleteOrderNoteParams
- type DeleteOrderParams
- type DeleteProductParams
- type DeleteProductVariationParams
- type DeleteRefundParams
- type DeleteWebhookParams
- type ErrorData
- type FeeLine
- type File
- type GetOrderParams
- type Image
- type LineItems
- type Link
- type Links
- type ListCouponParams
- type ListCustomerParams
- type ListOrderNotesParams
- type ListOrdersParams
- type ListProductParams
- type ListProductVariationParams
- type ListRefundParams
- type ListWebhooksParams
- type MetaData
- type Order
- type OrderNote
- type OrderNotesService
- func (service *OrderNotesService) Create(orderId string, orderNote *OrderNote) (*OrderNote, *http.Response, error)
- func (service *OrderNotesService) Delete(orderId string, noteId string, opts *DeleteOrderParams) (*OrderNote, *http.Response, error)
- func (service *OrderNotesService) Get(orderId string, noteId string) (*OrderNote, *http.Response, error)
- func (service *OrderNotesService) List(orderId string, opts *ListOrderNotesParams) (*[]OrderNote, *http.Response, error)
- type OrderRefund
- type OrdersService
- func (service *OrdersService) Batch(opts *BatchOrderUpdate) (*BatchOrderUpdateResponse, *http.Response, error)
- func (service *OrdersService) Create(order *Order) (*Order, *http.Response, error)
- func (service *OrdersService) Delete(orderId string, opts *DeleteOrderParams) (*Order, *http.Response, error)
- func (service *OrdersService) Get(orderId string, opts *GetOrderParams) (*Order, *http.Response, error)
- func (service *OrdersService) List(opts *ListOrdersParams) (*[]Order, *http.Response, error)
- func (service *OrdersService) Update(orderId string, order *Order) (*Order, *http.Response, error)
- type Product
- type ProductAttributes
- type ProductCategory
- type ProductDimensions
- type ProductDownload
- type ProductTag
- type ProductTagLinks
- type ProductTagService
- func (service *ProductTagService) Batch(opts *BatchProductTagsUpdate) (*BatchProductTagsUpdateResponse, *http.Response, error)
- func (service *ProductTagService) Create(productTag *ProductTag) (*ProductTag, *http.Response, error)
- func (service *ProductTagService) Delete(productTagID string) (*ProductTag, *http.Response, error)
- func (service *ProductTagService) Get(productTagID string) (*ProductTag, *http.Response, error)
- func (service *ProductTagService) List() ([]ProductTag, *http.Response, error)
- func (service *ProductTagService) Update(productTagID string, product *ProductTag) (*ProductTag, *http.Response, error)
- type ProductVariation
- type ProductVariationService
- func (service *ProductVariationService) Batch(productId int, opts *BatchProductVariationUpdate) (*BatchProductVariationUpdateResponse, *http.Response, error)
- func (service *ProductVariationService) Create(productId int, variation *ProductVariation) (*ProductVariation, *http.Response, error)
- func (service *ProductVariationService) Delete(productId int, variantId int, opts *DeleteProductParams) (*ProductVariation, *http.Response, error)
- func (service *ProductVariationService) Get(productID int, variationID string) (*ProductVariation, *http.Response, error)
- func (service *ProductVariationService) List(productId int, opts *ListProductVariationParams) ([]ProductVariation, *http.Response, error)
- func (service *ProductVariationService) Update(productID int, variation *ProductVariation) (*ProductVariation, *http.Response, error)
- type ProductsService
- func (service *ProductsService) Batch(opts *BatchProductUpdate) (*BatchProductUpdateResponse, *http.Response, error)
- func (service *ProductsService) Create(product *Product) (*Product, *http.Response, error)
- func (service *ProductsService) Delete(productID int, opts *DeleteProductParams) (*Product, *http.Response, error)
- func (service *ProductsService) Get(productID int) (*Product, *http.Response, error)
- func (service *ProductsService) List(opts *ListProductParams) ([]Product, *http.Response, error)
- func (service *ProductsService) Update(productID int, product *Product) (*Product, *http.Response, error)
- type Refund
- type RefundLineItem
- type RefundTax
- type RefundsService
- func (service *RefundsService) Create(orderId string, refund *Refund) (*Refund, *http.Response, error)
- func (service *RefundsService) Delete(orderId string, refundId string, opts *DeleteRefundParams) (*Refund, *http.Response, error)
- func (service *RefundsService) Get(orderId string, refundId string) (*Refund, *http.Response, error)
- func (service *RefundsService) List(orderId string, opts *ListRefundParams) (*[]Refund, *http.Response, error)
- type Self
- type Shipping
- type ShippingLines
- type TaxLines
- type Taxes
- type Webhook
- type WebhookService
- func (service *WebhookService) Batch(opts *BatchWebhookUpdate) (*BatchWebhookUpdateResponse, *http.Response, error)
- func (service *WebhookService) Create(webhook *Webhook) (*Webhook, *http.Response, error)
- func (service *WebhookService) Delete(webhookID string, opts *DeleteWebhookParams) (*Webhook, *http.Response, error)
- func (service *WebhookService) Get(webhookID string) (*Webhook, *http.Response, error)
- func (service *WebhookService) List(opts *ListWebhooksParams) (*[]Webhook, *http.Response, error)
- func (service *WebhookService) Update(webhookID string, webhook *Webhook) (*Webhook, *http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BatchCouponUpdate ¶
type BatchCustomerUpdate ¶
type BatchOrderUpdate ¶
type BatchProductTagsUpdate ¶
type BatchProductTagsUpdate struct {
Create *[]ProductTag `json:"create,omitempty"`
Update *[]ProductTag `json:"update,omitempty"`
Delete *[]int `json:"delete,omitempty"`
}
type BatchProductTagsUpdateResponse ¶
type BatchProductTagsUpdateResponse struct {
Create *[]ProductTag `json:"create,omitempty"`
Update *[]ProductTag `json:"update,omitempty"`
Delete *[]ProductTag `json:"delete,omitempty"`
}
type BatchProductUpdate ¶
type BatchProductVariationUpdate ¶
type BatchProductVariationUpdate struct {
Create *[]ProductVariation `json:"create,omitempty"`
Update *[]ProductVariation `json:"update,omitempty"`
Delete *[]int `json:"delete,omitempty"`
}
type BatchProductVariationUpdateResponse ¶
type BatchProductVariationUpdateResponse struct {
Create *[]ProductVariation `json:"create,omitempty"`
Update *[]ProductVariation `json:"update,omitempty"`
Delete *[]ProductVariation `json:"delete,omitempty"`
}
type BatchWebhookUpdate ¶
type Billing ¶
type Billing struct {
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Company string `json:"company,omitempty"`
Address1 string `json:"address_1,omitempty"`
Address2 string `json:"address_2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Postcode string `json:"postcode,omitempty"`
Country string `json:"country,omitempty"`
Email string `json:"email,omitempty"`
Phone string `json:"phone,omitempty"`
}
type Client ¶
type Client struct {
Coupons *CouponsService
Customers *CustomersService
Orders *OrdersService
OrderNotes *OrderNotesService
Refunds *RefundsService
Products *ProductsService
ProductTags *ProductTagService
ProductVariations *ProductVariationService
Webhooks *WebhookService
// contains filtered or unexported fields
}
func (*Client) Authenticate ¶
Authenticate saves authentication parameters for user
type ClientConfig ¶
type Collection ¶
type Collection struct {
Href string `json:"href,omitempty"`
}
type Coupon ¶
type Coupon struct {
Id int `json:"id,omitempty"`
Code string `json:"code,omitempty"`
Amount string `json:"amount,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
DiscountType string `json:"discount_type,omitempty"`
Description string `json:"description,omitempty"`
DateExpires string `json:"date_expires,omitempty"`
DateExpiresGmt string `json:"date_expires_gmt,omitempty"`
UsageCount int `json:"usage_count,omitempty"`
IndividualUse bool `json:"individual_use,omitempty"`
UsageLimit int `json:"usage_limit,omitempty"`
UsageLimitPerUser int `json:"usage_limit_per_user,omitempty"`
LimitUsageToXItems int `json:"limit_usage_to_x_items,omitempty"`
FreeShipping bool `json:"free_shipping,omitempty"`
ExcludeSaleItems bool `json:"exclude_sale_items,omitempty"`
MinimumAmount string `json:"minimum_amount,omitempty"`
MaximumAmount string `json:"maximum_amount,omitempty"`
EmailRestrictions interface{} `json:"email_restrictions,omitempty"`
UsedBy interface{} `json:"used_by,omitempty"`
ProductIds *[]int `json:"product_ids,omitempty"`
ExcludedProductIds *[]int `json:"excluded_product_ids,omitempty"`
ProductCategories *[]int `json:"product_categories,omitempty"`
ExcludedProductCategories *[]int `json:"excluded_product_categories,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
}
Coupon object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#coupon-properties
type CouponLine ¶
type CouponsService ¶
type CouponsService service
Coupon service
func (*CouponsService) Batch ¶
func (service *CouponsService) Batch(opts *BatchCouponUpdate) (*BatchCouponUpdateResponse, *http.Response, error)
Batch update coupons. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-coupons
func (*CouponsService) Create ¶
Create a coupon. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-coupon
func (*CouponsService) Delete ¶
func (service *CouponsService) Delete(couponID string, opts *DeleteCouponParams) (*Coupon, *http.Response, error)
Delete a coupon. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-coupon
func (*CouponsService) Get ¶
Get a coupon. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-coupon
func (*CouponsService) List ¶
func (service *CouponsService) List(opts *ListCouponParams) (*[]Coupon, *http.Response, error)
List coupons. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-coupons
func (*CouponsService) Update ¶
func (service *CouponsService) Update(couponID string, coupon *Coupon) (*Coupon, *http.Response, error)
Update a coupon. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-coupon
type Customer ¶
type Customer struct {
Id int `json:"id,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
Email string `json:"email,omitempty"`
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Role string `json:"role,omitempty"`
Username string `json:"username,omitempty"`
AvatarURL string `json:"avatar_url,omitempty"`
IsPayingCustomer bool `json:"is_paying_customer"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
Billing *Billing `json:"billing,omitempty"`
Shipping *Shipping `json:"shipping,omitempty"`
Links *Links `json:"_links,omitempty"`
}
Customer object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#customer-properties
type CustomerDownload ¶
type CustomerDownload struct {
DownloadId string `json:"download_id,omitempty"`
DownloadUrl string `json:"download_url,omitempty"`
ProductId int `json:"product_id,omitempty"`
ProductName string `json:"product_name,omitempty"`
DownloadName string `json:"download_name,omitempty"`
OrderId int `json:"order_id,omitempty"`
OrderKey string `json:"order_key,omitempty"`
DownloadsRemaining string `json:"downloads_remaining,omitempty"`
AccessExpires string `json:"access_expires,omitempty"`
AccessExpiresGmt string `json:"access_expires_gmt,omitempty"`
File *File `json:"file,omitempty"`
Links *Links `json:"_links,omitempty"`
}
type CustomersService ¶
type CustomersService service
Customer service
func (*CustomersService) Batch ¶
func (service *CustomersService) Batch(opts *BatchCustomerUpdate) (*BatchCustomerUpdateResponse, *http.Response, error)
Batch update customers. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-customers
func (*CustomersService) Create ¶
Create a customer. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-customer
func (*CustomersService) Delete ¶
func (service *CustomersService) Delete(customerId int, opts *DeleteCustomerParams) (*Customer, *http.Response, error)
Delete a customer. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-customer
func (*CustomersService) Get ¶
Get a customer. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-customer
func (*CustomersService) GetDownloads ¶
func (service *CustomersService) GetDownloads(customerId int) (*[]CustomerDownload, *http.Response, error)
Get customer downloads. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-customer-downloads
func (*CustomersService) List ¶
func (service *CustomersService) List(opts *ListCustomerParams) ([]Customer, *http.Response, error)
List customers. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-customers
func (*CustomersService) Update ¶
func (service *CustomersService) Update(customerId int, customer *Customer) (*Customer, *http.Response, error)
Update a customer. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-customer
type DefaultAttributes ¶
type DeleteCouponParams ¶
type DeleteCouponParams struct {
Force string `json:"force,omitempty"`
}
type DeleteCustomerParams ¶
type DeleteOrderNoteParams ¶
type DeleteOrderNoteParams struct {
Force bool `url:"force"`
}
type DeleteOrderParams ¶
type DeleteOrderParams struct {
Force bool `url:"force"`
}
type DeleteProductParams ¶
type DeleteProductParams struct {
Force string `json:"force,omitempty"`
}
type DeleteProductVariationParams ¶
type DeleteProductVariationParams struct {
Force string `json:"force,omitempty"`
}
type DeleteRefundParams ¶
type DeleteRefundParams struct {
Force bool `url:"force"`
}
type DeleteWebhookParams ¶
type DeleteWebhookParams struct {
Force string `json:"force,omitempty"`
}
type FeeLine ¶
type FeeLine struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
TaxClass string `json:"tax_class,omitempty"`
TaxStatus string `json:"tax_status,omitempty"`
Amount string `json:"amount,omitempty"`
Total string `json:"total,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Taxes *[]Taxes `json:"taxes,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
}
type GetOrderParams ¶
type GetOrderParams struct {
DecimalPoints int `url:"dp,omitempty"`
}
type Image ¶
type Image struct {
Id interface{} `json:"id,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
Source string `json:"src,omitempty"`
Name string `json:"name,omitempty"`
Alt string `json:"alt,omitempty"`
}
type LineItems ¶
type LineItems struct {
ID int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ProductID int `json:"product_id,omitempty"`
VariationID int `json:"variation_id,omitempty"`
Quantity int `json:"quantity,omitempty"`
TaxClass string `json:"tax_class,omitempty"`
Subtotal string `json:"subtotal,omitempty"`
SubtotalTax string `json:"subtotal_tax,omitempty"`
Total string `json:"total,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Taxes *[]Taxes `json:"taxes,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
Sku string `json:"sku,omitempty"`
Price float64 `json:"price,omitempty"`
Image *Image `json:"image,omitempty"`
ParentName interface{} `json:"parent_name,omitempty"`
}
type Links ¶
type Links struct {
Self []Self `json:"self,omitempty"`
Collection []Collection `json:"collection,omitempty"`
}
type ListCouponParams ¶
type ListCouponParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
ModifiedAfter string `url:"modified_after,omitempty"`
ModifiedBefore string `url:"modified_before,omitempty"`
DatesAreGmt bool `url:"dates_are_gmt,omitempty"`
Orderby string `url:"orderby,omitempty"`
Code string `url:"code,omitempty"`
}
type ListCustomerParams ¶
type ListCustomerParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
Email string `url:"email,omitempty"`
Role string `url:"role,omitempty"`
}
type ListOrderNotesParams ¶
type ListOrdersParams ¶
type ListOrdersParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
Customer int `url:"customer,omitempty"`
Product int `url:"product,omitempty"`
DecimalPoints int `url:"dp,omitempty"`
Parent *[]int `url:"parent,omitempty"`
ParentExclude *[]int `url:"parent_exclude,omitempty"`
DatesAreGTM bool `url:"dates_are_gmt"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
ModifiedAfter string `url:"modified_after,omitempty"`
ModifiedBefore string `url:"modified_before,omitempty"`
Status *[]string `url:"status,omitempty"`
}
type ListProductParams ¶
type ListProductParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
ModifiedAfter string `url:"modified_after,omitempty"`
ModifiedBefore string `url:"modified_before,omitempty"`
DatesAreGmt bool `url:"dates_are_gmt,omitempty"`
Orderby string `url:"orderby,omitempty"`
Slug string `url:"slug,omitempty"`
Status string `url:"status,omitempty"`
Type string `url:"type,omitempty"`
Sku string `url:"sku,omitempty"`
Featured bool `url:"featured,omitempty"`
Category string `url:"category,omitempty"`
Tag string `url:"tag,omitempty"`
ShippingClass string `url:"shipping_class,omitempty"`
Attribute string `url:"attribute,omitempty"`
AttributeTerm string `url:"attribute_term,omitempty"`
TaxClass string `url:"tax_class,omitempty"`
OnSale bool `url:"on_sale,omitempty"`
MinPrice string `url:"min_price,omitempty"`
MaxPrice string `url:"max_price,omitempty"`
StockStatus string `url:"stock_status,omitempty"`
Parent *[]int `url:"parent,omitempty"`
ParentExclude *[]int `url:"parent_exclude,omitempty"`
}
type ListProductVariationParams ¶
type ListProductVariationParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
Parent *[]int `url:"parent,omitempty"`
ParentExclude *[]int `url:"parent_exclude,omitempty"`
Slug string `url:"slug,omitempty"`
Status string `url:"status,omitempty"`
IncludeStatus string `url:"include_status,omitempty"`
ExcludeStatus string `url:"exclude_status,omitempty"`
Sku string `url:"sku,omitempty"`
TaxClass string `url:"tax_class,omitempty"`
OnSale bool `url:"on_sale,omitempty"`
MinPrice string `url:"min_price,omitempty"`
MaxPrice string `url:"max_price,omitempty"`
StockStatus string `url:"stock_status,omitempty"`
Virtual bool `url:"virtual,omitempty"`
Downloadable bool `url:"downloadable,omitempty"`
}
type ListRefundParams ¶
type ListRefundParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
Orderby string `url:"orderby,omitempty"`
Parent interface{} `url:"parent,omitempty"`
ParentExclude interface{} `url:"parent_exclude,omitempty"`
Dp int `url:"dp,omitempty"`
}
type ListWebhooksParams ¶
type ListWebhooksParams struct {
Context string `url:"context,omitempty"`
Page int `url:"page,omitempty"`
PerPage int `url:"per_page,omitempty"`
Search string `url:"search,omitempty"`
Exclude *[]int `url:"exclude,omitempty"`
Include *[]int `url:"include,omitempty"`
Offset int `url:"offset,omitempty"`
Order string `url:"order,omitempty"`
OrderBy string `url:"orderby,omitempty"`
After string `url:"after,omitempty"`
Before string `url:"before,omitempty"`
Status string `url:"status,omitempty"`
}
type Order ¶
type Order struct {
ID int `json:"id,omitempty"`
ParentID int `json:"parent_id,omitempty"`
CustomerID int `json:"customer_id,omitempty"`
PricesIncludeTax bool `json:"prices_include_tax"`
NeedsPayment bool `json:"needs_payment"`
NeedsProcessing bool `json:"needs_processing"`
IsEditable bool `json:"is_editable"`
CurrencySymbol string `json:"currency_symbol,omitempty"`
Number string `json:"number,omitempty"`
OrderKey string `json:"order_key,omitempty"`
CreatedVia string `json:"created_via,omitempty"`
Version string `json:"version,omitempty"`
Status string `json:"status,omitempty"`
Currency string `json:"currency,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
DiscountTotal string `json:"discount_total,omitempty"`
DiscountTax string `json:"discount_tax,omitempty"`
ShippingTotal string `json:"shipping_total,omitempty"`
ShippingTax string `json:"shipping_tax,omitempty"`
CartTax string `json:"cart_tax,omitempty"`
Total string `json:"total,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
CustomerIPAddress string `json:"customer_ip_address,omitempty"`
CustomerUserAgent string `json:"customer_user_agent,omitempty"`
CustomerNote string `json:"customer_note,omitempty"`
PaymentURL string `json:"payment_url,omitempty"`
PaymentMethod string `json:"payment_method,omitempty"`
PaymentMethodTitle string `json:"payment_method_title,omitempty"`
TransactionID string `json:"transaction_id,omitempty"`
DatePaid string `json:"date_paid,omitempty"`
DatePaidGmt string `json:"date_paid_gmt,omitempty"`
DateCompleted string `json:"date_completed,omitempty"`
DateCompletedGmt string `json:"date_completed_gmt,omitempty"`
CartHash string `json:"cart_hash,omitempty"`
Billing *Billing `json:"billing,omitempty"`
Shipping *Shipping `json:"shipping,omitempty"`
Links *Links `json:"_links,omitempty"`
FeeLines *[]FeeLine `json:"fee_lines,omitempty"`
Refunds *[]OrderRefund `json:"refunds,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
CouponLines *[]CouponLine `json:"coupon_lines,omitempty"`
LineItems *[]LineItems `json:"line_items,omitempty"`
TaxLines *[]TaxLines `json:"tax_lines,omitempty"`
ShippingLines *[]ShippingLines `json:"shipping_lines,omitempty"`
}
Order object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#order-properties
type OrderNote ¶
type OrderNote struct {
Id int `json:"id,omitempty"`
Author string `json:"author,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
Note string `json:"note,omitempty"`
CustomerNote bool `json:"customer_note,omitempty"`
AddedByUser bool `json:"added_by_user,omitempty"`
}
OrderNote object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#order-note-properties
type OrderNotesService ¶
type OrderNotesService service
Order Notes service
func (*OrderNotesService) Create ¶
func (service *OrderNotesService) Create(orderId string, orderNote *OrderNote) (*OrderNote, *http.Response, error)
Create an order Note. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order-note
func (*OrderNotesService) Delete ¶
func (service *OrderNotesService) Delete(orderId string, noteId string, opts *DeleteOrderParams) (*OrderNote, *http.Response, error)
Delete an order Note. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-an-order-note
func (*OrderNotesService) Get ¶
func (service *OrderNotesService) Get(orderId string, noteId string) (*OrderNote, *http.Response, error)
Get an order Note. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-an-order-note
func (*OrderNotesService) List ¶
func (service *OrderNotesService) List(orderId string, opts *ListOrderNotesParams) (*[]OrderNote, *http.Response, error)
List order Notes. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-order-notes
type OrderRefund ¶
type OrdersService ¶
type OrdersService service
Orders service
func (*OrdersService) Batch ¶
func (service *OrdersService) Batch(opts *BatchOrderUpdate) (*BatchOrderUpdateResponse, *http.Response, error)
Batch update orders. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-orders
func (*OrdersService) Create ¶
Create an order. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-an-order
func (*OrdersService) Delete ¶
func (service *OrdersService) Delete(orderId string, opts *DeleteOrderParams) (*Order, *http.Response, error)
Delete an order. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-an-order
func (*OrdersService) Get ¶
func (service *OrdersService) Get(orderId string, opts *GetOrderParams) (*Order, *http.Response, error)
Get an order. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-an-order
func (*OrdersService) List ¶
func (service *OrdersService) List(opts *ListOrdersParams) (*[]Order, *http.Response, error)
List orders. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-orders
func (*OrdersService) Update ¶
Update an order. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-an-order
type Product ¶
type Product struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Slug string `json:"slug,omitempty"`
Permalink string `json:"permalink,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
Type string `json:"type,omitempty"`
Status string `json:"status,omitempty"`
Featured bool `json:"featured,omitempty"`
CatalogVisibility string `json:"catalog_visibility,omitempty"`
Description string `json:"description,omitempty"`
ShortDescription string `json:"short_description,omitempty"`
Sku string `json:"sku,omitempty"`
Price string `json:"price,omitempty"`
RegularPrice string `json:"regular_price,omitempty"`
SalePrice string `json:"sale_price,omitempty"`
DateOnSaleFrom string `json:"date_on_sale_from,omitempty"`
DateOnSaleFromGmt string `json:"date_on_sale_from_gmt,omitempty"`
DateOnSaleTo string `json:"date_on_sale_to,omitempty"`
DateOnSaleToGmt string `json:"date_on_sale_to_gmt,omitempty"`
PriceHtml string `json:"price_html,omitempty"`
OnSale bool `json:"on_sale,omitempty"`
Purchasable bool `json:"purchasable,omitempty"`
TotalSales int `json:"total_sales,omitempty"`
Virtual bool `json:"virtual,omitempty"`
Downloadable bool `json:"downloadable,omitempty"`
DownloadLimit int `json:"download_limit,omitempty"`
DownloadExpiry int `json:"download_expiry,omitempty"`
ExternalUrl string `json:"external_url,omitempty"`
ButtonText string `json:"button_text,omitempty"`
TaxStatus string `json:"tax_status,omitempty"`
TaxClass string `json:"tax_class,omitempty"`
ManageStock bool `json:"manage_stock,omitempty"`
StockQuantity int `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"`
SoldIndividually bool `json:"sold_individually,omitempty"`
Weight string `json:"weight,omitempty"`
ShippingRequired bool `json:"shipping_required,omitempty"`
ShippingTaxable bool `json:"shipping_taxable,omitempty"`
ShippingClass string `json:"shipping_class,omitempty"`
ShippingClassId int `json:"shipping_class_id,omitempty"`
ReviewsAllowed bool `json:"reviews_allowed,omitempty"`
AverageRating string `json:"average_rating,omitempty"`
RatingCount int `json:"rating_count,omitempty"`
ParentId int `json:"parent_id,omitempty"`
PurchaseNote string `json:"purchase_note,omitempty"`
MenuOrder int `json:"menu_order,omitempty"`
Variations *[]int `json:"variations,omitempty"`
GroupedProducts *[]int `json:"grouped_products,omitempty"`
MetaData *[]int `json:"meta_data,omitempty"`
RelatedIds *[]int `json:"related_ids,omitempty"`
CrossSellIds *[]int `json:"cross_sell_ids,omitempty"`
UpsellIds *[]int `json:"upsell_ids,omitempty"`
Images *[]Image `json:"images,omitempty"`
Dimensions *ProductDimensions `json:"dimensions,omitempty"`
Downloads *[]ProductDownload `json:"downloads,omitempty"`
Categories *[]ProductCategory `json:"categories,omitempty"`
Tags *[]ProductTag `json:"tags,omitempty"`
Attributes *[]ProductAttributes `json:"attributes,omitempty"`
DefaultAttributes *[]DefaultAttributes `json:"default_attributes,omitempty"`
}
Product object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
type ProductAttributes ¶
type ProductCategory ¶
type ProductDimensions ¶
type ProductDownload ¶
type ProductTag ¶
type ProductTagLinks ¶
type ProductTagService ¶
type ProductTagService service
func (*ProductTagService) Batch ¶
func (service *ProductTagService) Batch(opts *BatchProductTagsUpdate) (*BatchProductTagsUpdateResponse, *http.Response, error)
Batch update product tags. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-product-tags
func (*ProductTagService) Create ¶
func (service *ProductTagService) Create(productTag *ProductTag) (*ProductTag, *http.Response, error)
Create a product tag. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product-tag
func (*ProductTagService) Delete ¶
func (service *ProductTagService) Delete(productTagID string) (*ProductTag, *http.Response, error)
Delete a product tag. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-product-tag
func (*ProductTagService) Get ¶
func (service *ProductTagService) Get(productTagID string) (*ProductTag, *http.Response, error)
Get a product tag. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-product-tag
func (*ProductTagService) List ¶
func (service *ProductTagService) List() ([]ProductTag, *http.Response, error)
List all product tags. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-product-tags
func (*ProductTagService) Update ¶
func (service *ProductTagService) Update(productTagID string, product *ProductTag) (*ProductTag, *http.Response, error)
Update a product tag. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-product-tag
type ProductVariation ¶
type ProductVariation struct {
Id int `json:"id,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
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 string `json:"date_on_sale_from,omitempty"`
DateOnSaleFromGmt string `json:"date_on_sale_from_gmt,omitempty"`
DateOnSaleTo string `json:"date_on_sale_to,omitempty"`
DateOnSaleToGmt string `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"`
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 string `json:"manage_stock,omitempty"`
StockQuantity int `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"`
ShippingClass string `json:"shipping_class,omitempty"`
ShippingClassId int `json:"shipping_class_id,omitempty"`
MenuOrder int `json:"menu_order,omitempty"`
Image *Image `json:"image,omitempty"`
Dimensions *ProductDimensions `json:"dimensions,omitempty"`
Downloads *[]ProductDownload `json:"downloads,omitempty"`
Attributes *[]ProductAttributes `json:"attributes,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
}
ProductVariation object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#product-properties
type ProductVariationService ¶
type ProductVariationService service
func (*ProductVariationService) Batch ¶
func (service *ProductVariationService) Batch(productId int, opts *BatchProductVariationUpdate) (*BatchProductVariationUpdateResponse, *http.Response, error)
Batch update products. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-products
func (*ProductVariationService) Create ¶
func (service *ProductVariationService) Create(productId int, variation *ProductVariation) (*ProductVariation, *http.Response, error)
Create a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product
func (*ProductVariationService) Delete ¶
func (service *ProductVariationService) Delete(productId int, variantId int, opts *DeleteProductParams) (*ProductVariation, *http.Response, error)
Delete a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-product-variation
func (*ProductVariationService) Get ¶
func (service *ProductVariationService) Get(productID int, variationID string) (*ProductVariation, *http.Response, error)
Get a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-product
func (*ProductVariationService) List ¶
func (service *ProductVariationService) List(productId int, opts *ListProductVariationParams) ([]ProductVariation, *http.Response, error)
List products. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products
func (*ProductVariationService) Update ¶
func (service *ProductVariationService) Update(productID int, variation *ProductVariation) (*ProductVariation, *http.Response, error)
Update a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-product
type ProductsService ¶
type ProductsService service
Product service
func (*ProductsService) Batch ¶
func (service *ProductsService) Batch(opts *BatchProductUpdate) (*BatchProductUpdateResponse, *http.Response, error)
Batch update products. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-products
func (*ProductsService) Create ¶
Create a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-product
func (*ProductsService) Delete ¶
func (service *ProductsService) Delete(productID int, opts *DeleteProductParams) (*Product, *http.Response, error)
Delete a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-product
func (*ProductsService) Get ¶
Get a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-product
func (*ProductsService) List ¶
func (service *ProductsService) List(opts *ListProductParams) ([]Product, *http.Response, error)
List products. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-products
func (*ProductsService) Update ¶
func (service *ProductsService) Update(productID int, product *Product) (*Product, *http.Response, error)
Update a product. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-product
type Refund ¶
type Refund struct {
Id int `json:"id,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
Amount string `json:"amount,omitempty"`
Reason string `json:"reason,omitempty"`
RefundedBy int `json:"refunded_by,omitempty"`
RefundedPayment bool `json:"refunded_payment,omitempty"`
ApiRefund bool `json:"api_refund,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
LineItems *[]RefundLineItem `json:"line_items,omitempty"`
}
Refund object. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#order-refund-properties
type RefundLineItem ¶
type RefundLineItem struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
ProductId int `json:"product_id,omitempty"`
VariationId int `json:"variation_id,omitempty"`
Quantity int `json:"quantity,omitempty"`
TaxClass int `json:"tax_class,omitempty"`
Subtotal string `json:"subtotal,omitempty"`
SubtotalTax string `json:"subtotal_tax,omitempty"`
Total string `json:"total,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Sku string `json:"sku,omitempty"`
Price string `json:"price,omitempty"`
RefundTotal float64 `json:"refund_total,omitempty"`
Taxes *[]RefundTax `json:"taxes,omitempty"`
MetaData *[]MetaData `json:"meta_data,omitempty"`
}
type RefundsService ¶
type RefundsService service
Refunds service
func (*RefundsService) Create ¶
func (service *RefundsService) Create(orderId string, refund *Refund) (*Refund, *http.Response, error)
Create a refund. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-refund
func (*RefundsService) Delete ¶
func (service *RefundsService) Delete(orderId string, refundId string, opts *DeleteRefundParams) (*Refund, *http.Response, error)
Delete a refund. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-refund
func (*RefundsService) Get ¶
func (service *RefundsService) Get(orderId string, refundId string) (*Refund, *http.Response, error)
Get a refund. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-refund
func (*RefundsService) List ¶
func (service *RefundsService) List(orderId string, opts *ListRefundParams) (*[]Refund, *http.Response, error)
List orders. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-refunds
type Shipping ¶
type Shipping struct {
FirstName string `json:"first_name,omitempty"`
LastName string `json:"last_name,omitempty"`
Company string `json:"company,omitempty"`
Address1 string `json:"address_1,omitempty"`
Address2 string `json:"address_2,omitempty"`
City string `json:"city,omitempty"`
State string `json:"state,omitempty"`
Postcode string `json:"postcode,omitempty"`
Country string `json:"country,omitempty"`
Phone string `json:"phone,omitempty"`
}
type ShippingLines ¶
type ShippingLines struct {
ID int `json:"id,omitempty"`
MethodTitle string `json:"method_title,omitempty"`
MethodID string `json:"method_id,omitempty"`
InstanceID string `json:"instance_id,omitempty"`
Total string `json:"total,omitempty"`
TotalTax string `json:"total_tax,omitempty"`
Taxes *[]interface{} `json:"taxes,omitempty"`
MetaData *[]interface{} `json:"meta_data,omitempty"`
}
type TaxLines ¶
type TaxLines struct {
ID int `json:"id,omitempty"`
RateCode string `json:"rate_code,omitempty"`
RateID int `json:"rate_id,omitempty"`
Label string `json:"label,omitempty"`
Compound bool `json:"compound"`
TaxTotal string `json:"tax_total,omitempty"`
ShippingTaxTotal string `json:"shipping_tax_total,omitempty"`
RatePercent float64 `json:"rate_percent"`
MetaData *[]interface{} `json:"meta_data,omitempty"`
}
type Taxes ¶
type Taxes struct {
Id int `json:"id,omitempty"`
Rate_code string `json:"rate_code,omitempty"`
Rate_id string `json:"rate_id,omitempty"`
Label string `json:"label,omitempty"`
Compound bool `json:"compound"`
TaxTotal string `json:"tax_total,omitempty"`
ShippingTaxTotal string `json:"shipping_tax_total,omitempty"`
}
type Webhook ¶
type Webhook struct {
Id int `json:"id,omitempty"`
Name string `json:"name,omitempty"`
Status string `json:"status,omitempty"`
Topic string `json:"topic,omitempty"`
Resource string `json:"resource,omitempty"`
Event string `json:"event,omitempty"`
Hooks []string `json:"hooks,omitempty"`
DeliveryUrl string `json:"delivery_url,omitempty"`
Secret string `json:"secret,omitempty"`
DateCreated string `json:"date_created,omitempty"`
DateCreatedGmt string `json:"date_created_gmt,omitempty"`
DateModified string `json:"date_modified,omitempty"`
DateModifiedGmt string `json:"date_modified_gmt,omitempty"`
Links *Links `json:"links,omitempty"`
}
type WebhookService ¶
type WebhookService service
Webhooks service
func (*WebhookService) Batch ¶
func (service *WebhookService) Batch(opts *BatchWebhookUpdate) (*BatchWebhookUpdateResponse, *http.Response, error)
Batch update webhooks. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#batch-update-webhooks
func (*WebhookService) Create ¶
Create a webhook. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#create-a-webhook
func (*WebhookService) Delete ¶
func (service *WebhookService) Delete(webhookID string, opts *DeleteWebhookParams) (*Webhook, *http.Response, error)
Delete a webhook. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#delete-a-webhook
func (*WebhookService) Get ¶
Get a wehook. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#retrieve-a-webhook
func (*WebhookService) List ¶
func (service *WebhookService) List(opts *ListWebhooksParams) (*[]Webhook, *http.Response, error)
List Webhooks. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#list-all-webhooks
func (*WebhookService) Update ¶
func (service *WebhookService) Update(webhookID string, webhook *Webhook) (*Webhook, *http.Response, error)
Update a webhook. Reference: https://woocommerce.github.io/woocommerce-rest-api-docs/#update-a-webhook