Documentation ¶
Index ¶
- type Address
- type BCClient
- func (s *BCClient) GetBody(url string) (body []byte, err error)
- func (s *BCClient) GetOrderByID(orderID string) (order Order, err error)
- func (s *BCClient) GetOrderCount() (*OrderCount, error)
- func (s *BCClient) GetOrderQuery(oq OrderQuery) (*[]Order, error)
- func (s *BCClient) GetOrders(status int) (*[]Order, error)
- func (s *BCClient) GetOrdersAndProducts(status int) (*[]Order, error)
- func (s *BCClient) GetProductDetail(os []Order) (err error)
- func (s *BCClient) GetShipments(oq OrderQuery) ([]Shipment, error)
- type BCDate
- type Order
- type OrderCount
- type OrderItem
- type OrderProduct
- type OrderProductOption
- type OrderQuery
- type Resource
- type Shipment
- type ShippingAddress
- type StatusCount
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { FirstName string `json:"first_name"` LastName string `json:"last_name"` Company string StreetOne string `json:"street_1"` StreetTwo string `json:"street_2"` City string State string Zip string Country string Phone string Email string }
Address struct representing a BigCommerce address resource
type BCClient ¶
BCClient represents the client wrapper containing BC specific connection details
func (*BCClient) GetOrderByID ¶
GetOrderByID - return a single order with Shipping Address Populated.
func (*BCClient) GetOrderCount ¶
func (s *BCClient) GetOrderCount() (*OrderCount, error)
GetOrderCount Return an OrderCount struct containing statuses and counts
func (*BCClient) GetOrderQuery ¶
func (s *BCClient) GetOrderQuery(oq OrderQuery) (*[]Order, error)
GetOrderQuery Return a slice of Order structs based on passed in query object
func (*BCClient) GetOrdersAndProducts ¶
GetOrdersAndProducts Return a slice of Order structs based on passed in status
func (*BCClient) GetProductDetail ¶
GetProductDetail - Will attempt to concurrently fill the order slice elements with their respective products from the BC api
func (*BCClient) GetShipments ¶
func (s *BCClient) GetShipments(oq OrderQuery) ([]Shipment, error)
GetShipments get shipments from the orders returned by the query
type BCDate ¶
BCDate struct representing a BigCommerce date resource
func (*BCDate) UnmarshalJSON ¶
UnmarshalJSON unmarshall date into time object
type Order ¶
type Order struct { ID int `json:"id"` ItemsTotal int `json:"items_total"` ItemsShipped int `json:"items_shipped"` StaffNotes string `json:"staff_notes"` CustomerMessage string `json:"customer_message"` ProductResource Resource `json:"products"` Products []OrderProduct BillingAddress Address `json:"billing_address"` ShippingResource Resource `json:"shipping_addresses"` ShippingAddresses []ShippingAddress Date BCDate `json:"date_created"` DateShipped BCDate `json:"date_shipped"` }
Order struct representing the return body of BigCommerce GET /orders
type OrderCount ¶
type OrderCount struct { StatusCounts []StatusCount `json:"statuses"` Count int `json:"count"` }
OrderCount struct representing the return body of BigCommerce GET /orders/count
type OrderItem ¶
type OrderItem struct { OrderProductID int64 `json:"order_product_id"` ProductID int64 `json:"product_id"` Quantity int64 `json:"quantity"` }
OrderItem struct representing BC orderitem
type OrderProduct ¶
type OrderProduct struct { ID int `json:"id"` ProductID int `json:"product_id"` Name string `json:"name"` ProductOptions []OrderProductOption `json:"product_options"` Quantity int `json:"quantity"` QuantityRefunded int `json:"quantity_refunded"` SKU string `json:"sku"` }
OrderProduct struct representing the product sub object that is part of the Order
type OrderProductOption ¶
type OrderProductOption struct { DisplayName string `json:"display_name"` DisplayValue string `json:"display_value"` Value string `json:"value"` Type string `json:"type"` }
OrderProductOption struct representing the product option detail objects that are part of the order product
type OrderQuery ¶
type OrderQuery struct { MinID int `url:"min_id,omitempty"` MaxID int `url:"max_id,omitempty"` MinTotal float64 `url:"min_total,omitempty"` MaxTotal float64 `url:"max_total,omitempty"` CustomerID int `url:"customer_id,omitempty"` Email string `url:"email,omitempty"` StatusID int `url:"status_id,omitempty"` CartID string `url:"cart_id,omitempty"` PaymentMethod string `url:"payment_method,omitempty"` MinDateCreated time.Time `url:"-"` MaxDateCreated time.Time `url:"-"` MinDateModified time.Time `url:"-"` MaxDateModified time.Time `url:"-"` Page int `url:"page,omitempty"` Limit int `url:"limit,omitempty"` Sort string `url:"sort,omitempty"` IsDeleted bool `url:"is_deleted,omitempty"` MinDateCreatedRaw string `url:"min_date_created,omitempty"` MaxDateCreatedRaw string `url:"max_date_created,omitempty"` MinDateModifiedRaw string `url:"min_date_modified,omitempty"` MaxDateModifiedRaw string `url:"max_date_modified,omitempty"` }
OrderQuery struct to handle orders endpoint search query params
func (OrderQuery) GetRawQuery ¶
func (q OrderQuery) GetRawQuery() (raw string, err error)
GetRawQuery gets the struct in query string form
type Shipment ¶
type Shipment struct { ID int64 `json:"id"` OrderID int64 `json:"order_id"` CustomerID int64 `json:"customer_id"` OrderAddressID int64 `json:"order_address_id"` DateCreated string `json:"date_created"` TrackingNumber string `json:"tracking_number"` MerchantShippingCost float64 `json:"merchant_shipping_cost,string"` ShippingMethod string `json:"shipping_method"` Comments string `json:"comments"` ShippingProvider string `json:"shipping_provider"` TrackingCarrier string `json:"tracking_carrier"` TrackingLink string `json:"tracking_link"` BillingAddress Address `json:"billing_address"` ShippingAddress Address `json:"shipping_address"` Items []OrderItem `json:"items"` }
Shipment struct representing BC shipment
type ShippingAddress ¶
ShippingAddress struct representing a BigCommerce shipping address resource
type StatusCount ¶
type StatusCount struct { ID int `json:"id"` Name string `json:"name"` SystemLabel string `json:"system_label"` CustomLabel string `json:"custom_label"` SystemDesc string `json:"system_description"` Count int `json:"count"` SortOrder int `json:"sort_order"` }
StatusCount struct representing the individual statuses and count returned by BigCommerce GET /orders/count