Documentation ¶
Overview ¶
Package product 商品相关API
Index ¶
- Constants
- func CpsMediaProductInfo(client *go1688.Client, req *CpsMediaProductInfoRequest, accessToken string) (*ProductInfo, []*BizGroupInfo, error)
- func Follow(client *go1688.Client, req *FollowRequest, accessToken string) error
- func UnfollowCrossborder(client *go1688.Client, req *UnfollowCrossborderRequest, accessToken string) error
- type BizGroupInfo
- type CategoryFeatureInfo
- type CategoryGetRequest
- type CategoryGetResponse
- type CategoryInfo
- type ChildCategoryInfo
- type CpsMediaProductInfoRequest
- type CpsMediaProductInfoResponse
- type FollowRequest
- type FollowResponse
- type ProductAttribute
- type ProductInfo
- type ProductPriceRange
- type ProductStatus
- type QuoteType
- type SaleInfo
- type ShippingInfo
- type SkuAttribute
- type SkuInfo
- type UnfollowCrossborderRequest
- type UnfollowCrossborderResponse
Constants ¶
const (
NAMESPACE = "com.alibaba.product"
)
Variables ¶
This section is empty.
Functions ¶
func CpsMediaProductInfo ¶
func CpsMediaProductInfo(client *go1688.Client, req *CpsMediaProductInfoRequest, accessToken string) (*ProductInfo, []*BizGroupInfo, error)
CpsMediaProductInfo 获取商品详情接口
func Follow ¶
func Follow(client *go1688.Client, req *FollowRequest, accessToken string) error
Follow 关注商品
func UnfollowCrossborder ¶
func UnfollowCrossborder(client *go1688.Client, req *UnfollowCrossborderRequest, accessToken string) error
UnfollowCrossborder 解除关注商品
Types ¶
type BizGroupInfo ¶
type BizGroupInfo struct { // Support 是否支持,isConsignMarketOffer=ture表示代销offer Support bool `json:"support,omitempty"` // Description 垂直市场名字 Description string `json:"description,omitempty"` // Code 垂直市场标记, isConsignMarketOffer, 伙拼isTuanPiOffer Code string `json:"code,omitempty"` }
BizGroupInfo 业务信息
type CategoryFeatureInfo ¶
type CategoryFeatureInfo struct { // Key 名称 Key string `json:"key,omitempty"` // Value 值 Value string `json:"value,omitempty"` // Status 状态 Status int `json:"status,omitempty"` // Hierarchy 是否继承到子元素上 Hierarchy bool `json:"hierarchy,omitempty"` }
CategoryFeatureInfo 类目特征信息
type CategoryGetRequest ¶
type CategoryGetRequest struct { // ID 类目id,必须大于等于0, 如果为0,则查询所有一级类目 ID uint64 `json:"categoryID,omitempty"` }
CategoryGetRequest 根据类目Id查询类目 API Request
func (CategoryGetRequest) Map ¶
func (r CategoryGetRequest) Map() map[string]string
Map implement RequestData interface
func (CategoryGetRequest) Name ¶
func (r CategoryGetRequest) Name() string
Name implement RequestData interface
type CategoryGetResponse ¶
type CategoryGetResponse struct { go1688.BaseResponse // Category 类目 Category []CategoryInfo `json:"categoryInfo,omitempty"` }
CategoryGetResponse 根据类目Id查询类目 API Response
type CategoryInfo ¶
type CategoryInfo struct { // ID 类目ID ID uint64 `json:"categoryID,omitempty"` // Name 类目名称 Name string `json:"name,omitempty"` // IsLeaf 是否叶子类目(只有叶子类目才能发布商品) IsLeaf bool `json:"isLeaf,omitempty"` // ParentIDs 父类目ID数组,1688只返回一个父id ParentIDs []uint64 `json:"parentIDs,omitempty"` // ChildIDs 子类目ID数组,1688无此内容 ChildIDs []uint64 `json:"childIDs,omitempty"` // MinOrderQuality 最小起订量 MinOrderQuantity uint64 `json:"minOrderQuantity,omitempty"` // ChildCategories 子类目信息 ChildCategories []ChildCategoryInfo `json:"childCategorys,omitempty"` // Features 类目特征信息 Features []CategoryFeatureInfo `json:"featureInfos,omitempty"` }
CategoryInfo 类目
func CategoryGet ¶
func CategoryGet(client *go1688.Client, req *CategoryGetRequest, accessToken string) ([]CategoryInfo, error)
CategoryGet 根据类目Id查询类目
type ChildCategoryInfo ¶
type ChildCategoryInfo struct { // ID 子类目ID ID uint64 `json:"id,omitempty"` // Name 子类目名称 Name string `json:"name,omitempty"` // IsLeaf 是否叶子类目(只有叶子类目才能发布商品) IsLeaf bool `json:"isLeaf,omitempty"` // CategoryType 类目的类型:1表示cbu类目,2表示gallop类目 CategoryType string `json:"categoryType,omitempty"` }
ChildCategoryInfo 子类目信息
type CpsMediaProductInfoRequest ¶
type CpsMediaProductInfoRequest struct { // OfferID 1688商品ID,等同于productId OfferID uint64 `json:"offerId,omitempty"` // NeedCpsSuggestPrice 是否需要CPS建议价 NeedCpsSuggestPrice bool `json:"needCpsSuggestPrice,omitempty"` // NeedIntelligentInfo 是否返回算法改写的信息,包括标题、图片和详情图片 NeedIntelligentInfo bool `json:"needIntelligentInfo,omitempty"` }
CpsMediaProductInfoRequest 获取商品详情接口 API Request
func (CpsMediaProductInfoRequest) Map ¶
func (r CpsMediaProductInfoRequest) Map() map[string]string
Map implement RequestData Interface
func (CpsMediaProductInfoRequest) Name ¶
func (r CpsMediaProductInfoRequest) Name() string
Name implement RequestData Interface
type CpsMediaProductInfoResponse ¶
type CpsMediaProductInfoResponse struct { go1688.BaseResponse // ProductInfo 商品详情 ProductInfo *ProductInfo `json:"productInfo,omitempty"` // BizGroupInfos 业务信息 BizGroupInfos []*BizGroupInfo `json:"bizGroupInfos,omitempty"` }
CpsMediaProductInfoResponse 获取商品详情接口 API Response
type FollowRequest ¶
type FollowRequest struct { // ProductID 商品id ProductID uint64 `json:"productId,omitempty"` }
FollowRequest 关注商品 APIRequest
func (FollowRequest) Map ¶
func (r FollowRequest) Map() map[string]string
Map implement RequestData interface
func (FollowRequest) Name ¶
func (r FollowRequest) Name() string
Name implement RequestData interface
type FollowResponse ¶
type FollowResponse struct { go1688.BaseResponse // Code 0表示成功 Code int `json:"code,omitempty"` // Message 结果的描述 Message string `json:"message,omitempty"` }
FollowResponse 关注商品 API Response
func (FollowResponse) Error ¶
func (f FollowResponse) Error() string
Error implement error interface
func (FollowResponse) IsError ¶
func (f FollowResponse) IsError() bool
IsError check response success
type ProductAttribute ¶
type ProductAttribute struct { // ID 属性ID ID uint64 `json:"attributeID,omitempty"` // Value 值内容 Value string `json:"value,omitempty"` // ValueID 属性值ID ValueID uint64 `json:"valueID,omitempty"` // Name 属性ID所对应的显示名,比如颜色,尺码 Name string `json:"attributeName,omitempty"` // IsCustom 是否为自定义属性,国际站无需关注 IsCustom bool `json:"isCustom,omitempty"` }
ProductAttribute 产品属性
type ProductInfo ¶
type ProductInfo struct { // ID 商品ID ID uint64 `json:"productID,omitempty"` // CategoryID 类目ID,标识商品所属类目 CategoryID uint64 `json:"categoryID,omitempty"` // CategoryName 类目名 CategoryName string `json:"categoryName,omitempty"` // GroupID 分组ID,确定商品所属分组。1688可传入多个分组ID,国际站同一个商品只能属于一个分组,因此默认只取第一个 GroupID []uint64 `json:"groupID,omitempty"` // Subject 商品标题,最多128个字符 Subject string `json:"subject,omitempty"` // Description 商品详情描述,可包含图片中心的图片URL Description string `json:"description,omitempty"` // PictureAuth 是否图片私密信息,国际站此字段无效 PictureAuth bool `json:"pictureAuth,omitempty"` // Image 商品主图 Image *struct { // Images 主图列表,使用相对路径,需要增加域名:https://cbu01.alicdn.com/ Images []string `json:"images,omitempty"` } `json:"image,omitempty"` // SkuInfos sku信息 SkuInfos []*SkuInfo `json:"skuInfos,omitempty"` // SaleInfo 商品销售信息 SaleInfo *SaleInfo `json:"saleInfo,omitempty"` // ShippingInfo 商品物流信息 ShippingInfo *ShippingInfo `json:"shippingInfo,omitempty"` // QualityLevel 质量星级(0-5) QualityLevel int `json:"qualityLevel,omitempty"` // SupplierLoginID 供应商loginId SupplierLoginID string `json:"supplierLoginId,omitempty"` // MainVideo 主图视频播放地址 MainVedio string `json:"mainVedio,omitempty"` // ProductCargoNumber 商品货号,产品属性中的货号 ProductCargoNumber string `json:"productCargoNumber,omitempty"` // ReferencePrice 参考价格,返回价格区间,可能为空 ReferencePrice string `json:"referencePrice,omitempty"` // Attributes 产品属性列表 Attributes []ProductAttribute `json:"attributes,omitempty"` // Status 商品状态。 // - published: 上网状态; // - member expired: 会员撤销; // - auto expired: 自然过期; // - expired: 过期(包含手动过期与自动过期); // - member deleted: 会员删除; // - modified: 修改; // - new: 新发; // - deleted: 删除; // - TBD: to be delete; // - approved: 审批通过; // - auditing: 审核中; // - untread: 审核不通过; Status ProductStatus `json:"status,omitempty"` }
ProductInfo 商品详情
type ProductPriceRange ¶ added in v1.0.5
type ProductPriceRange struct { // StartQuantity 起批量 StartQuantity int64 `json:"startQuantity,omitempty"` // Price 价格 Price decimal.Decimal `json:"price,omitempty"` }
ProductPriceRange 区间价格。按数量范围设定的区间价格
type ProductStatus ¶
type ProductStatus = string
ProductStatus 商品状态。
const ( // PRODUCT_PUBLISHED 上网状态; PRODUCT_PUBLISHED ProductStatus = "published" // PRODUCT_MEMBER_EXPIRED 会员撤销 PRODUCT_MEMBER_EXPIRED ProductStatus = "member expired" // PRODUCT_AUTO_EXPIRED 自然过期 PRODUCT_AUTO_EXPIRED ProductStatus = "auto expired" // PRODUCT_EXPIRED 过期(包含手动过期与自动过期) PRODUCT_EXPIRED ProductStatus = "expired" // PRODUCT_MEMBER_DELETED 会员删除 PRODUCT_MEMBER_DELETED ProductStatus = "member deleted" // PRODUCT_MODIFIED 修改 PRODUCT_MODIFIED ProductStatus = "modified" // PRODUCT_NEW 新发 PRODUCT_NEW ProductStatus = "new" // PRODUCT_DELETED 删除 PRODUCT_DELETED ProductStatus = "deleted" // PRODUCT_TBD to be delete PRODUCT_TBD ProductStatus = "TBD" // PRODUCT_APPROVED 审批通过 PRODUCT_APPROVED ProductStatus = "approved" // PRODUCT_AUDITING 审核中 PRODUCT_AUDITING ProductStatus = "auditing" // PRODUCT_UNTREAD 审核不通过 PRODUCT_UNTREAD ProductStatus = "untread" )
type SaleInfo ¶
type SaleInfo struct { // SupportOnlineTrade 是否支持网上交易。true:支持 false:不支持 SupportOnlineTrade bool `json:"supportOnlineTrade,omitempty"` // MixWholeSale 是否支持混批 MixWholeSale bool `json:"mixWholeSale,omitempty"` // PriceAuth 是否价格私密信息 PriceAuth bool `json:"priceAuth,omitempty"` // PriceRanges 区间价格。按数量范围设定的区间价格 PriceRanges []ProductPriceRange `json:"priceRanges,omitempty"` // AmountOnSale 可售数量 AmountOnSale float64 `json:"amountOnSale,omitempty"` // Unit 计量单位 Unit string `json:"unit,omitempty"` // MinOrderQuantity 最小起订量,范围是1-99999。 MinOrderQuantity int64 `json:"minOrderQuantity,omitempty"` // BatchNumber 每批数量,默认为空或者非零值,该属性不为空时sellunit为必填 BatchNumber int64 `json:"batchNumber,omitempty"` // RetailPrice 建议零售价 RetailPrice decimal.Decimal `json:"retailprice,omitempty"` // SellUnit 售卖单位,如果为批量售卖,代表售卖的单位,该属性不为空时batchNumber为必填,例如1"手"=12“件"的"手" SellUnit string `json:"sellunit,omitempty"` // QuoteType 0-无SKU按数量报价,1-有SKU按规格报价,2-有SKU按数量报价 QuoteType QuoteType `json:"quoteType,omitempty"` // ConsignPrice 分销基准价。代销场景均使用该价格。有SKU商品查看skuInfo中的consignPrice ConsignPrice decimal.Decimal `json:"consignPrice,omitempty"` // CpsSuggestPrice CPS建议价(单位:元) CpsSuggestPrice decimal.Decimal `json:"cpsSuggestPrice,omitempty"` // ChannelPrice 厂货通渠道专享价(单位:元) ChannelPrice decimal.Decimal `json:"channelPrice,omitempty"` }
SaleInfo 商品销售信息
type ShippingInfo ¶
type ShippingInfo struct { // FreightTemplateID 运费模板ID,0表示运费说明,1表示卖家承担运费,其他值表示使用运费模版。此参数可调用运费模板相关API获取 FreightTemplateID uint64 `json:"freightTemplateID,omitempty"` // UnitWeight 重量/毛重 UnitWeight float64 `json:"unitWeight,omitempty"` // PackageSize 尺寸,单位是厘米,长宽高范围是1-9999999。1688无需关注此字段 PackageSize string `json:"packageSize,omitempty"` // Volumn 体积,单位是立方厘米,范围是1-9999999,1688无需关注此字段 Volumn int64 `json:"volumn,omitempty"` // HandlingTime 备货期,单位是天,范围是1-60。1688无需处理此字段 HandlingTime int `json:"handlingTime,omitempty"` // SendGoodsAddressID 发货地址ID SendGoodsAddressID uint64 `json:"sendGoodsAddressId,omitempty"` // SendGoodsAddressText 发货地描述 SendGoodsAddressText string `json:"sendGoodsAddressText,omitempty"` // ShuttleWeight 净重 SuttleWeight float64 `json:"suttleWeight,omitempty"` // Height 高度 Height float64 `json:"height,omitempty"` // Width 宽度 Width float64 `json:"width,omitempty"` // Length 长度 Length float64 `json:"length,omitempty"` }
ShippingInfo 商品物流信息
type SkuAttribute ¶
type SkuAttribute struct { // ID 属性ID ID uint64 `json:"attributeID,omitempty"` // Value 属性值内容 Value string `json:"attributeValue,omitempty"` // ImageURL 图片名 ImageURL string `json:"skuImageUrl,omitempty"` // DisplayName sku属性ID所对应的显示名,比如颜色,尺码 DisplayName string `json:"attributeDisplayName,omitempty"` // Name sku属性ID所对应的显示名,比如颜色,尺码 Name string `json:"attributeName,omitempty"` }
SkuAttribute 商品属性和属性值
type SkuInfo ¶
type SkuInfo struct { // ID 该规格在所有商品中的唯一标记 ID uint64 `json:"skuId,omitempty"` // Attributes SKU属性值,可填多组信息 Attributes []*SkuAttribute `json:"attributes,omitempty"` // CargoNumber 指定规格的货号 CargoNumber string `json:"cargoNumber,omitempty"` // AmountOnSale 可销售数量 AmountOnSale int64 `json:"amountOnSale,omitempty"` // RetailPrice 建议零售价 RetailPrice decimal.Decimal `json:"retailPrice,omitempty"` // Price 报价时该规格的单价 Price decimal.Decimal `json:"price,omitempty"` // SpecID,该规格在本商品内的唯一标记 SpecID string `json:"specId,omitempty"` // ConsignPrice 分销基准价。代销场景均使用该价格。无SKU商品查看saleInfo中的consignPrice ConsignPrice decimal.Decimal `json:"consignPrice,omitempty"` // CpsSuggestPrice CPS建议价(单位:元) CpsSuggestPrice decimal.Decimal `json:"cpsSuggestPrice,omitempty"` // ChannelPrice 厂货通渠道专享价(单位:元) ChannelPrice decimal.Decimal `json:"channelPrice,omitempty"` }
SkuInfo sku信息
type UnfollowCrossborderRequest ¶
type UnfollowCrossborderRequest struct {
ProductID uint64 `json:"productId,omitempty"`
}
UnfollowCrossborderRequest 解除关注商品API Request
func (UnfollowCrossborderRequest) Map ¶
func (r UnfollowCrossborderRequest) Map() map[string]string
Map implement RequestData interface
func (UnfollowCrossborderRequest) Name ¶
func (r UnfollowCrossborderRequest) Name() string
Name implement RequestData interface
type UnfollowCrossborderResponse ¶
type UnfollowCrossborderResponse struct { go1688.BaseResponse // Code 0表示成功 Code int `json:"code,omitempty"` // Message 结果的描述 Message string `json:"message,omitempty"` }
UnfollowCrossborderResponse 解除关注商品 API Response
func (UnfollowCrossborderResponse) Error ¶
func (f UnfollowCrossborderResponse) Error() string
Error implement error interface
func (UnfollowCrossborderResponse) IsError ¶
func (f UnfollowCrossborderResponse) IsError() bool
IsError check response success