p4p

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Jan 17, 2023 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package p4p 营销活动相关API

Index

Constants

View Source
const (
	NAMESPACE = "com.alibaba.p4p"
)

Variables

This section is empty.

Functions

func OpSaveMediaUserBehaviour added in v1.0.3

func OpSaveMediaUserBehaviour(client *go1688.Client, req *OpSaveMediaUserBehaviourRequest, accessToken string) error

OpSaveMediaUserBehaviour 机构下用户行为日志上报

Types

type ActionType added in v1.0.3

type ActionType = string

ActionType 行为类型

const (
	// ActionType_CLICK CLICK(点击商品详情)
	ActionType_CLICK ActionType = "CLICK"
	// ActionType_COMMENT COMMENT(评论)
	ActionType_COMMENT ActionType = "COMMENT"
	// ActionTYpe_STORE STORE(收藏)
	ActionType_STORE ActionType = "STORE"
	// ActionType_CART CART(加购物车)
	ActionType_CART ActionType = "CART"
	// ActionType_SEARCH SEARCH(关键词搜索,配合actionDetail)
	ActionType_SEARCH ActionType = "SEARCH"
	// ActionType_VIEW 曝光(VIEW)
	ActionType_VIEW ActionType = "VIEW"
)

type BizType added in v1.0.3

type BizType = string

BizType 经营模式

const (
	// BizType_FACTORY 生产加工
	BizType_FACTORY BizType = "1"
	// BizType_WHOLESALE 经销批发
	BizType_WHOLESALE BizType = "2"
	// BizType_AGENT 招商代理
	BizType_AGENT BizType = "3"
	// BizType_SERVICE 商业服务
	BizType_SERVICE BizType = "4"
)

type BuyerProtection added in v1.0.3

type BuyerProtection = string

BuyerProtection 买家保障

const (
	// BuyerProtection7d 7天包换
	BuyerProtection7d BuyerProtection = "qtbh"
	// BuyerProtection15d 15天包换
	BuyerProtection15d BuyerProtection = "swtbh"
)

type DeliveryTimeType added in v1.0.3

type DeliveryTimeType = string

DeliveryTimeType 发货时间

const (
	// DeliveryTimeType24h 24小时发货
	DeliveryTimeType24h DeliveryTimeType = "1"
	// DeliveryTimeType48h 48小时发货
	DeliveryTimeType48h DeliveryTimeType = "2"
	// DeliveryTimeType72h 72小时发货
	DeliveryTimeType72h DeliveryTimeType = "3"
)

type FeedType added in v1.0.3

type FeedType = int

FeedType 商品类型

const (
	// FeedType_1688 1688商品
	FeedType_1688 FeedType = 1
	// FeedType_MEDIA 机构商品
	FeedType_MEDIA FeedType = 2
)

type ListOfferDetailActivityRequest

type ListOfferDetailActivityRequest struct {
	// OfferID 商品id
	OfferID uint64 `json:"offerId,omitempty"`
}

ListOfferDetailActivityRequest 获取所有可用营销活动列表(媒体选择要使用的最优活动) API Request

func (ListOfferDetailActivityRequest) Map

Map implement RequestData interface

func (ListOfferDetailActivityRequest) Name

Name implement RequestData interface

type OpMediaUserRecommendOfferServiceRequest added in v1.0.3

type OpMediaUserRecommendOfferServiceRequest struct {
	// DeviceIDMd5 设备id求md5(32位小写)(手机号与设备号至少一个)
	DeviceIDMd5 string `json:"deviceIdMd5,omitempty"`
	// PhoneMd5 手机号求md5(32位小写)(手机号与设备号至少一个)
	PhoneMd5 string `json:"phoneMd5,omitempty"`
	// PageNo 页码
	PageNo int `json:"pageNo,omitempty"`
	// PageSize 每页数量
	PageSize int `json:"pageSize,omitempty"`
}

OpMediaUserRecommendOfferServiceRequest 机构用户个性化商品推荐接口 API Request

func (OpMediaUserRecommendOfferServiceRequest) Map added in v1.0.3

Map implement RequestData interface

func (OpMediaUserRecommendOfferServiceRequest) Name added in v1.0.3

Name implement RequestData interface

type OpMediaUserRecommendOfferServiceResponse added in v1.0.3

type OpMediaUserRecommendOfferServiceResponse struct {
	go1688.BaseResponse
	// Result 营销活动结果
	Result *OpMediaUserRecommendOfferServiceResult `json:"result"`
}

OpMediaUserRecommendOfferServiceResponse 机构用户个性化商品推荐接口 API Response

type OpMediaUserRecommendOfferServiceResult added in v1.0.3

type OpMediaUserRecommendOfferServiceResult struct {
	ErrorCode string           `json:"errorCode,omitempty"`
	ErrorMsg  string           `json:"errorMsg,omitempty"`
	Success   bool             `json:"success,omitempty"`
	Result    []RecommendOffer `json:"result,omitempty"`
}

OpMediaUserRecommendOfferServiceResult 营销活动结果

func (OpMediaUserRecommendOfferServiceResult) Error added in v1.0.3

Error implement error interface

func (OpMediaUserRecommendOfferServiceResult) IsError added in v1.0.3

IsError check success

type OpSaveMediaUserBehaviourRequest added in v1.0.3

type OpSaveMediaUserBehaviourRequest struct {
	// Uuid 代表唯一一条日志记录
	Uuid string `json:"uuid,omitempty"`
	// DeviceIDMd5 设备id求md5(32位小写)(手机号与设备号至少一个)
	DeviceIDMd5 string `json:"deviceIdMd5,omitempty"`
	// PhoneMd5 手机号求md5(32位小写)(手机号与设备号至少一个)
	PhoneMd5 string `json:"phoneMd5,omitempty"`
	// ActionTime 行为时间,13位时间戳精确到毫秒
	ActionTime int64 `json:"actionTime,omitempty"`
	// ActionType 行为类型,1688定义枚举值: CLICK(点击商品详情),COMMENT(评论),STORE(收藏),CART(加购物车),SEARCH(关键词搜索,配合actionDetail),曝光(VIEW)
	ActionType ActionType `json:"actionType,omitempty"`
	// ActionDetail 行为类型补充字段,部分类型配合使用,如搜索内容
	ActionDetail string `json:"actionDetail,omitempty"`
	// FeedType 商品类型,1:1688商品;2 机构商品;
	FeedType FeedType `json:"feedType,omitempty"`
	// FeedID 商品id,1688商品必须传商品id
	FeedID uint64 `json:"feedId,omitempty"`
	// FeeddTitle 商品标题
	FeedTitle string `json:"feedTitle,omitempty"`
	// FeedPrice 售卖价格,单位元,两位小数
	FeedPrice float64 `json:"feedPrice,omitempty"`
	// FeedCategory 商品类目,多级类目英文分号分割,按一级类目;二级类目;叶子类目格式传
	FeedCategory string `json:"feedCategory,omitempty"`
}

OpSaveMediaUserBehaviourRequest 机构下用户行为日志上报 API Request

func (OpSaveMediaUserBehaviourRequest) Map added in v1.0.3

Map implement RequestData interface

func (OpSaveMediaUserBehaviourRequest) Name added in v1.0.3

Name implement RequestData interface

type OpSearchCybOffersRequest added in v1.0.3

type OpSearchCybOffersRequest struct {
	// BizType 枚举;经营模式;1:生产加工,2:经销批发,3:招商代理,4:商业服务
	BizType BizType `json:"bizType,omitempty"`
	// BuyerProtection 枚举;买家保障,多个值用逗号分割;qtbh:7天包换;swtbh:15天包换
	BuyerProtection string `json:"buyerProtection,omitempty"`
	// City 所在地区- 市
	City string `json:"city,omitempty"`
	// DeliveryTimeType 枚举;发货时间;1:24小时发货;2:48小时发货;3:72小时发货
	DeliveryTimeType DeliveryTimeType `json:"deliveryTimeType,omitempty"`
	// DescendOrder 是否倒序;正序: false;倒序:true
	DescendOrder bool `json:"descendOrder,omitempty"`
	// HolidayTagID 商品售卖类型筛选;枚举,多个值用分号分割;免费赊账:50000114
	HolidayTagID string `json:"holidayTagId,omitempty"`
	// KeyWords 搜索关键词
	KeyWords string `json:"keyWords,omitempty"`
	// Page 页码
	Page int `json:"page,omitempty"`
	// PageSize 页面数量;最大20
	PageSize int `json:"pageSize,omitempty"`
	// PostCategoryID 类目id;4 纺织、皮革 5 电工电气 10 能源 12 交通运输 16 医药、保养 17 工艺品、礼品 57 电子元器件 58 照明工业 64 环保 66 医药、保养 67 办公、文教 69 商务服务 96 家纺家饰 311 童装 312 内衣 1813 玩具 2805 加工 2829 二手设备转让 10165 男装 1038378 鞋 1042954 箱包皮具 127380009 运动服饰 130822002 餐饮生鲜 130823000 性保健品 200514001 床上用品 201128501 直播 1 农业 2 食品酒水 7 数码、电脑 9 冶金矿产 15 日用百货 18 运动装备 33 汽摩及配件 53 传媒、广电 54 服饰配件、饰品 59 五金、工具 68 包装 70 安全、防护 96 家居饰品 97 美妆日化 97 美容护肤/彩妆 1501 母婴用品 10166 女装 10208 仪器仪表 122916001 宠物及园艺 123614001 钢铁 130822220 个护/家清 6 家用电器 8 化工 13 家装、建材 21 办公、文教 55 橡塑 65 机械及行业设备 71 汽摩及配件 72 印刷 73 项目合作 509 通信产品 1426 机床 1043472 毛巾、巾类 122916002 汽车用品
	PostCategoryID uint64 `json:"postCategoryId,omitempty"`
	// PriceStart 最低价
	PriceStart float64 `json:"priceStart,omitempty"`
	// PriceEnd 最高价
	PriceEnd float64 `json:"priceEnd,omitempty"`
	// PriceFilterFields 价格类型;默认分销价;agent_price:分销价;
	PriceFilterFields string `json:"priceFilterFields,omitempty"`
	// Province 所在地区- 省
	Province string `json:"province,omitempty"`
	// SortType 枚举;排序字段;normal:综合;
	SortType string `json:"sortType,omitempty"`
	// Tags 历史遗留,可不用
	Tags string `json:"tags,omitempty"`
	// OfferTags 枚举;1387842:渠道专享价商品
	OfferTags string `json:"offerTags,omitempty"`
	// OfferIDs 商品id搜索,多个id用逗号分割
	OfferIDs string `json:"offerIds,omitempty"`
}

OpSearchCybOffersRequest 商品列表搜索接口(替代alibaba.cps.listOverPricedOffer) API Request

func (OpSearchCybOffersRequest) Map added in v1.0.3

Map implement RequestData interface

func (OpSearchCybOffersRequest) Name added in v1.0.3

Name implement RequestData interface

type OpSearchCybOffersResponse added in v1.0.3

type OpSearchCybOffersResponse struct {
	go1688.BaseResponse
	TotalCount int64                      `json:"totalCount,omitempty"`
	Result     []OverPricedCybSearchOffer `json:"result,omitempty"`
}

OpSearchCybOffersResponse 商品列表搜索接口 API Response

type OverPricedCybSearchOffer added in v1.0.3

type OverPricedCybSearchOffer struct {
	// Title 商品标题
	Title string `json:"title,omitempty"`
	// ImgURL 商品首图
	ImgURL string `json:"imgUrl,omitempty"`
	// OfferID 商品id
	OfferID uint64 `json:"offerId,omitempty"`
	// SoldOut 销量
	SoldOut int64 `json:"soldOut,omitempty"`
	// SuperBuyerPrice 超买价,单位元
	SuperBuyerPrice decimal.Decimal `json:"superBuyerPrice,omitempty"`
	// Enable 是否有效
	Enable bool `json:"enable,omitempty"`
	// Profit 利润空间; - :表示无
	Profit string `json:"profit,omitempty"`
	// CurrentPrice 分销价
	CurrentPrice decimal.Decimal `json:"currentPrice,omitempty"`
	// OfferTags 标签数组
	OfferTags []string `json:"offerTags,omitempty"`
	// ChannelPrice 渠道专属价,可能无价格,需要调用方兼容处理
	ChannelPrice decimal.Decimal `json:"channelPrice,omitempty"`
}

OverPricedCybSearchOffer

func OpSearchCybOffers added in v1.0.3

func OpSearchCybOffers(client *go1688.Client, req *OpSearchCybOffersRequest, accessToken string) (int64, []OverPricedCybSearchOffer, error)

OpSearchCybOffers 商品列表搜索接口(替代alibaba.cps.listOverPricedOffer)

type QueryOfferDetailActivityRequest

type QueryOfferDetailActivityRequest struct {
	// OfferID 商品id
	OfferID uint64 `json:"offerId"`
}

QueryOfferDetailActivityRequest 获取营销活动价格等活动信息 API Request

func (QueryOfferDetailActivityRequest) Map

Map implement RequestData interface

func (QueryOfferDetailActivityRequest) Name

Name implement RequestData interface

type QueryOfferDetailActivityResponse

type QueryOfferDetailActivityResponse struct {
	go1688.BaseResponse
	// Result 营销活动结果
	Result *QueryOfferDetailActivityResult `json:"result"`
}

QueryOfferDetailActivityResponse 获取营销活动价格等活动信息 API Response

type QueryOfferDetailActivityResult

type QueryOfferDetailActivityResult struct {
	ErrorCode string                    `json:"errorCode,omitempty"`
	ErrorMsg  string                    `json:"errorMsg,omitempty"`
	Success   bool                      `json:"success,omitempty"`
	Result    *UnionActivityOfferDetail `json:"result,omitempty"`
}

QueryOfferDetailActivityResult 营销活动结果

func (QueryOfferDetailActivityResult) Error

Error implement error interface

func (QueryOfferDetailActivityResult) IsError

IsError check success

type RecommendOffer added in v1.0.3

type RecommendOffer struct {
	// OfferID 商品id
	OfferID uint64 `json:"offerId,omitempty"`
	// ImgURL 商品首图
	ImgURL string `json:"imgUrl,omitempty"`
	// RecommendPrice 建议零售价
	RecommendPrice decimal.Decimal `json:"recommendPrice,omitempty"`
	// RecommendTitle 智能标题
	RecommendTitle string `json:"recommendTitle,omitempty"`
}

RecommendOffer 推荐商品

func OpMediaUserRecommendOfferService added in v1.0.3

func OpMediaUserRecommendOfferService(client *go1688.Client, req *OpMediaUserRecommendOfferServiceRequest, accessToken string) ([]RecommendOffer, error)

OpMediaUserRecommendOfferService 机构用户个性化商品推荐接口

type UnionActivityArea

type UnionActivityArea struct {
	Code string `json:"code,omitempty"`
	Name string `json:"name,omitempty"`
}

UnionActivityArea 免包邮地区,与活动包邮配合使用

type UnionActivityOfferDetail

type UnionActivityOfferDetail struct {
	// OfferID 商品id
	OfferID uint64 `json:"offerId,omitempty"`
	// ActivityID 营销活动Id
	ActivityID uint64 `json:"activityId,omitempty"`
	// ActivityName 活动名称
	ActivityName string `json:"activityName,omitempty"`
	// HotTime 预热时间,活动未开始,不可用活动价下单; 为null表示无预热时间
	HotTime go1688.JsonTime `json:"hotTime,omitempty"`
	// StartTime 活动开始时间;大于now时,活动有效
	StartTime go1688.JsonTime `json:"startTime,omitempty"`
	// EndTime 活动结束时间;小于now时,活动有效
	EndTime go1688.JsonTime `json:"endTime,omitempty"`
	// BeginQuantity 活动起批量
	BeginQuantity int64 `json:"beginQuantity,omitempty"`
	// Stock 活动总库存,为null时使用offer原库存
	Stock int64 `json:"stock,omitempty"`
	// PersionLimitCount 商品本身限购数,非活动价可购买数;-1表示不限,0表示可购买数为0;3个*LimitCount字段都等于-1时,表示没有任何限购
	PersonLimitCount int64 `json:"personLimitCount,omitempty"`
	// PromotionLimitCount 限购数,等于0且personLimitCount>0时,可以以原价下单,但不能以活动价下单;-1表示不限数量;3个*LimitCount字段都等于-1时,表示没有任何限购
	PromotionLimitCount int64 `json:"promotionLimitCount,omitempty"`
	// ActivityLimitCount 活动限购数;该场内活动商品限购数,-1表示不限购;0表示不可购买该场活动所有商品;3个*LimitCount字段都等于-1时,表示没有任何限购
	ActivityLimitCount int64 `json:"activityLimitCount,omitempty"`
	// FreepostageStartTime 活动限时包邮开始时间;null 表示不限时
	FreepostageStartTime go1688.JsonTime `json:"freepostageStartTime,omitempty"`
	// FreepostageEndTime 活动限时包邮结束时间;null 表示不限时
	FreepostageEndTime go1688.JsonTime `json:"freepostageEndTime,omitempty"`
	// ExcludeAreaList 免包邮地区,与活动包邮配合使用
	ExcludeAreaList []UnionActivityArea `json:"excludeAreaList,omitemtpy"`
	// RangePrice 如果offer是范围报价,且价格优惠是折扣的情况,返回折扣计算后的价格范围;优先取该字段,该字段为空时,表示分sku报价,取promotionItemList
	RangePrice *UnionActivityRangePrice `json:"rangePrice,omitempty"`
	// PromotionItemList 优惠结果,根据优惠方式(PromotionInfo),结合offer的原价信息,计算出优惠结果:每个sku或者每个区间价的促销价,折扣率
	PromotionItemList []UnionActivityPromotionItem `json:"promotionItemList,omitempty"`
	// SkuStockList  sku维度的库存结果
	SkuStockList []UnionActivitySkuStock `json:"skuStockList,omitempty"`
	// IntroOrderFlow 这里平台会计算一个推荐使用的下单flow,可以用这个flow值调用下单接口
	IntroOrderFlow string `json:"introOrderFlow,omitempty"`
}

UnionActivityOfferDetail 营销活动

func ListOfferDetailActivity

func ListOfferDetailActivity(client *go1688.Client, req *ListOfferDetailActivityRequest, accessToken string) (*UnionActivityOfferDetail, error)

ListOfferDetailActivity 获取所有可用营销活动列表(媒体选择要使用的最优活动)

func QueryOfferDetailActivity

func QueryOfferDetailActivity(client *go1688.Client, req *QueryOfferDetailActivityRequest, accessToken string) (*UnionActivityOfferDetail, error)

QueryOfferDetailActivity 获取营销活动价格等活动信息

type UnionActivityPromotionItem

type UnionActivityPromotionItem struct {
	// SkuID sku优惠结果时有意义;对于区间价的优惠结果,此字段无意义,可能为null
	SkuID uint64 `json:"skuId,omitempty"`
	// OriginalPrice 原价,单位分
	OriginalPrice int64 `json:"originalPrice,omitempty"`
	// PromotionPrice 优惠价,单位分
	PromotionPrice int64 `json:"promotionPrice,omitempty"`
}

UnionActivityPromotionItem 优惠结果

type UnionActivityRangePrice

type UnionActivityRangePrice struct {
	// Price 区间价数组,每个item为一个价格,以分为单位
	Price []int64 `json:"price,omitempty"`
	// BeginQuantity 区间对应的起批量
	BeginQuantity int64 `json:"beginQuantity,omitempty"`
}

UnionActivityRangePrice 活动价格区间

type UnionActivitySkuStock

type UnionActivitySkuStock struct {
	// Stock 库存
	Stock int64 `json:"stock,omitempty"`
	// SkuID skuId
	SkuID uint64 `json:"skuId,omitempty"`
}

UnionActivitySkuStock 库存结果

Jump to

Keyboard shortcuts

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