cv3go

package module
v0.0.0-...-420ffc9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 18, 2019 License: MPL-2.0 Imports: 13 Imported by: 4

README

cv3go

cv3go is a go library for working with the CV3 API

It has been developed to accomplish specific integrations, so certain API functions and fields may not be included but should be trivial to add since the core connection and parsing is already being done.

Install

Run go get to download via git.

go get github.com/estivate/cv3go

Quick start

Use this library from your Go program like this but with your real credentials:

package main

import (
	"fmt"
	"log"

	"github.com/cv3/cv3go"
)

func main() {
	cv3username, cv3password, cv3apiKey := "**********", "*********", "***********"

	log.Printf("Getting product ids from CV3\r\n")
	api := cv3go.NewApi()
	api.Debug = true
	api.SetCredentials(cv3username, cv3password, cv3apiKey)
	api.GetProductIds()
	data := api.Execute()
	fmt.Printf(string(data))
}

Other Useful Snippits

	api.Debug = false // turn off all the XML printing and such
	// get new orders, or a range or orders
	api.GetOrdersNew()
	// api.GetOrdersRange("20010156", "20010158")
	data := api.Execute()
	orders := api.UnmarshalOrders(data)
	log.Printf("Found %v pending orders\r\n", len(orders.Orders))
	for i := range orders.Orders {
		// ... do stuff with each order ...
	} 
	// get catalog requests
	catalogs := api.GetCatalogRequestsNew()
	log.Printf("Found %v pending requests to process\r\n", len(catalogs.CatalogRequests))
	for i := range catalogs.CatalogRequests {
		log.Printf("Catalog Request #%v importing\r\n", catalogs.CatalogRequests[i].CatalogId)
	}
	// get product details
	api.GetProductSingle("2231")
	data := api.Execute()
	// confirm receipt of order (remove from pending)
	api.OrderConfirm("100082")
	data := api.Execute()

You will probably want to create a config file to store the authentication data in, since the password gets rotated a good bit and you'll need to pop in and update it occassionally. The Go Text Template library is very useful for formatting the CV3 data for a 3rd party system or vice versus. I often find myself grabbing data from CV3, pushing it through a Go Template and then submitting it to another API.

Documentation

Overview

Package cv3go is used to connect to the CV3 API

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUTF8

func CheckUTF8(b []byte) []byte

CheckUTF8 converts []byte to []rune to string to []byte to make sure only utf8 characters are used.

func PrintToFile

func PrintToFile(b []byte, fileName string)

PrintToFile will print the passed in []bytes to a file

func StringToIntSlice

func StringToIntSlice(strs []string) []int

StringToIntSlice converts a slice of strings into a sorted slice of inherits used in GetAllCategoriesExcept()

Types

type Api

type Api struct {
	Debug bool
	// contains filtered or unexported fields
}

Api is the struct to send api calls

func NewApi

func NewApi() *Api

NewApi Generate a new API

func (*Api) AddPricingFromStruct

func (self *Api) AddPricingFromStruct(p interface{})

AddPricingFromStruct marshals a passed in struct and adds it to the pricing fields

func (*Api) AddRequestFromStruct

func (self *Api) AddRequestFromStruct(req interface{})

AddRequestFromStruct marshals a passed in struct and adds it to the request fields

func (*Api) CatalogRequestConfirm

func (self *Api) CatalogRequestConfirm(o string)

CatalogRequest Set request to catalogRequestConfirm->CatalogRequestID(o)

func (*Api) ConfirmCatalogRequest

func (self *Api) ConfirmCatalogRequest(catIDs []string)

ConfirmCatalogRequest will set the catalog requests to confrimed OrderStatus

func (*Api) Execute

func (self *Api) Execute(jsonReturn ...bool) (n []byte)

Execute Sends the request, return the response Note, one of the above requests must be set up first, and the credentials must be set up for this to work

func (*Api) GetAllCategories

func (self *Api) GetAllCategories(isTopLevel bool)

GetAllCategories uses reqCategoryRange with no end set

func (*Api) GetAllCategoriesExcept

func (self *Api) GetAllCategoriesExcept(exceptIDs []string)

GetAllCategoriesExcept uses reqCategoryRange with a passed in slice of ids to skip

func (*Api) GetCatalogRequestsNew

func (self *Api) GetCatalogRequestsNew() CatalogRequests

GetCatalogRequestsNew Set the request to reqCatalogRequests->reqNew

func (*Api) GetCustomerGroups

func (self *Api) GetCustomerGroups()

GetCustomerGroups Set the request to reqCustomerInformation

func (*Api) GetOrdersNew

func (self *Api) GetOrdersNew()

GetOrdersNew Set the request to reqOrders->reqOrderNew

func (*Api) GetOrdersRange

func (self *Api) GetOrdersRange(o string, p string)

GetOrdersRange Set the request to reqOrders->reqOrderOutOfStockPointRange from o to p

func (*Api) GetProductIds

func (self *Api) GetProductIds() ProductIDs

GetProductIds Set the request to reqProductIDs

func (*Api) GetProductRange

func (self *Api) GetProductRange(start string, end string)

GetProductRange Set the request to reqProducts->reqProductRange using start and end to dictate the range

func (*Api) GetProductSKU

func (self *Api) GetProductSKU(o string, t bool)

GetProductSKU Set the request to reqProducts->reqProductSKU containing string(o) as the data

func (*Api) GetProductSKUs

func (self *Api) GetProductSKUs(o []string, t bool)

GetProductSKUs gets the product skus

func (*Api) GetProductSingle

func (self *Api) GetProductSingle(o string)

GetProductSingle Set the request to reqProducts->reqProductSingle containing string(o) as the data

func (*Api) GetProductSingleBySKU

func (self *Api) GetProductSingleBySKU(o string)

GetProductSingleBySKU is from Ben, to get a singlee product by sku

func (*Api) GetProductSkus

func (self *Api) GetProductSkus()

GetProductSkus Set the request to reqProductSKU

func (*Api) OrderConfirm

func (self *Api) OrderConfirm(o string)

OrderConfirm Set request to orderConfirm->orderConf using string o as contents

func (*Api) PushInventory

func (self *Api) PushInventory(o string, t bool)

PushInventory Set the request to an inventory update call using o as the data

func (*Api) SetCredentials

func (self *Api) SetCredentials(username, password, serviceID string)

SetCredentials Set the credentials of the API

func (*Api) UnmarshalCategories

func (self *Api) UnmarshalCategories(n []byte) Categories

UnmarshalCategories

func (*Api) UnmarshalInventory

func (self *Api) UnmarshalInventory(n []byte) Products

UnmarshalInventory Convert an XML response containing Inventory to a Products object

func (*Api) UnmarshalOrders

func (self *Api) UnmarshalOrders(n []byte) Orders

UnmarshalOrders Convert an XML response containing order to an Orders object

func (*Api) UnmarshalProduct

func (self *Api) UnmarshalProduct(n []byte) Product

UnmarshalProduct Convert an XML response containing a single product to a Product object

func (*Api) UpdateOrderStatus

func (self *Api) UpdateOrderStatus(o string, p string, q string)

UpdateOrderStatus Set request to status->[orderID(o),status(p),tracking(q)]

type Attributes

type Attributes struct {
	Active string   `xml:"active,attr,omitempty"`
	Values []string `xml:"Value,omitempty"`
}

Attributes holds product attribute information

type ByID

type ByID struct {
	ID []string `xml:"ID,omitemtpy"`
}

ByID holds ID request data for pricing calls to cv3 WebServiceChunkFunc

type ByName

type ByName struct {
	Name []string `xml:"Name,omitempty"`
}

ByName holds name request data for pricing calls to cv3 WebServiceChunkFunc

type C

type C struct {
	// XMLName xml.Name `xml:"CV3Data"`
	CV3Data       RequestBody
	Confirms      []Confirm     `xml:"confirm" json:"confirm"`
	OrderStatuses []OrderStatus `xml:"orders" json:"orders"`
	Products      Products      `xml:"products" json:"products"`
}

C s

type CV3Data

type CV3Data struct {
	// XMLName xml.Name `xml:"CV3Data"`
	CV3Data       RequestBody
	Confirms      []Confirm     `xml:"confirm"`
	OrderStatuses []OrderStatus `xml:"orders"`
	Products      []ProductCall `xml:"products"`
	Pricing       PricingCall   `xml:"pricing"`
}

CV3Data struct

type CatalogRequest

type CatalogRequest struct {
	CatalogId     string `xml:"id,attr"`
	DateRequested string `xml:"DateRequested"`
	Source        string `xml:"Source"`
	Type          string `xml:"Type"`
	FirstName     string `xml:"CustomerInformation>FirstName"`
	LastName      string `xml:"CustomerInformation>LastName"`
	Company       string `xml:"CustomerInformation>Company"`
	Email         string `xml:"CustomerInformation>Email"`
	Phone         string `xml:"CustomerInformation>Phone"`
	Address       string `xml:"CustomerInformation>Address>Address1"`
	Address2      string `xml:"CustomerInformation>Address>Address2"`
	City          string `xml:"CustomerInformation>Address>City"`
	State         string `xml:"CustomerInformation>Address>State"`
	PostalCode    string `xml:"CustomerInformation>Address>PostalCode"`
	Country       string `xml:"CustomerInformation>Address>Country"`
}

type CatalogRequests

type CatalogRequests struct {
	CatalogRequests []CatalogRequest `xml:"catalogRequests>CatalogRequest"`
}

type Categories

type Categories struct {
	Categories []Category `xml:"categories>category"`
}

Categories data sructure for Categories

type Category

type Category struct {
	Invisible          string        `xml:"invisible,attr"`
	TopLevel           string        //not sent in xml, set in cv3Intigration.getCategories.go
	Featured           string        `xml:"featured,attr"`
	Name               string        `xml:"Name,omitempty"`
	ID                 string        `xml:"ID,omitempty"`
	URLName            string        `xml:"URLName,omitempty"`
	Description        string        `xml:"Description,omitempty"`
	MetaTitle          string        `xml:"MetaTitle,omitempty"`
	MetaDescription    string        `xml:"MetaDescription,omitempty"`
	MetaKeywords       string        `xml:"MetaKeyword,omitempty"`
	Template           string        `xml:"Template,omitempty"`
	NumProductsPerPage string        `xml:"NumProductsPerPage,omitempty"`
	Products           []string      `xml:"Products>SKU,omitempty"`
	FeaturedProducts   []string      `xml:"FeaturedProducts>SKU,omitempty"`
	CustomFields       []Custom      `xml:"Custom,omitempty"`
	SubCategories      []SubCategory `xml:"SubCategories>SubCategory"`
}

Category is the struct used when unmarshaling categories

type Confirm

type Confirm struct {
	Confirm string `xml:",innerxml"`
}

Confirm struct

type ConfirmCatalogRequest

type ConfirmCatalogRequest struct {
	XMLName          xml.Name `xml:"catalogRequestConfirm"`
	CatalogRequestID []string `xml:"CatalogRequestID"`
}

ConfirmCatalogRequest is the struct to send the confirm catalog database

type Credentials

type Credentials struct {
	XMLName   xml.Name `xml:"authenticate"`
	User      string   `xml:"user"`
	Password  string   `xml:"pass"`
	ServiceID string   `xml:"serviceID"`
}

Credentials struct

type Custom

type Custom struct {
	ID     string `xml:"id,attr"`
	Custom string `xml:",chardata"`
}

Custom is the struct to hold the custom fields

type CustomField

type CustomField struct {
	Value string `xml:",innerxml"`
}

type DependancyProducts

type DependancyProducts struct {
	Type string   `xml:"type,attr,omitempty"`
	SKUs []string `xml:"SKU,omitempty"`
}

DependancyProducts holds the sku of the product that is depended upon

type Discount

type Discount struct {
	Delete string `xml:"delete,attr,omitempty"`
	Qty    string `xml:"Qty"`
	Amount string `xml:"Amount"`
	Type   string `xml:"Type"`
}

Discount is the struct to hold data for the discount tables for the cv3 CV3WebService

type DiscountTable

type DiscountTable struct {
	Delete             string    `xml:"delete,attr"`
	Name               string    `xml:"Name"`
	Description        string    `xml:"Description"`
	Discounts          Discounts `xml:"Discounts"`
	AdditionalDiscount Discount  `xml:"AdditionalDiscount"`
}

DiscountTable is the struct to hold discount table data for the cv3 CV3WebService

type DiscountTables

type DiscountTables struct {
	ReplaceExisting string          `xml:"replace_existing,attr"`
	DiscountTable   []DiscountTable `xml:"DiscountTable"`
}

DiscountTables is the struct to hold discountTable data for CV3's webservice

type Discounts

type Discounts struct {
	Discount []Discount `xml:"Discount"`
}

Discounts is the struct to hold discount table data for the cv3 RunWebServiceProductChunkFunction

type Document

type Document struct {
	DaysAvailable string `xml:"DaysAvailable,omitempty"`
	Description   string `xml:"Description,omitempty"`
}

Document holds information dealing with the electronic delivery

type ElectronicDelivery

type ElectronicDelivery struct {
	Active   string   `xml:"active,attr,omitempty"`
	Document Document `xml:"Document,omitempty"`
}

ElectronicDelivery holds the information about the products electronic delivery

type GiftCertificate

type GiftCertificate struct {
	Active        string `xml:"active,attr,omitempty"`
	DaysAvailable string `xml:"DaysAvailable,omitempty"`
	Value         string `xml:"Value,omitempty"`
}

GiftCertificate hold information about gift certificates

type Image

type Image struct {
	ImageSetThumb1 string `xml:"Thumbnail,omitempty"`
}

Image is the struct for marshalling and unmarshalling cv3's Images node

type Images

type Images struct {
	Images []Image `xml:"Image,omitempty"`
}

Images is the struct for marshalling and unmarshalling cv3's Images node

type InventoryControl

type InventoryControl struct {
	InventoryControlExempt   string `xml:"inventory_control_exempt,attr,omitempty"`
	InventoryStatus          string `xml:"Status,omitempty"`
	InventoryOnHand          string `xml:"Inventory,omitempty"`
	OnOrder                  int    `xml:"OnOrder,omitempty"`
	InventoryBackorderedDate string `xml:"InventoryBackorderedDate,omitempty"`
	OutOfStock               string `xml:"OutOfStockPoint,omitempty"`
}

InventoryControl struct for marshalling and unmarshalling cv3's xml node of InventoryControl

type Meta

type Meta struct {
	MetaKeywords    string `xml:"Keyword,omitempty"`
	MetaTitle       string `xml:"Title,omitempty"`
	MetaDescription string `xml:"Description,omitempty"`
}

Meta is the struct for marshalling and unmarshalling the cv3's Meta node

type Order

type Order struct {
	OrderID             string `xml:"orderID"`
	PriceCategory       string `xml:"priceCategory"`
	TotalPrice          string `xml:"totalPrice"`
	TotalShipping       string `xml:"totalShipping"`
	TotalTax            string `xml:"totalTax"`
	DateOrdered         string `xml:"dateOrdered"`
	TimeOrdered         string `xml:"timeOrdered"`
	PayMethod           string `xml:"payMethod"`
	AdditionalPayMethod string `xml:"additionalPayMethod"`
	SourceCode          string `xml:"sourceCode"`
	PromoCode           string `xml:"promoCode"`
	Comments            string `xml:"comments"`
	IP                  string `xml:"IP"`
	BillingCompany      string `xml:"billing>company"`
	BillingFirstName    string `xml:"billing>firstName"`
	BillingLastName     string `xml:"billing>lastName"`
	BillingTitle        string `xml:"billing>title"`
	BillingAddress      string `xml:"billing>address1"`
	BillingAddress2     string `xml:"billing>address2"`
	BillingCity         string `xml:"billing>city"`
	BillingState        string `xml:"billing>state"`
	BillingZip          string `xml:"billing>zip"`
	BillingCountry      string `xml:"billing>country"`
	BillingEmail        string `xml:"billing>email"`
	BillingPhone        string `xml:"billing>phone"`
	BillingOptOut       string `xml:"billing>optOut"`
	//CC
	CCType          string `xml:"billing>CCInfo>CCType"`
	CCName          string `xml:"billing>CCInfo>CCName"`
	CCNum           string `xml:"billing>CCInfo>CCNum"`
	CCExpM          string `xml:"billing>CCInfo>CCExpM"`
	CCExpY          string `xml:"billing>CCInfo>CCExpY"`
	AuthCode        string `xml:"billing>CCInfo>authCode"`
	AuthAmount      string `xml:"billing>CCInfo>authAmount"`
	RequestToken    string `xml:"billing>CCInfo>token"`
	CCTransactionID string `xml:"billing>CCInfo>transactionID"`
	//GC
	GiftCertificate   string `xml:"billing>GCInfo>giftCertificate"`
	GCTotalAmountUsed string `xml:"billing>GCInfo>totalAmountUsed"`
	GCAmountUsed      string `xml:"billing>GCInfo>amountUsed"`
	//EC
	ECAccountName       string             `xml:"billing>ECInfo>accountName"`
	ECRoutingNumber     string             `xml:"billing>ECInfo>routingNumber"`
	ECAccountNumber     string             `xml:"billing>ECInfo>accountNumber"`
	ECBankName          string             `xml:"billing>ECInfo>bankName"`
	PurchaseOrder       string             `xml:"purchaseOrder"`
	PayPalBuyer         string             `xml:"payPalInfo>Buyer"`
	PayPalAmount        string             `xml:"payPalInfo>Amount"`
	PayPalTransactionID string             `xml:"payPalInfo>TransactionID"`
	AmazonOrderIDs      string             `xml:"amazonOrderIDsz"`
	ShipTos             []ShipTo           `xml:"shipTos>shipTo"`
	CustomFields        []CustomField      `xml:"customFields>customField"`
	TotalOrderDiscount  TotalOrderDiscount `xml:"totalOrderDiscount"`
	VisaCheckoutInfo    VisaCheckoutInfo   `xml:"visaCheckoutInfo"`
}

type OrderStatus

type OrderStatus struct {
	OrderStatus string `xml:",innerxml"`
}

OrderStatus struct

type Orders

type Orders struct {
	Orders []Order `xml:"orders>order"`
}

type Package

type Package struct {
	ShipsInOwnBox string `xml:"ships_in_own_box,attr,omitempty"`
	Length        string `xml:"Length,omitempty"`
	Width         string `xml:"Width,omitempty"`
	Height        string `xml:"Height,omitempty"`
}

Package hold the shipping package information

type Price

type Price struct {
}

type Pricing

type Pricing struct {
	PriceCategory string `xml:"price_category,attr,omitempty"`
	StandardPrice string `xml:"StandardPrice,omitempty"`
	SpecialPrice  string `xml:"SpecialPrice,omitempty"`
}

Pricing is the struct for marshalling and unmarshalling cv3's price node

type PricingCall

type PricingCall struct {
	Pricing string `xml:",innerxml"`
}

Pricing will hold pricing import reqCustomerInformation

type ProdCategories

type ProdCategories struct {
	IDs []string `xml:"ID,omitempty"`
}

ProdCategories is the struct for marshalling and unmarshalling cv3's Categories node

type Product

type Product struct {
	XMLName          xml.Name         `xml:"product"`
	Inactive         string           `xml:"inactive,attr" json:"inactive,attr"`
	New              string           `xml:"new,attr,omitempty"`
	Sku              string           `xml:"SKU" json:"SKU"`
	ProdId           string           `xml:"ProdID,omitempty"`
	Name             string           `xml:"Name,omitempty"`
	UrlName          string           `xml:"URLName,omitempty"`
	InventoryControl InventoryControl `xml:"InventoryControl,omitempty"`
	Retail           Retail           `xml:"Retail,omitempty"`
	Wholesale        Wholesale        `xml:"Wholesale,omitempty"`
	SubProducts      SubProducts      `xml:"SubProducts,omitempty"`
	Description      string           `xml:"Description,omitempty"`
	Keywords         string           `xml:"Keywords,omitempty"`
	Meta             Meta             `xml:"Meta,omitempty"`
	Images           Images           `xml:"Images,omitempty"`
	Categories       ProdCategories   `xml:"Categories,omitempty"`
	DefaultCategory  string           `xml:"DefaultCategory,omitempty"`
	Attributes       Attributes       `xml:"Attributes,omitempty"`
	Rating           string           `xml:"Rating,omitempty"`
}

Product is the struct used when unmarshaling inventory items

type ProductCall

type ProductCall struct {
	ProductCall string `xml:",innerxml"`
}

ProductCall struct

type ProductGroup

type ProductGroup struct {
	Delete        string `xml:"delete,attr"`
	Name          string `xml:"Name"`
	Description   string `xml:"Description"`
	DiscountTable string `xml:"DiscountTable"`
	Type          string `xml:"Type"`
	Products      []SKU  `xml:"Products"`
}

ProductGroup is the struct to hold product group data for the cv3 webservice calls

type ProductGroups

type ProductGroups struct {
	ProductGroup []ProductGroup `xml:"ProductGroup"`
}

ProductGroups is the struct to hold data for the cv3 webservice productGroup calls

type ProductIDs

type ProductIDs struct {
	ID []string `xml:"productIDs>ID"`
}

ProductIDs struct to hold product IDs

type Products

type Products struct {
	XMLName  xml.Name  `xml:"products"`
	Products []Product `xml:"product,omitempty" json:"products"`
}

Products data sructure for Products

type ReqDiscountTables

type ReqDiscountTables struct {
	XMLName   xml.Name `xml:"reqDiscountTables"`
	ReturnAll string   `xml:"return_all,attr"`
	ByName    *ByName  `xml:"ByName,omitempty"`
	ByID      *ByID    `xml:"ByID,omitempty"`
}

ReqDiscountTables is the struct for requesting discount tables from the cv3 web service

type ReqPricing

type ReqPricing struct {
	XMLName xml.Name    `xml:"reqPricing"`
	Data    interface{} `xml:",innerxml"`
}

ReqPricing is the struct to hold various pricing requests from the cv3 web serviceID

type ReqProductGroups

type ReqProductGroups struct {
	XMLName   xml.Name `xml:"reqProductGroups"`
	ReturnAll string   `xml:"return_all,attr"`
	ByName    *ByName  `xml:"ByName,omitempty"`
	ByID      *ByID    `xml:"ByIDomitempty"`
}

ReqProductGroups is the struct to hold data for the product group request to cv3's WebServiceChunkFunc

type Request

type Request struct {
	Request string `xml:",innerxml"`
}

Request struct

type RequestBody

type RequestBody struct {
	XMLName  xml.Name `xml:"request"`
	Auth     Credentials
	Requests []Request `xml:"requests"`
}

RequestBody struct

type Retail

type Retail struct {
	Active string  `xml:"active,attr,omitempty"`
	Price  Pricing `xml:"Price,omitempty"`
}

Retail is the struct for marshalling and unmarshalling cv3's retail node

type SKU

type SKU struct {
	SKU string `xml:"SKU"`
}

SKU is the struct to hold skus

type ShipTo

type ShipTo struct {
	Name           string          `xml:"name"`
	FirstName      string          `xml:"firstName"`
	LastName       string          `xml:"lastName"`
	Company        string          `xml:"company"`
	Title          string          `xml:"title"`
	Address        string          `xml:"address1"`
	Address2       string          `xml:"address2"`
	City           string          `xml:"city"`
	State          string          `xml:"state"`
	Zip            string          `xml:"zip"`
	Country        string          `xml:"country"`
	Phone          string          `xml:"phone"`
	Tax            string          `xml:"tax"`
	Shipping       string          `xml:"shipping"`
	Message        string          `xml:"message"`
	ShipMethod     string          `xml:"shipMethod"`
	ShipMethodCode string          `xml:"shipMethodCode"`
	ShipOn         string          `xml:"shipOn"`
	GiftWrap       string          `xml:"giftWrap"`
	ShipToProducts []ShipToProduct `xml:"shipToProducts>shipToProduct"`
	ShipEmail      string          `xml:"shipEmail"`
}

type ShipToProduct

type ShipToProduct struct {
	SKU      string `xml:"SKU"`
	Quantity string `xml:"quantity"`
	Price    string `xml:"price"`
}

data structures for Orders

type Shipping

type Shipping struct {
	ShipPreference string  `xml:"ShipPreference,omitempty"`
	FixedRate      string  `xml:"FixedRate,omitempty"`
	Package        Package `xml:"Package,omitempty"`
}

Shipping hold the products shipping information

type Special

type Special struct {
	Ongoing string `xml:"ongoing,attr,omitempty"`
	Start   string `xml:"Start,omitempty"`
	End     string `xml:"End,omitempty"`
	Text    string `xml:"Text,omitempty"`
}

Special hold the pricing information for a special sale

type SubCategory

type SubCategory struct {
	Name      string `xml:"Name"`
	ID        string `xml:"ID"`
	Invisible string `xml:"invisible,attr"`
}

SubCategory is the struct to hold the Subcategories

type SubProduct

type SubProduct struct {
	XMLName              xml.Name           `xml:"SubProduct"`
	Inactive             string             `xml:"inactive,attr,omitempty"`
	OutOfSeason          string             `xml:"out_of_season,attr,omitempty"`
	TaxExempt            string             `xml:"tax_exempt,attr,omitempty"`
	GoogleCheckoutExempt string             `xml:"google_checkout_exempt,attr,omitempty"`
	Sku                  string             `xml:"SKU,omitempty"`
	AltID                string             `xml:"AltID,omitempty"`
	ProdId               string             `xml:"ProdID,omitempty"`
	Name                 string             `xml:"Name,omitempty"`
	Image                string             `xml:"Image,omitempty"`
	Retail               Retail             `xml:"Retail,omitempty"`
	Wholesale            Wholesale          `xml:"Wholesale,omitempty"`
	Special              Special            `xml:"Special,omitempty"`
	Weight               Weight             `xml:"Weight,omitempty"`
	Shipping             Shipping           `xml:"Shipping,omitempty"`
	GiftCertificate      GiftCertificate    `xml:"GiftCertificate,omitempty"`
	Subscription         Subscription       `xml:"Subscription,omitempty"`
	ElectronicDelivery   ElectronicDelivery `xml:"ElectronicDelivery,omitempty"`
	Attributes           Attributes         `xml:"Attributes,omitempty"`
	InventoryControl     InventoryControl   `xml:"InventoryControl,omitempty"`
}

SubProduct TODO good description

type SubProducts

type SubProducts struct {
	SubProducts []SubProduct `xml:"SubProduct,omitempty"`
	Active      string       `xml:"active,attr"`
}

SubProducts is an array of type SubProduct

type Subscription

type Subscription struct {
	Active string `xml:"active,attr,omitempty"`
	Price  string `xml:"Price,omitempty"`
}

Subscription hold the product subscription information

type TotalOrderDiscount

type TotalOrderDiscount struct {
	Amount        string `xml:"amount"`
	TotalDiscount string `xml:"totalDiscount"`
	Type          string `xml:"type,attr"`
}

type VisaCheckoutInfo

type VisaCheckoutInfo struct {
	Amount        string `xml:"Amount"`
	TransactionID string `xml:"TransactionID"`
}

VisaCheckoutInfo holds the visa checkout info in the order

type Weight

type Weight struct {
	ShipWeight    string `xml:"ShipWeight,omitempty"`
	DisplayWeight string `xml:"DisplayWeight,omitempty"`
	DisplayUnit   string `xml:"DisplayUnit,omitempty"`
}

Weight hold the information about the weight

type Wholesale

type Wholesale struct {
	Active        string `xml:"active,attr,omitempty"`
	StandardPrice string `xml:"StandardPrice,omitempty"`
	Qty           string `xml:"Qty,omitempty"`
}

Wholesale hold pricing info for a Wholesale item

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL