Documentation ¶
Index ¶
- Constants
- Variables
- func CheckEmpty(vals ...string) bool
- func ErrCode(err error) int
- type APIError
- type AccessTokenResponse
- type Attribute
- type AttributeList
- type AttributeValue
- type Brand
- type BrandList
- type CancelOrderRequest
- type CancelOrderResponse
- type Category
- type CategoryList
- type CategoryRule
- type CategoryRules
- type Certification
- type Client
- func (c *Client) ActivateProduct(ctx context.Context, p Param, ids []string) (list FailedProductIDs, err error)
- func (c *Client) CancelOrder(ctx context.Context, p Param, req CancelOrderRequest) (resp CancelOrderResponse, err error)
- func (c *Client) ConfirmOrderSplit(ctx context.Context, p Param, req ConfirmOrderSplitRequest) (data ConfirmOrderSplitData, err error)
- func (c *Client) ConfirmPreCombinePkg(ctx context.Context, p Param, req ConfirmPreCombinePkgRequest) (data PreCombinePkgData, err error)
- func (c *Client) ConfirmReverse(ctx context.Context, p Param, orderID string) (err error)
- func (c *Client) CreateProduct(ctx context.Context, p Param, req CreateProductRequest) (product ProductData, err error)
- func (c *Client) DeactivateProducts(ctx context.Context, p Param, productIDs []string) (list FailedProductIDs, err error)
- func (c *Client) Delete(ctx context.Context, path string, param url.Values, body interface{}, ...) (err error)
- func (c *Client) DeleteProducts(ctx context.Context, p Param, ids []string) (list FailedProductIDs, err error)
- func (c *Client) EditProduct(ctx context.Context, p Param, req EditProductRequest) (product ProductData, err error)
- func (c *Client) GenerateAuthURL(state string) string
- func (c *Client) Get(ctx context.Context, path string, param url.Values, resp interface{}) (err error)
- func (c *Client) GetAccessToken(ctx context.Context, code string) (resp AccessTokenResponse, err error)
- func (c *Client) GetAttribute(ctx context.Context, p Param, categoryID string) (list AttributeList, err error)
- func (c *Client) GetAuthorizedShop(ctx context.Context, ak string, shop_id string) (list ShopList, err error)
- func (c *Client) GetBrand(ctx context.Context, p Param, categoryID string) (list BrandList, err error)
- func (c *Client) GetCategory(ctx context.Context, p Param) (list CategoryList, err error)
- func (c *Client) GetCategoryRule(ctx context.Context, p Param, categoryID string) (list CategoryRules, err error)
- func (c *Client) GetOrderDetail(ctx context.Context, p Param, ordersID []string) (list OrderDetailList, err error)
- func (c *Client) GetOrderList(ctx context.Context, p Param, query GetOrderListRequest) (list OrdersList, err error)
- func (c *Client) GetOrderSettlements(ctx context.Context, p Param, ordersID string) (list SettlementsList, err error)
- func (c *Client) GetPackageDetail(ctx context.Context, p Param, req PackageIDRequest) (data GetPackageDetailData, err error)
- func (c *Client) GetPackagePickupConfig(ctx context.Context, p Param, req PackageIDRequest) (data GetPackagePickupConfigData, err error)
- func (c *Client) GetPackageShippingDocument(ctx context.Context, p Param, req GetPackageShippingDocumentRequest) (data GetPackageShippingDocumentData, err error)
- func (c *Client) GetPackageShippingInfo(ctx context.Context, p Param, req PackageIDRequest) (data GetPackageShippingInfoData, err error)
- func (c *Client) GetProductDetail(ctx context.Context, p Param, productID string) (product ProductData, err error)
- func (c *Client) GetProductList(ctx context.Context, p Param, req ProductSearchRequest) (list GetProductListData, err error)
- func (c *Client) GetReverseList(ctx context.Context, p Param, query GetReverseListRequest) (list ReverseOrdersList, err error)
- func (c *Client) GetReverseReason(ctx context.Context, p Param, req GetReverseReasonRequest) (list ReverseReasonList, err error)
- func (c *Client) GetShippingDocument(ctx context.Context, p Param, req GetShippingDocumentRequest) (data GetShippingDocumentData, err error)
- func (c *Client) GetShippingInfo(ctx context.Context, p Param, req OrderIDReq) (data LogisticsGetShippingInfoData, err error)
- func (c *Client) GetShippingProvider(ctx context.Context, p Param) (data GetShippingProviderData, err error)
- func (c *Client) GetSubscribedDelivery(ctx context.Context, p Param, req GetSubscribedDeliveryRequest) (data GetSubscribedDeliveryData, err error)
- func (c *Client) GetWarehouseList(ctx context.Context, p Param) (data GetWarehouseListData, err error)
- func (c *Client) Post(ctx context.Context, path string, param url.Values, body interface{}, ...) (err error)
- func (c *Client) Put(ctx context.Context, path string, param url.Values, body interface{}, ...) (err error)
- func (c *Client) RecoverProduct(ctx context.Context, p Param, ids []string) (list FailedProductIDs, err error)
- func (c *Client) RefreshToken(ctx context.Context, rk string) (resp AccessTokenResponse, err error)
- func (c *Client) RejectReverse(ctx context.Context, p Param, query RejectReverseRequest) (err error)
- func (c *Client) RemovePackageOrder(ctx context.Context, p Param, req RemovePackageOrderRequest) (data PreCombinePkgData, err error)
- func (c *Client) SearchPackage(ctx context.Context, p Param, req SearchPackageRequest) (data SearchPackageData, err error)
- func (c *Client) SearchPreCombinePkg(ctx context.Context, p Param, req SearchPreCombinePkgRequest) (data SearchPreCombinePkgData, err error)
- func (c *Client) SearchSettlements(ctx context.Context, p Param, query SearchSettlementsRequest) (list SettlementsList, err error)
- func (c *Client) SearchTransactions(ctx context.Context, p Param, query SearchTransactionsRequest) (list TransactionsList, err error)
- func (c *Client) ShipOrder(ctx context.Context, p Param, req ShipOrderRequest) (code int, err error)
- func (c *Client) ShipPackage(ctx context.Context, p Param, req ShipPackageRequest) (data ShipPackageData, err error)
- func (c *Client) UpdatePackageShippingInfo(ctx context.Context, p Param, req UpdatePackageShippingInfoRequest) (data UpdatePackageShippingInfoData, err error)
- func (c *Client) UpdatePrice(ctx context.Context, p Param, req UpdatePriceRequest) (list UpdatePriceData, err error)
- func (c *Client) UpdateShippingInfo(ctx context.Context, p Param, req UpdateShippingInfoReq) (err error)
- func (c *Client) UpdateStock(ctx context.Context, p Param, req UpdateStockRequest) (list UpdateStockFailedSKU, err error)
- func (c *Client) UploadFile(ctx context.Context, p Param, fileName string, body []byte) (info FileInfo, err error)
- func (c *Client) UploadImg(ctx context.Context, p Param, scene ImgScene, body string) (img ImageInfo, err error)
- func (c *Client) UploadImgReader(ctx context.Context, p Param, scene ImgScene, r io.Reader) (img ImageInfo, err error)
- func (c *Client) VerifyOrderSplit(ctx context.Context, p Param, req VerifyOrderSplitRequest) (data VerifyOrderSplitData, err error)
- type ConfirmOrderSplitData
- type ConfirmOrderSplitRequest
- type ConfirmPreCombinePkgRequest
- type CreateProductRequest
- type DeliveryService
- type EditAttributes
- type EditProductCertifications
- type EditProductRequest
- type Error
- type ExemptionOfIdentifierCode
- type FailedProductIDs
- type FailedSKUStock
- type File
- type FileInfo
- type FulfillmentPickUp
- type GetAccessTokenRequest
- type GetOrderDetailRequest
- type GetOrderListRequest
- type GetPackageDetailData
- type GetPackagePickupConfigData
- type GetPackageShippingDocumentData
- type GetPackageShippingDocumentRequest
- type GetPackageShippingInfoData
- type GetProductListData
- type GetReverseListRequest
- type GetReverseReasonRequest
- type GetShippingDocumentData
- type GetShippingDocumentRequest
- type GetShippingProviderData
- type GetSubscribedDeliveryData
- type GetSubscribedDeliveryRequest
- type GetWarehouseListData
- type HTTPClient
- type Image
- type ImageInfo
- type ImgID
- type ImgScene
- type InputType
- type Item
- type Logger
- type LogisticsGetShippingInfoData
- type Option
- type Order
- type OrderDetail
- type OrderDetailList
- type OrderIDReq
- type OrderLineList
- type OrderPackage
- type OrdersList
- type PackageIDRequest
- type Param
- type PaymentInfo
- type Pickup
- type PreCombinePkgData
- type Price
- type ProductAttr
- type ProductAttribute
- type ProductCertification
- type ProductCertificationRequest
- type ProductData
- type ProductItem
- type ProductSearchRequest
- type QCReason
- type RecipientAddress
- type RefreshTokenRequest
- type RejectReverseRequest
- type RemovePackageOrderRequest
- type Response
- type ReturnItem
- type Reverse
- type ReverseOrdersList
- type ReverseReason
- type ReverseReasonList
- type ReverseRecord
- type SKU
- type SKUData
- type SKUPriceItem
- type SalesAttr
- type SalesAttribute
- type SearchPackageData
- type SearchPackageRequest
- type SearchPreCombinePkgData
- type SearchPreCombinePkgRequest
- type SearchSettlementsRequest
- type SearchTransactionsRequest
- type SelfShipment
- type Settlement
- type SettlementInfo
- type SettlementsList
- type ShipOrderRequest
- type ShipPackageData
- type ShipPackageRequest
- type Shop
- type ShopList
- type SizePic
- type SkuItem
- type SkuStockItem
- type StockInfo
- type Transaction
- type TransactionsList
- type UpdatePackageShippingInfoData
- type UpdatePackageShippingInfoRequest
- type UpdatePriceData
- type UpdatePriceRequest
- type UpdateShippingInfoReq
- type UpdateStockFailedSKU
- type UpdateStockRequest
- type Value
- type VerifyOrderSplitData
- type VerifyOrderSplitRequest
- type Video
- type VideoInfo
- type WarrantyPeriod
Constants ¶
const ( SearchPreCombinePkgPATH = "/api/fulfillment/pre_combine_pkg/list" ConfirmPreCombinePkgPATH = "/api/fulfillment/pre_combine_pkg/confirm" RemovePackageOrderPATH = "/api/fulfillment/package/remove" GetPackagePickupConfigPATH = "/api/fulfillment/package_pickup_config/list" ShipPackagePATH = "/api/fulfillment/rts" SearchPackagePATH = "/api/fulfillment/search" GetPackageDetailPATH = "/api/fulfillment/detail" GetPackageShippingInfoPATH = "/api/fulfillment/shipping_info" UpdatePackageShippingInfoPATH = "/api/fulfillment/shipping_info/update" GetPackageShippingDocumentPATH = "/api/fulfillment/shipping_document" VerifyOrderSplitPATH = "/api/fulfillment/order_split/verify" ConfirmOrderSplitPATH = "/api/fulfillment/order_split/confirm" )
const ( GetShippingInfoPATH = "/api/logistics/ship/get" UpdateShippingInfoPATH = "/api/logistics/tracking" GetShippingDocumentPATH = "/api/logistics/shipping_document" GetWarehouseListPATH = "/api/logistics/get_warehouse_list" GetShippingProviderPATH = "/api/logistics/shipping_providers" GetSubscribedDeliveryPATH = "/api/logistics/get_subscribed_deliveryoptions" )
Variables ¶
var ( // AuthBaseURL for auth related api call. AuthBaseURL = "https://auth.tiktok-shops.com" // APIBaseURL other apis except auth. APIBaseURL = "https://open-api.tiktokglobalshop.com" )
var ErrAppInfoEmpty = Error("AppKey or AppSecret is empty")
ErrAppInfoEmpty means something is Missing.
var Timestamp func() string = func() string { return fmt.Sprintf("%d", time.Now().Unix()) }
Timestamp mock this if you want to repeatable request.
Functions ¶
func CheckEmpty ¶
Types ¶
type AccessTokenResponse ¶
type AccessTokenResponse struct { AccessToken string `json:"access_token"` AccessTokenExpireIn int `json:"access_token_expire_in"` RefreshToken string `json:"refresh_token"` RefreshTokenExpireIn int `json:"refresh_token_expire_in"` OpenID string `json:"open_id"` SellerName string `json:"seller_name"` }
type AttributeList ¶ added in v0.3.0
type AttributeList struct {
Attributes []Attribute `json:"attributes"`
}
type AttributeValue ¶ added in v0.4.5
type CancelOrderRequest ¶ added in v0.4.11
type CancelOrderResponse ¶ added in v0.4.11
type CancelOrderResponse struct {
ReverseMainOrderID int64 `json:"reverse_main_order_id"`
}
type CategoryList ¶ added in v0.3.0
type CategoryList struct {
CategoryList []Category `json:"category_list"`
}
type CategoryRule ¶ added in v0.3.0
type CategoryRule struct { ProductCertifications []ProductCertification `json:"product_certifications"` SupportSizeChart bool `json:"support_size_chart"` SupportCod bool `json:"support_cod"` ExemptionOfIdentifierCode ExemptionOfIdentifierCode `json:"exemption_of_identifier_code"` }
type CategoryRules ¶ added in v0.3.0
type CategoryRules struct {
CategoryRules []CategoryRule `json:"category_rules"`
}
type Certification ¶ added in v0.4.2
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client for tiktok
func (*Client) ActivateProduct ¶ added in v0.3.0
func (*Client) CancelOrder ¶ added in v0.4.11
func (c *Client) CancelOrder(ctx context.Context, p Param, req CancelOrderRequest) (resp CancelOrderResponse, err error)
CancelOrder to cancel the order.
func (*Client) ConfirmOrderSplit ¶ added in v0.4.0
func (c *Client) ConfirmOrderSplit(ctx context.Context, p Param, req ConfirmOrderSplitRequest) (data ConfirmOrderSplitData, err error)
func (*Client) ConfirmPreCombinePkg ¶ added in v0.4.0
func (c *Client) ConfirmPreCombinePkg(ctx context.Context, p Param, req ConfirmPreCombinePkgRequest) (data PreCombinePkgData, err error)
func (*Client) ConfirmReverse ¶ added in v0.3.0
func (*Client) CreateProduct ¶ added in v0.3.0
func (c *Client) CreateProduct(ctx context.Context, p Param, req CreateProductRequest) (product ProductData, err error)
func (*Client) DeactivateProducts ¶ added in v0.3.0
func (*Client) Delete ¶ added in v0.3.0
func (c *Client) Delete(ctx context.Context, path string, param url.Values, body interface{}, resp interface{}) (err error)
Delete request for TikTok requests. I don't known why there is body in delete request. Note: Timestamp, appkey and signature will auto-management by action.
func (*Client) DeleteProducts ¶ added in v0.3.0
func (*Client) EditProduct ¶ added in v0.3.0
func (c *Client) EditProduct(ctx context.Context, p Param, req EditProductRequest) (product ProductData, err error)
func (*Client) GenerateAuthURL ¶
GenerateAuthURL generate auth url for user to login. Doc: https://bytedance.feishu.cn/docs/doccnROmkE6WI9zFeJuT3DQ3YOg#ckvNFO
func (*Client) Get ¶
func (c *Client) Get(ctx context.Context, path string, param url.Values, resp interface{}) (err error)
Get request for TikTok requests. Note: Timestamp, appkey and signature will auto-management by action.
func (*Client) GetAccessToken ¶
func (c *Client) GetAccessToken(ctx context.Context, code string) (resp AccessTokenResponse, err error)
GetAccessToken get access token from tiktok server. Doc: https://bytedance.feishu.cn/docs/doccnROmkE6WI9zFeJuT3DQ3YOg#qYtWHF
func (*Client) GetAttribute ¶ added in v0.3.0
func (*Client) GetAuthorizedShop ¶
func (*Client) GetCategory ¶ added in v0.3.0
GetCategory WARN: DO NOT CACHE THIS FUNCTION RESULT.
func (*Client) GetCategoryRule ¶ added in v0.3.0
func (*Client) GetOrderDetail ¶
func (c *Client) GetOrderDetail(ctx context.Context, p Param, ordersID []string) (list OrderDetailList, err error)
GetOrderDetail get order detail.
func (*Client) GetOrderList ¶
func (c *Client) GetOrderList(ctx context.Context, p Param, query GetOrderListRequest) (list OrdersList, err error)
GetOrderList get order list. Default PageSize is 50.
func (*Client) GetOrderSettlements ¶
func (c *Client) GetOrderSettlements(ctx context.Context, p Param, ordersID string) (list SettlementsList, err error)
GetOrderSettlements get order settlements.
func (*Client) GetPackageDetail ¶ added in v0.4.0
func (c *Client) GetPackageDetail(ctx context.Context, p Param, req PackageIDRequest) (data GetPackageDetailData, err error)
func (*Client) GetPackagePickupConfig ¶ added in v0.4.0
func (c *Client) GetPackagePickupConfig(ctx context.Context, p Param, req PackageIDRequest) (data GetPackagePickupConfigData, err error)
func (*Client) GetPackageShippingDocument ¶ added in v0.4.0
func (c *Client) GetPackageShippingDocument(ctx context.Context, p Param, req GetPackageShippingDocumentRequest) (data GetPackageShippingDocumentData, err error)
func (*Client) GetPackageShippingInfo ¶ added in v0.4.0
func (c *Client) GetPackageShippingInfo(ctx context.Context, p Param, req PackageIDRequest) (data GetPackageShippingInfoData, err error)
func (*Client) GetProductDetail ¶ added in v0.3.0
func (*Client) GetProductList ¶ added in v0.3.0
func (c *Client) GetProductList(ctx context.Context, p Param, req ProductSearchRequest) (list GetProductListData, err error)
func (*Client) GetReverseList ¶ added in v0.3.0
func (c *Client) GetReverseList(ctx context.Context, p Param, query GetReverseListRequest) (list ReverseOrdersList, err error)
func (*Client) GetReverseReason ¶ added in v0.3.0
func (c *Client) GetReverseReason(ctx context.Context, p Param, req GetReverseReasonRequest) (list ReverseReasonList, err error)
func (*Client) GetShippingDocument ¶ added in v0.4.0
func (c *Client) GetShippingDocument(ctx context.Context, p Param, req GetShippingDocumentRequest) (data GetShippingDocumentData, err error)
func (*Client) GetShippingInfo ¶ added in v0.4.0
func (c *Client) GetShippingInfo(ctx context.Context, p Param, req OrderIDReq) (data LogisticsGetShippingInfoData, err error)
func (*Client) GetShippingProvider ¶ added in v0.4.0
func (*Client) GetSubscribedDelivery ¶ added in v0.4.1
func (c *Client) GetSubscribedDelivery(ctx context.Context, p Param, req GetSubscribedDeliveryRequest) (data GetSubscribedDeliveryData, err error)
func (*Client) GetWarehouseList ¶ added in v0.4.0
func (*Client) Post ¶
func (c *Client) Post(ctx context.Context, path string, param url.Values, body interface{}, resp interface{}) (err error)
Post request for TikTok requests. Note: Timestamp, appkey and signature will auto-management by action.
func (*Client) Put ¶ added in v0.3.0
func (c *Client) Put(ctx context.Context, path string, param url.Values, body interface{}, resp interface{}) (err error)
Put request for TikTok requests. Note: Timestamp, appkey and signature will auto-management by action.
func (*Client) RecoverProduct ¶ added in v0.3.0
func (*Client) RefreshToken ¶
RefreshToken refresh access token. Doc: https://bytedance.feishu.cn/docs/doccnROmkE6WI9zFeJuT3DQ3YOg#bG2h09
func (*Client) RejectReverse ¶ added in v0.3.0
func (*Client) RemovePackageOrder ¶ added in v0.4.0
func (c *Client) RemovePackageOrder(ctx context.Context, p Param, req RemovePackageOrderRequest) (data PreCombinePkgData, err error)
func (*Client) SearchPackage ¶ added in v0.4.0
func (c *Client) SearchPackage(ctx context.Context, p Param, req SearchPackageRequest) (data SearchPackageData, err error)
func (*Client) SearchPreCombinePkg ¶ added in v0.4.0
func (c *Client) SearchPreCombinePkg(ctx context.Context, p Param, req SearchPreCombinePkgRequest) (data SearchPreCombinePkgData, err error)
func (*Client) SearchSettlements ¶
func (c *Client) SearchSettlements(ctx context.Context, p Param, query SearchSettlementsRequest) (list SettlementsList, err error)
SearchSettlements search settlements. Default PageSize is 100.
func (*Client) SearchTransactions ¶
func (c *Client) SearchTransactions(ctx context.Context, p Param, query SearchTransactionsRequest) (list TransactionsList, err error)
SearchTransactions search your seller account's transactions within a certain timeframe. Default PageSize is 100.
func (*Client) ShipOrder ¶
func (c *Client) ShipOrder(ctx context.Context, p Param, req ShipOrderRequest) (code int, err error)
ShipOrder ship order.
func (*Client) ShipPackage ¶ added in v0.4.0
func (c *Client) ShipPackage(ctx context.Context, p Param, req ShipPackageRequest) (data ShipPackageData, err error)
func (*Client) UpdatePackageShippingInfo ¶ added in v0.4.0
func (c *Client) UpdatePackageShippingInfo(ctx context.Context, p Param, req UpdatePackageShippingInfoRequest) (data UpdatePackageShippingInfoData, err error)
func (*Client) UpdatePrice ¶ added in v0.3.0
func (c *Client) UpdatePrice(ctx context.Context, p Param, req UpdatePriceRequest) (list UpdatePriceData, err error)
func (*Client) UpdateShippingInfo ¶ added in v0.4.0
func (*Client) UpdateStock ¶ added in v0.3.0
func (c *Client) UpdateStock(ctx context.Context, p Param, req UpdateStockRequest) (list UpdateStockFailedSKU, err error)
func (*Client) UploadFile ¶ added in v0.3.0
func (*Client) UploadImgReader ¶ added in v0.3.0
func (*Client) VerifyOrderSplit ¶ added in v0.4.0
func (c *Client) VerifyOrderSplit(ctx context.Context, p Param, req VerifyOrderSplitRequest) (data VerifyOrderSplitData, err error)
type ConfirmOrderSplitData ¶ added in v0.4.0
type ConfirmOrderSplitData struct { ConfirmResultList []struct { PreSplitPkgID int `json:"pre_split_pkg_id"` ConfirmResult bool `json:"confirm_result"` } `json:"confirm_result_list"` SuccessList []struct { PreSplitPkgID int `json:"pre_split_pkg_id"` PackageID int `json:"package_id"` } `json:"success_list"` FailList []struct { PreSplitPkgID int64 `json:"pre_split_pkg_id"` FailReason string `json:"fail_reason"` } }
type ConfirmOrderSplitRequest ¶ added in v0.4.0
type ConfirmPreCombinePkgRequest ¶ added in v0.4.0
type CreateProductRequest ¶ added in v0.3.0
type CreateProductRequest struct { ProductName string `json:"product_name" validate:"required"` Description string `json:"description" validate:"required"` CategoryID string `json:"category_id" validate:"required"` BrandID string `json:"brand_id"` Images []ImgID `json:"images,omitempty"` WarrantyPeriod int `json:"warranty_period"` WarrantyPolicy string `json:"warranty_policy"` PackageLength int `json:"package_length"` PackageWidth int `json:"package_width"` PackageHeight int `json:"package_height"` PackageWeight string `json:"package_weight" validate:"required"` SizeChart SizePic `json:"size_chart"` ProductCertifications []ProductCertificationRequest `json:"product_certifications"` IsCodOpen bool `json:"is_cod_open"` Skus []SKU `json:"skus" validate:"required"` DeliveryServiceIDS []string `json:"delivery_service_ids,omitempty"` ProductAttributes []ProductAttr `json:"product_attributes,omitempty"` }
CreateProductRequest is creating product https://developers.tiktok-shops.com/documents/document/234547
type DeliveryService ¶ added in v0.4.2
type EditAttributes ¶ added in v0.4.1
type EditAttributes []struct { AttributeID string `json:"attribute_id"` AttributeName string `json:"attribute_name"` AttributeValues []AttributeValue `json:"attribute_values"` }
type EditProductCertifications ¶ added in v0.4.1
type EditProductRequest ¶ added in v0.3.0
type EditProductRequest struct { ProductID string `json:"product_id" validate:"required"` ProductName string `json:"product_name" validate:"required"` Description string `json:"description" validate:"required"` CategoryID string `json:"category_id" validate:"required"` BrandID string `json:"brand_id"` Images []ImgID `json:"images,omitempty"` WarrantyPeriod int `` /* 389-byte string literal not displayed */ WarrantyPolicy string `json:"warranty_policy"` PackageLength int `json:"package_length" example:"14. unit is cm"` PackageHeight int `json:"package_height" example:"14. unit is cm"` PackageWidth int `json:"package_width" example:"14. unit is cm"` PackageWeight string `json:"package_weight" validate:"required" example:"14. unit is cm"` SizeChart SizePic `json:"size_chart,omitempty"` Certifications EditProductCertifications `json:"product_certifications"` IsCodOpen bool `json:"is_cod_open,omitempty"` Skus []SKU `json:"skus"` DeliveryServiceIDS string `json:"delivery_service_ids"` Attribute EditAttributes `json:"product_attributes,omitempty"` }
EditProductRequest is edit product attributes https://developers.tiktok-shops.com/documents/document/234555
type ExemptionOfIdentifierCode ¶ added in v0.4.19
type ExemptionOfIdentifierCode struct {
SupportIdentifierCodeExemption bool `json:"support_identifier_code_exemption"`
}
type FailedProductIDs ¶ added in v0.3.0
type FailedProductIDs struct {
FailedProductIDs []string `json:"failed_product_ids"`
}
type FailedSKUStock ¶ added in v0.3.0
type FulfillmentPickUp ¶ added in v0.4.0
type GetAccessTokenRequest ¶
type GetOrderDetailRequest ¶
type GetOrderDetailRequest struct {
OrderIDList []string `json:"order_id_list"`
}
type GetOrderListRequest ¶
type GetOrderListRequest struct { CreateTimeFrom int `json:"create_time_from,omitempty"` CreateTimeTo int `json:"create_time_to,omitempty"` UpdateTimeFrom int `json:"update_time_from,omitempty"` UpdateTimeTo int `json:"update_time_to,omitempty"` OrderStatus int `json:"order_status,omitempty"` Cursor string `json:"cursor,omitempty"` SortType int `json:"sort_type,omitempty"` SortBy string `json:"sort_by,omitempty"` PageSize int `json:"page_size,omitempty"` }
type GetPackageDetailData ¶ added in v0.4.0
type GetPackageDetailData struct { PackageID int `json:"package_id"` OrderInfoList []struct { OrderID string `json:"order_id"` SkuList []struct { Quantity string `json:"quantity"` SkuID string `json:"sku_id"` SkuImage string `json:"sku_image"` SkuName string `json:"sku_name"` } `json:"sku_list"` } `json:"order_info_list"` PackageStatus int `json:"package_status"` PackageFreezeStatus int `json:"package_freeze_status"` ScTag int `json:"sc_tag"` PrintTag int `json:"print_tag"` SkuTag int `json:"sku_tag"` NoteTag int `json:"note_tag"` DeliveryOption int `json:"delivery_option"` ShippingProvider string `json:"shipping_provider"` ShippingProviderID string `json:"shipping_provider_id"` TrackingNumber string `json:"tracking_number"` PickUpType int `json:"pick_up_type"` PickUpStartTime int `json:"pick_up_start_time"` PickUpEndTime int `json:"pick_up_end_time"` CreateTime int `json:"create_time"` UpdateTime int `json:"update_time"` OrderLineIDList []string `json:"order_line_id_list"` }
type GetPackagePickupConfigData ¶ added in v0.4.0
type GetPackagePickupConfigData struct { IsPickUp bool `json:"is_pick_up"` IsDropOff bool `json:"is_drop_off"` PickUpTimeList []struct { StartTime string `json:"start_time"` EndTime string `json:"end_time"` Available bool `json:"available"` } `json:"pick_up_time_list"` DropOffPointURL string `json:"drop_off_point_url"` }
type GetPackageShippingDocumentData ¶ added in v0.4.0
type GetPackageShippingDocumentData struct {
DocURL string `json:"doc_url"`
}
type GetPackageShippingDocumentRequest ¶ added in v0.4.0
type GetPackageShippingInfoData ¶ added in v0.4.0
type GetProductListData ¶ added in v0.4.1
type GetProductListData struct { Products []ProductItem `json:"products"` Total int `json:"total"` }
type GetReverseListRequest ¶ added in v0.3.0
type GetReverseListRequest struct { UpdateTimeFrom int `json:"update_time_from,omitempty"` UpdateTimeTo int `json:"update_time_to,omitempty"` ReverseType int `json:"reverse_type,omitempty" example:"REFUND_ONLY = 2 RETURN_AND_REFUND = 3 REQUEST_CANCEL = 4"` SortBy int `json:"sort_by,omitempty" example:"REQUEST_TIME=0(default) UPDATE_TIME=1 REFUND_TOTAL=2"` SortType int `json:"sort_type,omitempty" example:"ASC=0 DESC=1(default)"` Offset int `json:"offset" validate:"min=0"` Size int `json:"size" validate:"required,min=1,max=100"` ReverseOrderStatus int `json:"reverse_order_status,omitempty"` OrderID int `json:"order_id,omitempty"` ReverseOrderID int `json:"reverse_order_id,omitempty"` }
type GetReverseReasonRequest ¶ added in v0.3.0
type GetShippingDocumentData ¶ added in v0.4.0
type GetShippingDocumentData struct {
DocURL string `json:"doc_url"`
}
type GetShippingDocumentRequest ¶ added in v0.4.0
type GetShippingProviderData ¶ added in v0.4.0
type GetShippingProviderData struct { DeliveryOptionList []struct { DeliveryOptionID string `json:"delivery_option_id"` DeliveryOptionName string `json:"delivery_option_name"` ItemWeightLimit struct { MaxWeight int `json:"max_weight"` MinWeight int `json:"min_weight"` } `json:"item_weight_limit"` ItemDimensionLimit struct { Length int `json:"length"` Width int `json:"width"` Height int `json:"height"` } `json:"item_dimension_limit"` ShippingProviderList []struct { ShippingProviderID string `json:"shipping_provider_id"` ShippingProviderName string `json:"shipping_provider_name"` } `json:"shipping_provider_list"` } `json:"delivery_option_list"` }
type GetSubscribedDeliveryData ¶ added in v0.4.1
type GetSubscribedDeliveryData struct { WarehouseList []struct { WarehouseDelivery []struct { DeliveryOption string `json:"delivery_option"` ServiceID string `json:"service_id"` ServiceName string `json:"service_name"` } `json:"warehouse_delivery"` WarehouseID string `json:"warehouse_id"` } `json:"warehouse_list"` }
type GetSubscribedDeliveryRequest ¶ added in v0.4.1
type GetSubscribedDeliveryRequest struct {
WarehouseIDList []string `json:"warehouse_id_list"`
}
type GetWarehouseListData ¶ added in v0.4.0
type GetWarehouseListData struct { WarehouseList []struct { WarehouseID string `json:"warehouse_id"` WarehouseName string `json:"warehouse_name"` WarehouseType int `json:"warehouse_type"` WarehouseSubType int `json:"warehouse_sub_type"` WarehouseEffectStatus int `json:"warehouse_effect_status"` WarehouseAddress struct { Region string `json:"region"` State string `json:"state"` City string `json:"city"` District string `json:"district"` Town string `json:"town"` FullAddress string `json:"full_address"` Zipcode string `json:"zipcode"` Phone string `json:"phone"` ContactPerson string `json:"contact_person"` } `json:"warehouse_address"` } `json:"warehouse_list"` }
type Item ¶
type Item struct { SkuID string `json:"sku_id"` ProductID string `json:"product_id"` SkuName string `json:"sku_name"` Quantity int `json:"quantity"` SellerSku string `json:"seller_sku"` ProductName string `json:"product_name"` SkuImage string `json:"sku_image"` SkuOriginalPrice float64 `json:"sku_original_price"` SkuSalePrice float64 `json:"sku_sale_price"` SkuPlatformDiscount float64 `json:"sku_platform_discount"` SkuSellerDiscount float64 `json:"sku_seller_discount"` SkuExtStatus int `json:"sku_ext_status"` SkuDisplayStatus int `json:"sku_display_status"` SkuCancelReason string `json:"sku_cancel_reason"` SkuCancelUser string `json:"sku_cancel_user"` SkuRtsTime int `json:"sku_rts_time"` SkuType int `json:"sku_type"` }
type LogisticsGetShippingInfoData ¶ added in v0.4.0
type Option ¶
type Option func(o *option)
func WithEndpoint ¶ added in v0.4.19
WithEndpoint setup endpoint for request. TikTok is not support sandbox mode yet, but it will be lauching soon. You can also use this for mocking purpose.
func WithHTTPClient ¶
func WithHTTPClient(c HTTPClient) Option
WithHTTPClient setup HTTPClient with given client.
func WithLogger ¶
WithLogger setup logger for debug perporse. Default Logger will be discard.
type OrderDetail ¶
type OrderDetail struct { OrderID string `json:"order_id"` OrderStatus int `json:"order_status"` PaymentMethod string `json:"payment_method"` DeliveryOption string `json:"delivery_option"` ShippingProvider string `json:"shipping_provider"` ShippingProviderID string `json:"shipping_provider_id"` CreateTime string `json:"create_time"` PaidTime int64 `json:"paid_time"` BuyerMessage string `json:"buyer_message"` PaymentInfo PaymentInfo `json:"payment_info,omitempty"` RecipientAddress RecipientAddress `json:"recipient_address,omitempty"` ItemList []Item `json:"item_list,omitempty"` CancelReason string `json:"cancel_reason"` CancelUser string `json:"cancel_user"` ExtStatus int `json:"ext_status"` OrderStatusOld string `json:"order_status_old"` TrackingNumber string `json:"tracking_number"` RtsTime int `json:"rts_time"` RtsSLA int `json:"rts_sla"` TtsSLA int `json:"tts_sla"` CancelOrderSLA int `json:"cancel_order_sla"` UpdateTime int `json:"update_time"` PackageList []OrderPackage `json:"package_list"` ReceiverAddressUpdated int `json:"receiver_address_updated"` BuyerUID string `json:"buyer_uid"` SplitOrCombineTag string `json:"split_or_combine_tag"` FulfillmentType int `json:"fulfillment_type"` SellerNote string `json:"seller_note"` OrderLineList []OrderLineList `json:"order_line_list"` }
type OrderDetailList ¶
type OrderDetailList struct {
OrderList []OrderDetail `json:"order_list"`
}
type OrderIDReq ¶ added in v0.4.0
type OrderIDReq struct {
OrderID string `json:"order_id" url:"order_id,omitempty" validate:"required"`
}
type OrderLineList ¶
type OrderPackage ¶ added in v0.4.4
type OrderPackage struct {
PackageID string `json:"package_id"`
}
type OrdersList ¶
type PackageIDRequest ¶ added in v0.4.0
type PackageIDRequest struct {
PackageID string `json:"package_id" url:"package_id,omitempty" validate:"required"`
}
type PaymentInfo ¶
type PaymentInfo struct { Currency string `json:"currency"` SubTotal float64 `json:"sub_total"` ShippingFee float64 `json:"shipping_fee"` SellerDiscount float64 `json:"seller_discount"` PlatformDiscount float64 `json:"platform_discount"` TotalAmount float64 `json:"total_amount"` OriginalTotalProductPrice float64 `json:"original_total_product_price"` OriginalShippingFee float64 `json:"original_shipping_fee"` ShippingFeeSellerDiscount float64 `json:"shipping_fee_seller_discount"` ShippingFeePlatformDiscount float64 `json:"shipping_fee_platform_discount"` Taxes float64 `json:"taxes"` }
type Pickup ¶
type Pickup struct {
SelfShipment SelfShipment `json:"self_shipment"`
}
type PreCombinePkgData ¶ added in v0.4.0
type PreCombinePkgData struct { PackageList []struct { PackageID string `json:"package_id"` OrderIDList []string `json:"order_id_list"` } `json:"package_list"` FailedPackageList []struct { PackageID string `json:"package_id"` Code int `json:"code"` Message string `json:"message"` } `json:"failed_package_list"` }
type ProductAttr ¶ added in v0.4.6
type ProductAttr struct { AttributeID string `json:"attribute_id"` AttributeName string `json:"attribute_name"` AttributeValues []AttributeValue `json:"attribute_values"` }
type ProductAttribute ¶ added in v0.4.2
type ProductCertification ¶ added in v0.3.0
type ProductCertificationRequest ¶ added in v0.3.0
type ProductData ¶ added in v0.4.1
type ProductData struct { ProductID string `json:"product_id"` ProductStatus int `json:"product_status"` // 1-draft、2-pending、3-failed(initial creation)、4-live、5-seller_deactivated、6-platform_deactivated、7-freeze 8-deleted ProductName string `json:"product_name"` CategoryList []Category `json:"category_list"` Brand Brand `json:"brand"` Images []Image `json:"images"` Video Video `json:"video"` Description string `json:"description"` WarrantyPeriod WarrantyPeriod `json:"warranty_period"` WarrantyPolicy string `json:"warranty_policy"` PackageHeight int `json:"package_height"` PackageLength int `json:"package_length"` PackageWidth int `json:"package_width"` PackageWeight string `json:"package_weight"` Skus []SKUData `json:"skus"` ProductCertifications []Certification `json:"product_certifications"` SizeChart Image `json:"size_chart"` IsCodOpen bool `json:"is_cod_open"` ProductAttributes []ProductAttribute `json:"product_attributes"` QcReasons []QCReason `json:"qc_reasons"` UpdateTime int64 `json:"update_time"` CreateTime int64 `json:"create_time"` DeliveryServices []DeliveryService `json:"delivery_services"` }
type ProductItem ¶ added in v0.4.5
type ProductSearchRequest ¶ added in v0.3.0
type ProductSearchRequest struct { PageSize int `json:"page_size" validate:"min=1,max=100"` PageNumber int `json:"page_number" validate:"min=1"` SearchStatus int `json:"search_status,omitempty"` SellerSkuList []string `json:"seller_sku_list,omitempty"` UpdateTimeFrom int64 `json:"update_time_from,omitempty"` UpdateTimeTo int64 `json:"update_time_to,omitempty"` CreateTimeFrom int64 `json:"create_time_from,omitempty" ` CreateTimeTo int64 `json:"create_time_to,omitempty"` }
type RecipientAddress ¶
type RecipientAddress struct { FullAddress string `json:"full_address"` Region string `json:"region"` State string `json:"state"` City string `json:"city"` District string `json:"district"` Town string `json:"town"` Phone string `json:"phone"` Name string `json:"name"` Zipcode string `json:"zipcode"` AddressDetail string `json:"address_detail"` AddressLineList []string `json:"address_line_list"` RegionCode string `json:"region_code"` }
type RefreshTokenRequest ¶
type RejectReverseRequest ¶ added in v0.3.0
type RemovePackageOrderRequest ¶ added in v0.4.0
type Response ¶
type Response struct { Code int `json:"code"` Message string `json:"message"` RequestID string `json:"request_id"` Data json.RawMessage `json:"data"` }
type ReturnItem ¶ added in v0.3.0
type ReturnItem struct { ReturnProductID string `json:"return_product_id"` ReturnProductName string `json:"return_product_name"` SkuID string `json:"sku_id"` SellerSku string `json:"seller_sku"` SkuName string `json:"sku_name"` ReturnQuantity int `json:"return_quantity"` ProductImages string `json:"product_images"` }
type Reverse ¶ added in v0.3.0
type Reverse struct { ReverseOrderID string `json:"reverse_order_id"` OrderID string `json:"order_id"` RefundTotal string `json:"refund_total"` Currency string `json:"currency"` ReverseType int `json:"reverse_type"` ReturnReason string `json:"return_reason"` ReturnItemList []ReturnItem `json:"return_item_list"` ReverseStatusValue int `json:"reverse_status_value"` ReverseRequestTime int `json:"reverse_request_time"` ReverseUpdateTime int `json:"reverse_update_time"` ReturnTrackingID string `json:"return_tracking_id"` ReverseRecordList []ReverseRecord `json:"reverse_record_list"` }
type ReverseOrdersList ¶ added in v0.3.0
type ReverseReason ¶ added in v0.3.0
type ReverseReasonList ¶ added in v0.3.0
type ReverseReasonList struct {
ReverseReasonList []ReverseReason `json:"reverse_reason_list"`
}
type ReverseRecord ¶ added in v0.4.11
type SKU ¶ added in v0.3.0
type SKU struct { ID string `json:"id,omitempty"` SalesAttributes []SalesAttribute `json:"sales_attributes,omitempty"` StockInfos []StockInfo `json:"stock_infos,omitempty"` SellerSku string `json:"seller_sku,omitempty"` OriginalPrice string `json:"original_price,omitempty"` }
type SKUPriceItem ¶ added in v0.4.5
type SalesAttribute ¶ added in v0.3.0
type SearchPackageData ¶ added in v0.4.0
type SearchPackageData struct { More bool `json:"more"` NextCursor string `json:"next_cursor"` PackageList []struct { PackageID string `json:"package_id"` PackageStatus int `json:"package_status"` CreateTime int64 `json:"create_time"` UpdateTime int64 `json:"update_time"` } `json:"package_list"` Total int `json:"total"` }
type SearchPackageRequest ¶ added in v0.4.0
type SearchPackageRequest struct { CreateTimeFrom int64 `json:"create_time_from,omitempty" ` CreateTimeTo int64 `json:"create_time_to,omitempty"` UpdateTimeFrom int64 `json:"update_time_from,omitempty"` UpdateTimeTo int64 `json:"update_time_to,omitempty"` PackageStatus int `json:"package_status,omitempty"` Cursor string `json:"cursor,omitempty"` SortBy int `` /* 139-byte string literal not displayed */ SortType int `json:"sort_type,omitempty" validate:"omitempty,oneof=1 2" example:"ASC = 1 DESC = 2"` PageSize int `json:"page_size,omitempty" validate:"min=1,max=50"` }
type SearchPreCombinePkgData ¶ added in v0.4.0
type SearchPreCombinePkgRequest ¶ added in v0.4.0
type SearchSettlementsRequest ¶
type SearchSettlementsRequest struct { RequestTimeFrom int `json:"request_time_from,omitempty"` RequestTimeTo int `json:"request_time_to,omitempty"` PageSize int `json:"page_size" validate:"required,min=1,max=100"` Cursor string `json:"cursor,omitempty"` SortType int `json:"sort_type" validate:"required" example:"Available values: 1 (DESC), 2 (ASC) Default value 1"` }
type SearchTransactionsRequest ¶
type SearchTransactionsRequest struct { RequestTimeFrom int `json:"request_time_from,omitempty"` RequestTimeTo int `json:"request_time_to,omitempty"` TransactionType []int `json:"transaction_type" validate:"required,min=1" example:"Withdraw:1 Settle:2 Transfer:3 Reverse:4"` PageSize int `json:"page_size" validate:"required,min=1,max=100" ` Offset int `json:"offset" validate:"gte=0,lte=10000"` }
type SelfShipment ¶
type Settlement ¶
type Settlement struct { UniqueKey int64 `json:"unique_key"` OrderID string `json:"order_id"` AdjustmentID string `json:"adjustment_id"` RelatedOrderID string `json:"related_order_id"` SkuID string `json:"sku_id"` SkuName string `json:"sku_name"` ProductName string `json:"product_name"` SettlementInfo SettlementInfo `json:"settlement_info"` }
type SettlementInfo ¶
type SettlementInfo struct { SettlementTime int `json:"settlement_time"` Currency string `json:"currency"` UserPay string `json:"user_pay"` PlatformPromotion string `json:"platform_promotion"` Refund string `json:"refund"` PaymentFee string `json:"payment_fee"` PlatformCommission string `json:"platform_commission"` AffiliateCommission string `json:"affiliate_commission"` Vat string `json:"vat"` ShippingFee string `json:"shipping_fee"` SettlementAmount string `json:"settlement_amount"` }
type SettlementsList ¶
type SettlementsList struct { More bool `json:"more"` NextCursor string `json:"next_cursor"` SettlementList []Settlement `json:"settlement_list"` }
type ShipOrderRequest ¶
type ShipPackageData ¶ added in v0.4.0
type ShipPackageRequest ¶ added in v0.4.0
type ShipPackageRequest struct { PackageID string `json:"package_id"` PickUpType int `json:"pick_up_type"` PickUp struct { PickUpStartTime int `json:"pick_up_start_time"` PickUpEndTime int `json:"pick_up_end_time"` } `json:"pick_up"` SelfShipment *struct { TrackingNumber string `json:"tracking_number"` ShippingProviderID string `json:"shipping_provider_id"` } `json:"self_shipment,omitempty"` }
type SizePic ¶ added in v0.4.6
type SizePic struct {
ImgID string `json:"img_id" validate:"required"`
}
type SkuStockItem ¶ added in v0.4.5
type Transaction ¶
type TransactionsList ¶
type TransactionsList struct { More bool `json:"more"` Total int `json:"total"` TransactionList []Transaction `json:"transaction_list"` }
type UpdatePackageShippingInfoData ¶ added in v0.4.0
type UpdatePackageShippingInfoRequest ¶ added in v0.4.0
type UpdatePriceData ¶ added in v0.4.1
type UpdatePriceData struct {
FailedSKUIDs []string `json:"failed_sku_ids"`
}
type UpdatePriceRequest ¶ added in v0.3.0
type UpdatePriceRequest struct { ProductID string `json:"product_id" validate:"required"` Skus []SKUPriceItem `json:"skus" validate:"min=1"` }
type UpdateShippingInfoReq ¶ added in v0.4.0
type UpdateStockFailedSKU ¶ added in v0.3.0
type UpdateStockFailedSKU struct {
FailedSKUs []FailedSKUStock `json:"failed_skus"`
}
type UpdateStockRequest ¶ added in v0.3.0
type UpdateStockRequest struct { ProductID string `json:"product_id"` Skus []SkuStockItem `json:"skus"` }
type VerifyOrderSplitData ¶ added in v0.4.0
type VerifyOrderSplitRequest ¶ added in v0.4.0
type VerifyOrderSplitRequest struct {
OrderIDList []int64 `json:"order_id_list" validate:"required,min=1,max=50"`
}
type VideoInfo ¶ added in v0.4.2
type VideoInfo struct { BackupUrl string `json:"backup_url"` Bitrate int `json:"bitrate"` FileHash string `json:"file_hash"` Format string `json:"format"` Height int `json:"height"` MainUrl string `json:"main_url"` Size int `json:"size"` UrlExpire int64 `json:"url_expire"` Width int `json:"width"` }