diff --git a/commands/add_fixed_price_item.go b/commands/add_fixed_price_item.go new file mode 100644 index 0000000..61d2e1d --- /dev/null +++ b/commands/add_fixed_price_item.go @@ -0,0 +1,199 @@ +package commands + +import ( + "encoding/xml" + + "github.com/cubixle2/go-ebay/config" + "github.com/cubixle2/go-ebay/types" +) + +func NewAddFixedPriceItemRequest(cfg *config.Config, item *types.Item) *AddFixedPriceItemRequest { + // condition is always new (for now). + item.ConditionID = 1000 + item.Country = "GB" + item.Currency = "GBP" + item.Site = "UK" + item.PaymentMethods = types.BuyerPaymentMethodCodeTypePayPal + item.HitCounter = "NoHitCounter" + item.ListingType = types.ListingTypeCodeTypeFixedPriceItem + + return &AddFixedPriceItemRequest{ + Item: *item, + RequesterCredentials: RequesterCredentials{ + EBayAuthToken: cfg.AuthToken, + }, + Xmlns: "urn:ebay:apis:eBLBaseComponents", + DetailLevel: "ItemReturnDescription", + Version: "837", + } +} + +type AddFixedPriceItemRequest struct { + Item types.Item `xml:"Item"` + Xmlns string `xml:"xmlns,attr"` + RequesterCredentials RequesterCredentials `xml:"RequesterCredentials"` + DetailLevel string + Version string +} + +func (c AddFixedPriceItemRequest) CallName() string { + return "AddFixedPriceItem" +} + +// GetRequestBody returns bytes +func (c AddFixedPriceItemRequest) GetRequestBody() []byte { + body, _ := xml.Marshal(c) + return body +} + +func (c AddFixedPriceItemRequest) SetToken(token string) { + c.RequesterCredentials.EBayAuthToken = token +} + +// AddFixedPriceItemResponse was generated 2018-09-11 14:04:26 by lukerodham on Lukes-MacBook-Pro.local. +type AddFixedPriceItemResponse struct { + XMLName xml.Name `xml:"AddFixedPriceItemResponse"` + Text string `xml:",chardata"` + Xmlns string `xml:"xmlns,attr"` + Category2ID struct { + Text string `xml:",chardata"` + } `xml:"Category2ID"` + CategoryID struct { + Text string `xml:",chardata"` + } `xml:"CategoryID"` + DiscountReason struct { + Text string `xml:",chardata"` + } `xml:"DiscountReason"` + EndTime struct { + Text string `xml:",chardata"` + } `xml:"EndTime"` + Fees struct { + Text string `xml:",chardata"` + Fee struct { + Text string `xml:",chardata"` + Fee struct { + Text string `xml:",chardata"` + CurrencyID string `xml:"currencyID,attr"` + } `xml:"Fee"` + Name struct { + Text string `xml:",chardata"` + } `xml:"Name"` + PromotionalDiscount struct { + Text string `xml:",chardata"` + CurrencyID string `xml:"currencyID,attr"` + } `xml:"PromotionalDiscount"` + } `xml:"Fee"` + } `xml:"Fees"` + ItemID struct { + Text string `xml:",chardata"` + } `xml:"ItemID"` + ListingRecommendations struct { + Text string `xml:",chardata"` + Recommendation struct { + Text string `xml:",chardata"` + Code struct { + Text string `xml:",chardata"` + } `xml:"Code"` + FieldName struct { + Text string `xml:",chardata"` + } `xml:"FieldName"` + Group struct { + Text string `xml:",chardata"` + } `xml:"Group"` + Message struct { + Text string `xml:",chardata"` + } `xml:"Message"` + Metadata struct { + Text string `xml:",chardata"` + Name struct { + Text string `xml:",chardata"` + } `xml:"Name"` + Value struct { + Text string `xml:",chardata"` + } `xml:"Value"` + } `xml:"Metadata"` + Type struct { + Text string `xml:",chardata"` + } `xml:"Type"` + Value struct { + Text string `xml:",chardata"` + } `xml:"Value"` + } `xml:"Recommendation"` + } `xml:"ListingRecommendations"` + ProductSuggestions struct { + Text string `xml:",chardata"` + ProductSuggestion struct { + Text string `xml:",chardata"` + EPID struct { + Text string `xml:",chardata"` + } `xml:"EPID"` + Recommended struct { + Text bool `xml:",chardata"` + } `xml:"Recommended"` + StockPhoto struct { + Text string `xml:",chardata"` + } `xml:"StockPhoto"` + Title struct { + Text string `xml:",chardata"` + } `xml:"Title"` + } `xml:"ProductSuggestion"` + } `xml:"ProductSuggestions"` + SKU struct { + Text string `xml:",chardata"` + } `xml:"SKU"` + StartTime struct { + Text string `xml:",chardata"` + } `xml:"StartTime"` + Ack struct { + Text string `xml:",chardata"` + } `xml:"Ack"` + Build struct { + Text string `xml:",chardata"` + } `xml:"Build"` + CorrelationID struct { + Text string `xml:",chardata"` + } `xml:"CorrelationID"` + DuplicateInvocationDetails struct { + Text string `xml:",chardata"` + Status struct { + Text string `xml:",chardata"` + } `xml:"Status"` + } `xml:"DuplicateInvocationDetails"` + Errors struct { + Text string `xml:",chardata"` + ErrorClassification struct { + Text string `xml:",chardata"` + } `xml:"ErrorClassification"` + ErrorCode struct { + Text string `xml:",chardata"` + } `xml:"ErrorCode"` + ErrorParameters struct { + Text string `xml:",chardata"` + ParamID string `xml:"ParamID,attr"` + Value struct { + Text string `xml:",chardata"` + } `xml:"Value"` + } `xml:"ErrorParameters"` + LongMessage struct { + Text string `xml:",chardata"` + } `xml:"LongMessage"` + SeverityCode struct { + Text string `xml:",chardata"` + } `xml:"SeverityCode"` + ShortMessage struct { + Text string `xml:",chardata"` + } `xml:"ShortMessage"` + } `xml:"Errors"` + HardExpirationWarning struct { + Text string `xml:",chardata"` + } `xml:"HardExpirationWarning"` + Message struct { + Text string `xml:",chardata"` + } `xml:"Message"` + Timestamp struct { + Text string `xml:",chardata"` + } `xml:"Timestamp"` + Version struct { + Text string `xml:",chardata"` + } `xml:"Version"` +} diff --git a/commands/get_item.go b/commands/get_item.go index c36173e..a943119 100644 --- a/commands/get_item.go +++ b/commands/get_item.go @@ -3,7 +3,7 @@ package commands import ( "encoding/xml" - "github.com/cubixle/go-ebay/config" + "github.com/cubixle2/go-ebay/config" ) func NewGetItemRequest(cfg *config.Config, itemID string) *GetItemRequest { @@ -53,6 +53,9 @@ type ItemResponse struct { Quantity int `xml:"Quantity"` SellingStatus SellingStatus `xml:"SellingStatus"` ProductListingDetails ProductListingDetails `xml:"ProductListingDetails"` + ConditionID int `xml:"ConditionID"` + Country string `xml:"country"` + Currency string `xml:"Currency"` } type PictureDetails struct { diff --git a/commands/get_my_ebay_selling.go b/commands/get_my_ebay_selling.go index 2ad7147..83fd434 100644 --- a/commands/get_my_ebay_selling.go +++ b/commands/get_my_ebay_selling.go @@ -3,7 +3,7 @@ package commands import ( "encoding/xml" - "github.com/cubixle/go-ebay/config" + "github.com/cubixle2/go-ebay/config" ) func NewGetMyEbaySelling(cfg *config.Config, version string, pageNumber string, perPage string) *GetMyeBaySellingRequest { diff --git a/commands/get_orders.go b/commands/get_orders.go index 89b226e..1b1c65a 100644 --- a/commands/get_orders.go +++ b/commands/get_orders.go @@ -3,7 +3,7 @@ package commands import ( "encoding/xml" - "github.com/cubixle/go-ebay/config" + "github.com/cubixle2/go-ebay/config" ) // NewGetOrdersRequest returns struct diff --git a/commands/revise_item.go b/commands/revise_item.go index fab680a..ca357cd 100644 --- a/commands/revise_item.go +++ b/commands/revise_item.go @@ -3,10 +3,11 @@ package commands import ( "encoding/xml" - "github.com/cubixle/go-ebay/config" + "github.com/cubixle2/go-ebay/config" + "github.com/cubixle2/go-ebay/types" ) -func NewReviseItemRequest(cfg *config.Config, item ItemResponse) *ReviseItemRequest { +func NewReviseItemRequest(cfg *config.Config, item *types.Item) *ReviseItemRequest { return &ReviseItemRequest{ Item: item, RequesterCredentials: RequesterCredentials{ @@ -17,7 +18,7 @@ func NewReviseItemRequest(cfg *config.Config, item ItemResponse) *ReviseItemRequ } type ReviseItemRequest struct { - Item ItemResponse + Item *types.Item `xml:"Item"` Xmlns string `xml:"xmlns,attr"` RequesterCredentials RequesterCredentials `xml:"RequesterCredentials"` } diff --git a/ebay.go b/ebay.go index c0d414f..52b1d53 100644 --- a/ebay.go +++ b/ebay.go @@ -21,7 +21,7 @@ func execute(request *Request) ([]byte, error) { xmlBody := []byte("") xmlBody = append(xmlBody, request.Command.GetRequestBody()...) body := bytes.NewReader(xmlBody) - + // panic(string(xmlBody)) req, _ := http.NewRequest( "POST", fmt.Sprintf("%s/ws/api.dll", config.BaseUrl), @@ -50,6 +50,10 @@ func execute(request *Request) ([]byte, error) { return []byte{}, fmt.Errorf("<%d> - %s", resp.StatusCode, rspBody) } + reqBody, _ := ioutil.ReadAll(resp.Request.Body) + + log.Println(string(reqBody)) + rspBody, _ := ioutil.ReadAll(resp.Body) return rspBody, nil diff --git a/fixtures/add-fixed-price-item-response.xml b/fixtures/add-fixed-price-item-response.xml new file mode 100644 index 0000000..43f443d --- /dev/null +++ b/fixtures/add-fixed-price-item-response.xml @@ -0,0 +1,70 @@ + + + + string + string + DiscountReasonCodeType + + dateTime + FeesType + FeeType + AmountType (double) + string + AmountType (double) + + + + ItemIDType (string) + ListingRecommendationsType + ListingRecommendationType + string + string + string + string + MetadataType + string + string + + + + string + string + + + + + ProductSuggestionsType + ProductSuggestionType + string + boolean + string + string + + + + SKUType (string) + dateTime + + AckCodeType + string + string + DuplicateInvocationDetailsType + InvocationStatusType + + ErrorType + ErrorClassificationCodeType + token + ErrorParameterType + string + + + string + SeverityCodeType + string + + + string + string + dateTime + string + \ No newline at end of file diff --git a/request.go b/request.go index 3ea3d3a..b195bf5 100644 --- a/request.go +++ b/request.go @@ -1,8 +1,8 @@ package ebay import ( - "github.com/cubixle/go-ebay/commands" - "github.com/cubixle/go-ebay/config" + "github.com/cubixle2/go-ebay/commands" + "github.com/cubixle2/go-ebay/config" ) const xmlns = "urn:ebay:apis:eBLBaseComponents" diff --git a/types/enums.go b/types/enums.go new file mode 100644 index 0000000..7e9332c --- /dev/null +++ b/types/enums.go @@ -0,0 +1,61 @@ +package types + +const ( + PeriodCodeCustom string = "CustomCode" + PeriodCodeDays1 string = "Days_1" + PeriodCodeDays180 string = "Days_180" + PeriodCodeDays30 string = "Days_30" + PeriodCodeDays360 string = "Days_360" + PeriodCodeDays540 string = "Days_540" +) + +const ( + HitCountCodeTypeBasicStyle string = "BasicStyle" + HitCountCodeTypeCustomCode string = "CustomCode" + HitCountCodeTypeGreenLED string = "GreenLED" + HitCountCodeTypeHidden string = "Hidden" + HitCountCodeTypeHiddenStyle string = "HiddenStyle" + HitCountCodeTypeHonestyStyle string = "HonestyStyle" + HitCountCodeTypeNoHitCounter string = "NoHitCounter" + HitCountCodeTypeRetroStyle string = "RetroStyle" +) + +const ( + InventoryTrackingMethodCodeTypeCustomCode string = "CustomCode" + InventoryTrackingMethodCodeTypeItemID string = "ItemID" + InventoryTrackingMethodCodeTypeSKU string = "SKU" +) + +const ( + ListingEnhancementsCodeTypeBoldTitle string = "BoldTitle" + ListingEnhancementsCodeTypeCustomCode string = "CustomCode" + ListingEnhancementsCodeTypeHomePageFeatured string = "HomePageFeatured" + ListingEnhancementsCodeTypeValuePackBundle string = "ValuePackBundle" +) + +const ( + ListingTypeCodeTypeAdType string = "AdType" + ListingTypeCodeTypeAuction string = "Auction" + ListingTypeCodeTypeChinese string = "Chinese" + ListingTypeCodeTypeCustomCode string = "CustomCode" + ListingTypeCodeTypeFixedPriceItem string = "FixedPriceItem" + ListingTypeCodeTypeLeadGeneration string = "LeadGeneration" + ListingTypeCodeTypePersonalOffer string = "PersonalOffer" + ListingTypeCodeTypeUnkown string = "Unkown" +) + +const ( + BuyerPaymentMethodCodeTypePayPal string = "PayPal" +) + +const ( + ShippingTypeCodeTypeCalculated string = "Calculated" + ShippingTypeCodeTypeCalculatedDomesticFlatInternational string = "CalculatedDomesticFlatInternational" + ShippingTypeCodeTypeCustomCode string = "CustomCode" + ShippingTypeCodeTypeFlat string = "Flat" + ShippingTypeCodeTypeFlatDomesticCalculatedInternational string = "FlatDomesticCalculatedInternational" + ShippingTypeCodeTypeFree string = "Free" + ShippingTypeCodeTypeFreight string = "Freight" + ShippingTypeCodeTypeFreightFlat string = "FreightFlat" + ShippingTypeCodeTypeNotSpecified string = "NotSpecified" +) diff --git a/types/types.go b/types/types.go new file mode 100644 index 0000000..61961ce --- /dev/null +++ b/types/types.go @@ -0,0 +1,366 @@ +package types + +import "time" + +type Item struct { + AutoPay bool + + BestOfferDetails BestOfferDetails `xml:"BestOfferDetails"` + + BuyerRequirementDetails *BuyerRequirementDetails `xml:"BuyerRequirementDetails,omitempty"` + CategoryBasedAttributesPrefill bool `xml:"CategoryBasedAttributesPrefill"` + CategoryMappingAllowed bool `xml:"CategoryMappingAllowed"` + Charity *Charity `xml:"Charity,omitempty"` + ConditionDescription string `xml:"ConditionDescription,omitempty"` + ConditionID int `xml:"ConditionID,omitempty"` + Country string `xml:"Country,omitempty"` + CrossBorderTrade string `xml:"CrossBorderTrade,omitempty"` + Currency string `xml:"Currency,omitempty"` + Description string `xml:"Description,omitempty"` + + DigitalGoodInfo struct { + DigitalDelivery bool `xml:"DigitalDelivery"` + } `xml:"DigitalGoodInfo"` + + DisableBuyerRequirements bool `xml:"DisableBuyerRequirements"` + DiscountPriceInfo *DiscountPriceInfo `xml:"DiscountPriceInfo"` + + DispatchTimeMax int `xml:"DispatchTimeMax"` + EBayNowEligible bool `xml:"eBayNowEligible"` + EBayPlus bool `xml:"eBayPlus"` + HitCounter string `xml:"HitCounter,omitempty"` + IncludeRecommendations bool `xml:"IncludeRecommendations"` + InventoryTrackingMethod string `xml:"InventoryTrackingMethod,omitempty"` + + ItemCompatibilityList *struct { + Compatibility struct { + CompatibilityNotes string `xml:"CompatibilityNotes"` + NameValueList []struct { + Name string `xml:"Name"` + Value string `xml:"Value"` + } `xml:"NameValueList"` + } `xml:"Compatibility"` + } `xml:"ItemCompatibilityList,omitempty"` + + ItemSpecifics ItemSpecifics `xml:"ItemSpecifics"` + + ListingDesigner *struct { + LayoutID int `xml:"LayoutID"` + OptimalPictureSize bool `xml:"OptimalPictureSize"` + ThemeID int `xml:"ThemeID"` + } `xml:"ListingDesigner,omitempty"` + + ListingDetails *struct { + BestOfferAutoAcceptPrice float32 `xml:"BestOfferAutoAcceptPrice"` + LocalListingDistance string `xml:"LocalListingDistance"` + MinimumBestOfferPrice float32 `xml:"MinimumBestOfferPrice"` + } `xml:"ListingDetails,omitempty"` + + ListingDuration string `xml:"ListingDuration,omitempty"` + ListingEnhancement string `xml:"ListingEnhancement,omitempty"` + ListingType string `xml:"ListingType,omitempty"` + Location string `xml:"Location,omitempty"` + + PaymentMethods string `xml:"PaymentMethods,omitempty"` + PayPalEmailAddress string `xml:"PayPalEmailAddress"` + PickupInStoreDetails struct { + EligibleForPickupInStore bool `xml:"EligibleForPickupInStore"` + } `xml:"PickupInStoreDetails"` + + PictureDetails PictureDetails `xml:"PictureDetails"` + + PostalCode string `xml:"PostalCode"` + PrimaryCategory CategoryID `xml:"PrimaryCategory"` + PrivateNotes string `xml:"PrivateNotes,omitempty"` + ProductListingDetails ProductListingDetails `xml:"ProductListingDetails"` + Quantity int `xml:"Quantity"` + + QuantityInfo *struct { + MinimumRemnantSet int `xml:"MinimumRemnantSet"` + } `xml:"QuantityInfo,omitempty"` + + QuantityRestrictionPerBuyer *struct { + MaximumQuantity int `xml:"MaximumQuantity"` + } `xml:"QuantityRestrictionPerBuyer,omitempty"` + + ReturnPolicy *ReturnPolicy `xml:"ReturnPolicy,omitempty"` + + ScheduleTime *time.Time `xml:"ScheduleTime,omitempty"` + SecondaryCategory *CategoryID `xml:"SecondaryCategory,omitempty"` + SellerProfiles *struct { + SellerPaymentProfile struct { + PaymentProfileID int64 `xml:"PaymentProfileID"` + PaymentProfileName string `xml:"PaymentProfileName"` + } `xml:"SellerPaymentProfile"` + SellerReturnProfile struct { + ReturnProfileID int64 `xml:"ReturnProfileID"` + ReturnProfileName string `xml:"ReturnProfileName"` + } `xml:"SellerReturnProfile"` + SellerShippingProfile struct { + ShippingProfileID int64 `xml:"ShippingProfileID"` + ShippingProfileName string `xml:"ShippingProfileName"` + } `xml:"SellerShippingProfile"` + } `xml:"SellerProfiles,omitempty"` + + SellerProvidedTitle string `xml:"SellerProvidedTitle,omitempty"` + ShippingDetails *ShippingDetails `xml:"ShippingDetails"` + ShippingPackageDetails *ShippingPackageDetails `xml:"ShippingPackageDetails,omitempty"` + ShippingServiceCostOverrideList *ShippingServiceCostOverrideList `xml:"ShippingServiceCostOverrideList,omitempty"` + ShippingTermsInDescription bool `xml:"ShippingTermsInDescription"` + ShipToLocations string `xml:"ShipToLocations"` + Site string `xml:"Site"` // https://developer.ebay.com/devzone/xml/docs/reference/ebay/types/SiteCodeType.html + SKU string `xml:"SKU"` + StartPrice float32 `xml:"StartPrice,omitempty"` + Storefront *StoreFront `xml:"Storefront,omitempty"` + SubTitle string `xml:"SubTitle,omitempty"` + TaxCategory string `xml:"TaxCategory,omitempty"` + Title string `xml:"Title"` + UseTaxTable bool `xml:"UseTaxTable,omitempty"` + UUID string `xml:"UUID,omitempty"` + Variations *Variations `xml:"Variations,omitempty"` + VATDetails *VATDetails `xml:"VATDetails,omitempty"` + VIN string `xml:"VIN,omitempty"` + VRM string `xml:"VRM,omitempty"` +} + +type ShippingDetails struct { + CalculatedShippingRate *struct { + InternationalPackagingHandlingCosts float32 `xml:"InternationalPackagingHandlingCosts,omitempty"` + MeasurementUnit string `xml:"MeasurementUnit,omitempty"` // English/Metric MeasurementSystemCodeType + OriginatingPostalCode string `xml:"OriginatingPostalCode"` + PackagingHandlingCosts float32 `xml:"PackagingHandlingCosts"` + ShippingIrregular bool `xml:"ShippingIrregular"` + } `xml:"CalculatedShippingRate,omitempty"` + + CODCost float32 `xml:"CODCost"` + ExcludeShipToLocation string `xml:"ExcludeShipToLocation,omitempty"` + + GlobalShipping bool `xml:"GlobalShipping"` + InternationalPromotionalShippingDiscount bool `xml:"InternationalPromotionalShippingDiscount,omitempty"` + InternationalShippingDiscountProfileID string `xml:"InternationalShippingDiscountProfileID,omitempty"` + InternationalShippingServiceOption *struct { + ShippingService string `xml:"ShippingService"` + ShippingServiceAdditionalCost float32 `xml:"ShippingServiceAdditionalCost"` + ShippingServiceCost float32 `xml:"ShippingServiceCost"` + ShippingServicePriority int `xml:"ShippingServicePriority"` + ShipToLocation string `xml:"ShipToLocation"` + } `xml:"InternationalShippingServiceOption,omitempty"` + PaymentInstructions string `xml:"PaymentInstructions"` + PromotionalShippingDiscount bool `xml:"PromotionalShippingDiscount"` + RateTableDetails *struct { + DomesticRateTable string `xml:"DomesticRateTable"` + DomesticRateTableID string `xml:"DomesticRateTableId"` + InternationalRateTable string `xml:"InternationalRateTable"` + InternationalRateTableID string `xml:"InternationalRateTableId"` + } `xml:"RateTableDetails,omitempty"` + SalesTax *struct { + SalesTaxPercent float32 `xml:"SalesTaxPercent"` + SalesTaxState string `xml:"SalesTaxState"` + ShippingIncludedInTax bool `xml:"ShippingIncludedInTax"` + } `xml:"SalesTax,omitempty"` + ShippingDiscountProfileID string `xml:"ShippingDiscountProfileID,omitempty"` + ShippingServiceOptions []ShippingServiceOptions `xml:"ShippingServiceOptions,omitempty"` + ShippingType string `xml:"ShippingType"` +} + +type CategoryID struct { + CategoryID string `xml:"CategoryID"` +} + +type ProductListingDetails struct { + BrandMPN BrandMPN `xml:"BrandMPN"` + EAN string `xml:"EAN,omitempty"` + IncludeeBayProductDetails bool `xml:"IncludeeBayProductDetails"` + IncludeStockPhotoURL bool `xml:"IncludeStockPhotoURL"` + ISBN string `xml:"ISBN,omitempty"` + ProductReferenceID string `xml:"ProductReferenceID,omitempty"` + ReturnSearchResultOnDuplicates bool `xml:"ReturnSearchResultOnDuplicates"` + TicketListingDetails *struct { + EventTitle string `xml:"EventTitle"` + PrintedDate string `xml:"PrintedDate"` + PrintedTime string `xml:"PrintedTime"` + Venue string `xml:"Venue"` + } `xml:"TicketListingDetails,omitempty"` + UPC string `xml:"UPC,omitempty"` + UseFirstProduct bool `xml:"UseFirstProduct"` + UseStockPhotoURLAsGallery bool `xml:"UseStockPhotoURLAsGallery"` +} + +type BrandMPN struct { + Brand string `xml:"Brand"` + MPN string `xml:"MPN"` +} + +type BuyerRequirementDetails struct { + MaximumItemRequirements MaximumItemRequirements `xml:"MaximumItemRequirements"` + MaximumUnpaidItemStrikesInfo MaximumUnpaidItemStrikesInfo `xml:"MaximumUnpaidItemStrikesInfo"` + ShipToRegistrationCountry bool `xml:"ShipToRegistrationCountry"` + ZeroFeedbackScore bool `xml:"ZeroFeedbackScore"` +} + +type MaximumItemRequirements struct { + MaximumItemCount int `xml:"MaximumItemCount"` + MinimumFeedbackScore int `xml:"MinimumFeedbackScore"` +} + +type MaximumUnpaidItemStrikesInfo struct { + Count int `xml:"Count"` + Period string `xml:"Period"` +} + +type DiscountPriceInfo struct { + MadeForOutletComparisonPrice float32 `xml:"MadeForOutletComparisonPrice"` + MinimumAdvertisedPrice float32 `xml:"MinimumAdvertisedPrice"` + MinimumAdvertisedPriceExposure string `xml:"MinimumAdvertisedPriceExposure"` + OriginalRetailPrice float32 `xml:"OriginalRetailPrice"` + SoldOffeBay bool `xml:"SoldOffeBay"` + SoldOneBay bool `xml:"SoldOneBay"` +} + +type ShippingServiceOptions struct { + FreeShipping bool `xml:"FreeShipping"` + ShippingService string `xml:"ShippingService,omitempty"` + ShippingServiceAdditionalCost float32 `xml:"ShippingServiceAdditionalCost,omitempty"` + ShippingServiceCost float32 `xml:"ShippingServiceCost,omitempty"` + ShippingServicePriority int `xml:"ShippingServicePriority,omitempty"` + ShippingSurcharge float32 `xml:"ShippingSurcharge,omitempty"` +} + +type ShippingPackageDetails struct { + MeasurementUnit string `xml:"MeasurementUnit"` // English/Metric MeasurementSystemCodeType + PackageDepth float32 `xml:"PackageDepth"` + PackageLength float32 `xml:"PackageLength"` + PackageWidth float32 `xml:"PackageWidth"` + ShippingIrregular bool `xml:"ShippingIrregular"` + ShippingPackage string `xml:"ShippingPackage"` // https://developer.ebay.com/devzone/xml/docs/reference/ebay/types/ShippingPackageCodeType.html + WeightMajor float32 `xml:"WeightMajor"` + WeightMinor float32 `xml:"WeightMinor"` +} + +type ShippingServiceCostOverrideList struct { + ShippingServiceCostOverride struct { + ShippingServiceAdditionalCost struct { + } `xml:"ShippingServiceAdditionalCost"` + ShippingServiceCost struct { + } `xml:"ShippingServiceCost"` + ShippingServicePriority struct { + } `xml:"ShippingServicePriority"` + ShippingServiceType struct { + } `xml:"ShippingServiceType"` + ShippingSurcharge struct { + } `xml:"ShippingSurcharge"` + } `xml:"ShippingServiceCostOverride"` +} + +type StoreFront struct { + StoreCategory2ID int64 `xml:"StoreCategory2ID"` + StoreCategory2Name string `xml:"StoreCategory2Name"` + StoreCategoryID int64 `xml:"StoreCategoryID"` + StoreCategoryName string `xml:"StoreCategoryName"` +} + +type Variations struct { + Pictures struct { + VariationSpecificName struct { + } `xml:"VariationSpecificName"` + VariationSpecificPictureSet struct { + PictureURL struct { + } `xml:"PictureURL"` + VariationSpecificValue struct { + } `xml:"VariationSpecificValue"` + } `xml:"VariationSpecificPictureSet"` + } `xml:"Pictures"` + Variation struct { + DiscountPriceInfo struct { + MadeForOutletComparisonPrice struct { + } `xml:"MadeForOutletComparisonPrice"` + MinimumAdvertisedPrice struct { + } `xml:"MinimumAdvertisedPrice"` + MinimumAdvertisedPriceExposure struct { + } `xml:"MinimumAdvertisedPriceExposure"` + OriginalRetailPrice struct { + } `xml:"OriginalRetailPrice"` + SoldOffeBay struct { + } `xml:"SoldOffeBay"` + SoldOneBay struct { + } `xml:"SoldOneBay"` + } `xml:"DiscountPriceInfo"` + Quantity struct { + } `xml:"Quantity"` + SKU struct { + } `xml:"SKU"` + StartPrice struct { + } `xml:"StartPrice"` + VariationProductListingDetails struct { + EAN struct { + } `xml:"EAN"` + ISBN struct { + } `xml:"ISBN"` + ProductReferenceID struct { + } `xml:"ProductReferenceID"` + UPC struct { + } `xml:"UPC"` + } `xml:"VariationProductListingDetails"` + VariationSpecifics struct { + NameValueList struct { + Name struct { + } `xml:"Name"` + Value struct { + } `xml:"Value"` + } `xml:"NameValueList"` + } `xml:"VariationSpecifics"` + } `xml:"Variation"` + VariationSpecificsSet struct { + NameValueList struct { + Name struct { + } `xml:"Name"` + Value struct { + } `xml:"Value"` + } `xml:"NameValueList"` + } `xml:"VariationSpecificsSet"` +} + +type VATDetails struct { + BusinessSeller bool `xml:"BusinessSeller"` + RestrictedToBusiness bool `xml:"RestrictedToBusiness"` + VATPercent float32 `xml:"VATPercent"` +} + +type Charity struct { + CharityID string `xml:"CharityID"` + CharityNumber int `xml:"CharityNumber"` + DonationPercent float32 `xml:"DonationPercent"` +} + +type ReturnPolicy struct { + Description string `xml:"Description"` + InternationalRefundOption string `xml:"InternationalRefundOption"` + InternationalReturnsAcceptedOption string `xml:"InternationalReturnsAcceptedOption"` + InternationalReturnsWithinOption string `xml:"InternationalReturnsWithinOption"` + InternationalShippingCostPaidByOption string `xml:"InternationalShippingCostPaidByOption"` + RefundOption string `xml:"RefundOption"` + ReturnsAcceptedOption string `xml:"ReturnsAcceptedOption"` + ReturnsWithinOption string `xml:"ReturnsWithinOption"` + ShippingCostPaidByOption string `xml:"ShippingCostPaidByOption"` +} + +type PictureDetails struct { + GalleryDuration string `xml:"GalleryDuration,omitempty"` + GalleryType string `xml:"GalleryType,omitempty"` + PhotoDisplay string `xml:"PhotoDisplay,omitempty"` + PictureSource string `xml:"PictureSource,omitempty"` + PictureURL []string `xml:"PictureURL"` +} + +type NameValueList struct { + Name string `xml:"Name"` + Value string `xml:"Value"` +} + +type ItemSpecifics struct { + NameValueList []NameValueList `xml:"NameValueList"` +} + +type BestOfferDetails struct { + BestOfferEnabled bool `xml:"BestOfferEnabled"` +}