1403 lines
33 KiB
TypeScript
1403 lines
33 KiB
TypeScript
// Shopyy 平台原始数据类型定义
|
||
// 仅包含当前映射逻辑所需字段以保持简洁与类型安全
|
||
export interface ShopyyTag {
|
||
id?: number;
|
||
name?: string;
|
||
}
|
||
export interface ShopyyProductQuery {
|
||
page: string;
|
||
limit: string;
|
||
}
|
||
/**
|
||
* Shopyy 全量商品查询参数类
|
||
* 用于封装获取 Shopyy 商品列表时的各种筛选和分页条件
|
||
* 参考文档: https://www.apizza.net/project/e114fb8e628e0f604379f5b26f0d8330/browse
|
||
*/
|
||
export class ShopyyAllProductQuery {
|
||
/** 分页大小,限制返回的商品数量 */
|
||
limit?: string;
|
||
/** 起始ID,用于分页,返回ID大于该值的商品 */
|
||
since_id?: string;
|
||
/** 商品ID,精确匹配单个商品 */
|
||
id?: string;
|
||
/** 商品标题,支持模糊查询 */
|
||
title?: string;
|
||
/** 商品状态,例如:上架、下架、删除等(具体值参考 Shopyy 接口文档) */
|
||
status?: string;
|
||
/** 商品SKU编码,库存保有单位,精确或模糊匹配 */
|
||
sku?: string;
|
||
/** 商品SPU编码,标准化产品单元,用于归类同款商品 */
|
||
spu?: string;
|
||
/** 商品分类ID,筛选指定分类下的商品 */
|
||
collection_id?: string;
|
||
/** 变体价格最小值,筛选变体价格大于等于该值的商品 */
|
||
variant_price_min?: string;
|
||
/** 变体价格最大值,筛选变体价格小于等于该值的商品 */
|
||
variant_price_max?: string;
|
||
/** 变体划线价(原价)最小值,筛选变体划线价大于等于该值的商品 */
|
||
variant_compare_at_price_min?: string;
|
||
/** 变体划线价(原价)最大值,筛选变体划线价小于等于该值的商品 */
|
||
variant_compare_at_price_max?: string;
|
||
/** 变体重量最小值,筛选变体重量大于等于该值的商品(单位参考接口文档) */
|
||
variant_weight_min?: string;
|
||
/** 变体重量最大值,筛选变体重量小于等于该值的商品(单位参考接口文档) */
|
||
variant_weight_max?: string;
|
||
/** 商品创建时间最小值,格式参考接口文档(如:YYYY-MM-DD HH:mm:ss) */
|
||
created_at_min?: string;
|
||
/** 商品创建时间最大值,格式参考接口文档(如:YYYY-MM-DD HH:mm:ss) */
|
||
created_at_max?: string;
|
||
/** 商品更新时间最小值,格式参考接口文档(如:YYYY-MM-DD HH:mm:ss) */
|
||
updated_at_min?: string;
|
||
/** 商品更新时间最大值,格式参考接口文档(如:YYYY-MM-DD HH:mm:ss) */
|
||
updated_at_max?: string;
|
||
}
|
||
export interface ShopyyCollection {
|
||
id?: number;
|
||
title?: string;
|
||
}
|
||
// 产品类型
|
||
export interface ShopyyProduct {
|
||
// ========================================
|
||
// 基本信息
|
||
// ========================================
|
||
// 产品主键ID
|
||
id: number;
|
||
// 产品名称
|
||
name?: string;
|
||
// 产品标题
|
||
title?: string;
|
||
// 产品类型
|
||
product_type?: string | number;
|
||
// 产品状态数值 1为发布 其他为草稿
|
||
status: number;
|
||
// ========================================
|
||
// 价格信息
|
||
// ========================================
|
||
// 产品原价
|
||
price?: string;
|
||
// 产品特价
|
||
special_price?: string;
|
||
|
||
|
||
// ========================================
|
||
// 库存信息
|
||
// ========================================
|
||
// 库存追踪标识 1表示跟踪
|
||
inventory_tracking?: number;
|
||
// 库存数量
|
||
inventory_quantity?: number;
|
||
|
||
// ========================================
|
||
// 图片信息
|
||
// ========================================
|
||
// 主图信息
|
||
image?: {
|
||
// 图片URL
|
||
src: string;
|
||
// 图片文件名
|
||
file_name?: string;
|
||
// 图片描述
|
||
alt?: string;
|
||
// 图片文件大小
|
||
file_size?: number;
|
||
// 图片宽度
|
||
width?: number;
|
||
// 图片高度
|
||
height?: number;
|
||
// 图片ID
|
||
id?: number;
|
||
// 图片位置
|
||
position?: number | string;
|
||
// 图片文件类型
|
||
file_type?: string;
|
||
};
|
||
// 图片列表
|
||
images?: Array<{
|
||
// 图片ID
|
||
id?: number;
|
||
// 图片URL
|
||
src: string;
|
||
// 图片描述
|
||
alt?: string;
|
||
// 图片位置
|
||
position?: string | number;
|
||
}>;
|
||
|
||
// ========================================
|
||
// 分类信息
|
||
// ========================================
|
||
// 产品标签列表
|
||
tags?: ShopyyTag[];
|
||
// 产品分类集合
|
||
collections?: ShopyyCollection[];
|
||
|
||
// ========================================
|
||
// 变体信息
|
||
// ========================================
|
||
// 单个变体信息
|
||
variant?: ShopyyVariant;
|
||
// 变体列表
|
||
variants?: ShopyyVariant[];
|
||
|
||
// ========================================
|
||
// 选项信息
|
||
// ========================================
|
||
// 规格选项列表
|
||
options?: Array<{
|
||
// 选项ID
|
||
id?: number;
|
||
// 选项位置
|
||
position?: number | string;
|
||
// 选项名称
|
||
option_name?: string;
|
||
// 选项值列表
|
||
values?: Array<{
|
||
// 选项值
|
||
option_value?: string;
|
||
// 选项值ID
|
||
id?: number;
|
||
// 选项值位置
|
||
position?: number;
|
||
}>;
|
||
}>;
|
||
|
||
// ========================================
|
||
// 发布信息
|
||
// ========================================
|
||
// 产品发布时间
|
||
published_at?: string;
|
||
// 产品唯一标识(URL友好)
|
||
handle?: string;
|
||
// 产品SPU编码(标准化产品单元)
|
||
spu?: string;
|
||
|
||
// ========================================
|
||
// 时间戳信息
|
||
// ========================================
|
||
// 产品创建时间
|
||
created_at?: string | number;
|
||
// 产品更新时间
|
||
updated_at?: string | number;
|
||
}
|
||
|
||
// 商品变体接口(用于更新)
|
||
export interface ShopyyProductVariant {
|
||
id?: number; // 变体ID
|
||
option1_title?: string; // 选项1名称
|
||
option2_title?: string; // 选项2名称
|
||
option3_title?: string; // 选项3名称
|
||
option1_value_title?: string; // 选项1值
|
||
option2_value_title?: string; // 选项2值
|
||
option3_value_title?: string; // 选项3值
|
||
image_id?: number; // 图片ID
|
||
src?: string; // 图片URL
|
||
title?: string; // 变体标题
|
||
barcode?: string; // 条形码
|
||
sku?: string; // 库存单位
|
||
inventory_quantity?: number; // 库存数量
|
||
price?: string; // 价格
|
||
compare_at_price?: string; // 比较价格
|
||
weight?: string; // 重量
|
||
}
|
||
|
||
// 商品图片接口(用于更新)
|
||
export interface ShopyyProductImage {
|
||
image_id?: number; // 图片ID
|
||
src?: string; // 图片URL
|
||
alt?: string; // 图片替代文本
|
||
}
|
||
|
||
// 选项值接口(用于更新)
|
||
export interface ShopyyProductOptionValue {
|
||
id?: number; // 选项值ID
|
||
option_id?: number; // 所属选项ID
|
||
option_value?: string; // 选项值
|
||
}
|
||
|
||
// 商品选项接口(用于更新)
|
||
export interface ShopyyProductOption {
|
||
id?: number; // 选项ID
|
||
option_name?: string; // 选项名称
|
||
values?: ShopyyProductOptionValue[]; // 选项值列表
|
||
}
|
||
|
||
// 商品分类接口(用于更新)
|
||
export interface ShopyyProductCollection {
|
||
collection_id?: number; // 分类ID
|
||
}
|
||
|
||
// Shopyy商品更新参数接口
|
||
export interface ShopyyProductUpdateParams {
|
||
product_type?: string; // 商品类型
|
||
handle?: string; // 商品别名
|
||
spu?: string; // 商品编码
|
||
title?: string; // 商品标题
|
||
subtitle?: string; // 商品副标题
|
||
vendor?: string; // 供应商
|
||
meta_title?: string; // 元标题
|
||
meta_descript?: string; // 元描述
|
||
meta_keywords?: string[]; // 元关键词列表
|
||
inner_title?: string; // 内部名称
|
||
inventory_tracking?: number; // 库存跟踪(1:开启, 0:关闭)
|
||
spec_mode?: number; // 规格模式
|
||
mini_detail?: string; // 简要描述
|
||
free_shipping?: number; // 免运费(1:是, 0:否)
|
||
inventory_policy?: number; // 库存策略
|
||
taxable?: number; // 是否 taxable(1:是, 0:否)
|
||
virtual_sale_count?: number; // 虚拟销量
|
||
body_html?: string; // 商品详情HTML
|
||
status?: number; // 商品状态(1:上架, 0:下架)
|
||
variants?: ShopyyProductVariant[]; // 商品变体列表
|
||
images?: ShopyyProductImage[]; // 商品图片列表
|
||
options?: ShopyyProductOption[]; // 商品选项列表
|
||
tags?: string[]; // 商品标签列表
|
||
collections?: ShopyyProductCollection[]; // 商品分类列表
|
||
}
|
||
export interface ShopyyProductUpdateManyParams {
|
||
|
||
products: ({
|
||
id: number;
|
||
product
|
||
})[]
|
||
}
|
||
|
||
export interface ShopyyProductStockUpdateParams {
|
||
data: ({
|
||
sku: string;
|
||
sku_code: string;
|
||
inventory_quantity: number;
|
||
})[]
|
||
}
|
||
// 变体类型
|
||
export interface ShopyyVariant {
|
||
id: number;
|
||
title: string;
|
||
sku: string;
|
||
price?: number;
|
||
special_price?: string;
|
||
inventory_tracking?: number;
|
||
inventory_quantity?: number;
|
||
available: number;
|
||
barcode?: string;
|
||
weight?: number;
|
||
image_id?: number;
|
||
image?: { src: string; id?: number; file_name?: string; alt?: string; position?: number | string };
|
||
position?: number | string;
|
||
sku_code?: string;
|
||
// 补充字段
|
||
sku_value?: string;
|
||
updated_at?: number;
|
||
compare_at_price?: number;
|
||
option1_title?: string;
|
||
option1_value?: number;
|
||
created_at?: number;
|
||
option3_value?: number;
|
||
option2_value_title?: string;
|
||
option3?: number;
|
||
option1?: number;
|
||
option1_value_title?: string;
|
||
option2?: number;
|
||
ext2?: string;
|
||
ext1?: string;
|
||
option2_title?: string;
|
||
option3_value_title?: string;
|
||
option3_title?: string;
|
||
option2_value?: number;
|
||
}
|
||
//
|
||
// 订单查询参数类型
|
||
export interface ShopyyOrderQuery {
|
||
// 订单ID集合 多个ID用','联接 例:1,2,3
|
||
ids?: string;
|
||
// 订单状态 100 未完成;110 待处理;180 已完成(确认收货); 190 取消;
|
||
status?: string;
|
||
// 物流状态 300 未发货;310 部分发货;320 已发货;330(确认收货)
|
||
fulfillment_status?: string;
|
||
// 支付状态 200 待支付;210 支付中;220 部分支付;230 已支付;240 支付失败;250 部分退款;260 已退款 ;290 已取消;
|
||
financial_status?: string;
|
||
// 支付时间 下限值
|
||
pay_at_min?: string;
|
||
// 支付时间 上限值
|
||
pay_at_max?: string;
|
||
// 创建开始时间
|
||
created_at_min?: number;
|
||
// 创建结束时间
|
||
created_at_max?: number;
|
||
// 更新时间开始
|
||
updated_at_min?: string;
|
||
// 更新时间结束
|
||
updated_at_max?: string;
|
||
// 起始ID
|
||
since_id?: string;
|
||
// 页码
|
||
page?: string;
|
||
// 每页条数
|
||
limit?: string;
|
||
// 排序字段(默认id) id=订单ID updated_at=最后更新时间 pay_at=支付时间
|
||
order_field?: string;
|
||
// 排序方式(默认desc) desc=降序 asc=升序
|
||
order_by?: string;
|
||
// 订单列表类型
|
||
group?: string;
|
||
}
|
||
// 订单详情返回结果类型
|
||
export interface ShopyyGetOneOrderResult {
|
||
// 基本信息
|
||
id: number;
|
||
store_id: number;
|
||
order_number: string;
|
||
visitor_id: string;
|
||
checkout_token: string;
|
||
ip: string;
|
||
currency_rate: string;
|
||
currency_code: string;
|
||
status: number;
|
||
financial_status: number;
|
||
fulfillment_status: number;
|
||
current_subtotal_price: string;
|
||
current_shipping_price: string;
|
||
current_insurance_price: string;
|
||
current_tip_price: string;
|
||
current_tax_price: string;
|
||
current_total_price: string;
|
||
current_coupon_price: string;
|
||
current_payment_price: string;
|
||
current_promotion_price: string;
|
||
current_offer_price: string;
|
||
total_price: string;
|
||
total_weight: string;
|
||
total_num: number;
|
||
shipping_zone_plan_name: string;
|
||
payment_id: number;
|
||
payment_method: string;
|
||
coupon_code: string;
|
||
coupon_id: number;
|
||
promotion_id: number;
|
||
promotion_name: string;
|
||
source_device: string;
|
||
utm_source: string;
|
||
utm_medium: string;
|
||
landing_page: string;
|
||
cancelled_at: number;
|
||
cancel_reason: string;
|
||
latest_error_reason: string;
|
||
note: string;
|
||
admin_note: string;
|
||
paypal_seller_protection: string;
|
||
recart_mail_sended: number;
|
||
recart_mail_happened_at: number;
|
||
recart_mail_result: string;
|
||
domain: string;
|
||
closed_at: number;
|
||
delivery_at: number;
|
||
act_at: number;
|
||
pay_at: number;
|
||
updated_at: number;
|
||
created_at: number;
|
||
ext3: string;
|
||
ext4: string;
|
||
utm_term: string;
|
||
utm_campaign: string;
|
||
utm_content: string;
|
||
version: string;
|
||
submit_type: string;
|
||
additional_info: any[];
|
||
is_test: number;
|
||
financial_additional_status: number;
|
||
admin_id: number;
|
||
admin_name: string;
|
||
checkout_type: string;
|
||
payment_type: string;
|
||
user_id: number;
|
||
brand_id: number;
|
||
free_shipping_id: number;
|
||
free_shipping_plan_name: string;
|
||
free_shipping_price: string;
|
||
refund_status: number;
|
||
refund_price: string;
|
||
sys_payment_id: number;
|
||
|
||
// 交易信息
|
||
transaction: {
|
||
transaction_no: string;
|
||
amount: string;
|
||
payment_method: string;
|
||
merchant_account: string;
|
||
merchant_id: string;
|
||
note: string;
|
||
created_at: number;
|
||
updated_at: number;
|
||
admin_id: number;
|
||
admin_name: string;
|
||
};
|
||
|
||
// 商品列表
|
||
products: Array<{
|
||
id: number;
|
||
store_id: number;
|
||
order_id: number;
|
||
customer_id: number;
|
||
product_id: number;
|
||
variant_id: number;
|
||
product_title: string;
|
||
product_type: string;
|
||
variant_title: string;
|
||
spu: string;
|
||
sku: string;
|
||
sku_code: string;
|
||
sku_value: string;
|
||
vendor: string;
|
||
src: string;
|
||
price: string;
|
||
discount_price: string;
|
||
tax_price: string;
|
||
weight: string;
|
||
quantity: number;
|
||
taxable: number;
|
||
note: string;
|
||
data_from: string;
|
||
created_at: number;
|
||
updated_at: number;
|
||
barcode: string;
|
||
property_md5: string;
|
||
promotion_id: number;
|
||
promotion_name: string;
|
||
diy_offer_id: number;
|
||
diy_offer_name: string;
|
||
inner_title: string;
|
||
spm: string;
|
||
property: any[];
|
||
refund_price: string;
|
||
available_refund_quantity: number;
|
||
gift_tip: string;
|
||
data_from_text: string;
|
||
product_detail_url: string;
|
||
}>;
|
||
|
||
// 配送地址
|
||
shipping_address: {
|
||
id: number;
|
||
phone: string;
|
||
first_name: string;
|
||
last_name: string;
|
||
country_name: string;
|
||
country_id: number;
|
||
country_code: string;
|
||
province: string;
|
||
province_code: string;
|
||
province_id: number;
|
||
city: string;
|
||
area: string;
|
||
address1: string;
|
||
address2: string;
|
||
zip: string;
|
||
company: string;
|
||
tel_area_code: string;
|
||
};
|
||
|
||
// 账单地址
|
||
bill_address: {
|
||
id: number;
|
||
phone: string;
|
||
first_name: string;
|
||
last_name: string;
|
||
country_name: string;
|
||
country_code: string;
|
||
province_code: string;
|
||
province: string;
|
||
city: string;
|
||
area: string;
|
||
address1: string;
|
||
address2: string;
|
||
zip: string;
|
||
company: string;
|
||
name: string;
|
||
country_id: number;
|
||
province_id: number;
|
||
tel_area_code: string;
|
||
};
|
||
|
||
// 客户系统信息
|
||
customer_sysinfo: {
|
||
os: string;
|
||
timezone: string;
|
||
browser: string;
|
||
language: string;
|
||
screen_size: string;
|
||
ip: string;
|
||
user_agent: string;
|
||
viewport_size: string;
|
||
date_time: string;
|
||
cookies: string;
|
||
};
|
||
|
||
// 客户信息
|
||
customer: {
|
||
country_code: string;
|
||
first_pay_at: number;
|
||
visit_at: number;
|
||
total_spent: string;
|
||
orders_count: number;
|
||
tags: string[];
|
||
note: string;
|
||
contact: string;
|
||
};
|
||
|
||
// 订单优惠列表
|
||
order_offer_list: Array<{
|
||
id: number;
|
||
store_id: number;
|
||
order_id: number;
|
||
params: string;
|
||
title: string;
|
||
price: string;
|
||
key_name: string;
|
||
values: string;
|
||
descript: string;
|
||
from_id: number;
|
||
from_name: string;
|
||
created_at: number;
|
||
updated_at: number;
|
||
}>;
|
||
|
||
// IP详细信息
|
||
ip_detail: {
|
||
continent_code: string;
|
||
continent_name: string;
|
||
country_code: string;
|
||
country_name: string;
|
||
province_code: string;
|
||
province_name: string;
|
||
city_name: string;
|
||
street_name: string;
|
||
latitude: number;
|
||
longitude: number;
|
||
time_zone: string;
|
||
isp: string;
|
||
organization: string;
|
||
user_type: string;
|
||
asNumber: number;
|
||
asName: string;
|
||
};
|
||
|
||
// 物流信息
|
||
fulfillments: Array<{
|
||
id: number;
|
||
tracking_company: string;
|
||
tracking_number: string;
|
||
created_at: number;
|
||
courier_code: string;
|
||
courier_id: number;
|
||
note: string;
|
||
payment_tracking_status: number;
|
||
payment_tracking_at: number;
|
||
payment_tracking_result: string;
|
||
type: number;
|
||
}>;
|
||
|
||
// 物流商品信息
|
||
fulfillment_products: Array<{
|
||
id: number;
|
||
store_id: number;
|
||
order_id: number;
|
||
order_product_id: number;
|
||
product_id: number;
|
||
variant_id: number;
|
||
fulfillment_id: number;
|
||
quantity: number;
|
||
created_at: number;
|
||
updated_at: number;
|
||
}>;
|
||
|
||
// 退款信息
|
||
refunds: any[];
|
||
}
|
||
|
||
export interface ShopyyOrderCreateParams { }
|
||
export interface ShopyyOrderUpdateParams { }
|
||
// 订单类型
|
||
export interface ShopyyOrder {
|
||
// ========================================
|
||
// 基本信息
|
||
// ========================================
|
||
// 订单主键ID
|
||
id?: number;
|
||
// 订单外部ID
|
||
order_id?: number;
|
||
// 订单唯一标识ID
|
||
_id?: string;
|
||
// 订单号
|
||
order_number?: string;
|
||
// 订单序列号
|
||
order_sn?: string;
|
||
// 订单总商品数量
|
||
total_num?: number;
|
||
// 订单总重量
|
||
total_weight?: number;
|
||
|
||
// ========================================
|
||
// 状态信息
|
||
// ========================================
|
||
// 订单状态
|
||
status?: number | string;
|
||
// 订单状态(备用)
|
||
order_status?: number | string;
|
||
// 订单关闭时间
|
||
closed_at?: number;
|
||
// 订单取消时间
|
||
cancelled_at?: number;
|
||
// 订单取消原因
|
||
cancel_reason?: string;
|
||
// 测试订单标识
|
||
is_test?: number;
|
||
|
||
// ========================================
|
||
// 币种与金额
|
||
// ========================================
|
||
// 货币代码
|
||
currency_code?: string;
|
||
// 货币类型
|
||
currency?: string;
|
||
// 货币汇率
|
||
currency_rate?: string | number;
|
||
// 订单总金额
|
||
total_price?: string | number;
|
||
// 订单总金额(备用)
|
||
total_amount?: string | number;
|
||
// 当前订单总金额
|
||
current_total_price?: string | number;
|
||
// 当前订单小计金额
|
||
current_subtotal_price?: string | number;
|
||
// 当前订单运费
|
||
current_shipping_price?: string | number;
|
||
// 当前订单税费
|
||
current_tax_price?: string | number;
|
||
// 当前订单优惠券金额
|
||
current_coupon_price?: string | number;
|
||
// 当前订单支付金额
|
||
current_payment_price?: number;
|
||
// 当前订单小费金额
|
||
current_tip_price?: number;
|
||
// 当前订单保险金额
|
||
current_insurance_price?: number;
|
||
// 当前订单促销金额
|
||
current_promotion_price?: number;
|
||
// 当前订单优惠金额
|
||
current_offer_price?: number;
|
||
|
||
// ========================================
|
||
// 客户信息
|
||
// ========================================
|
||
// 客户ID
|
||
customer_id?: number;
|
||
// 用户ID
|
||
user_id?: number;
|
||
// 客户名称
|
||
customer_name?: string;
|
||
// 客户名
|
||
firstname?: string;
|
||
// 客户姓
|
||
lastname?: string;
|
||
// 客户邮箱
|
||
customer_email?: string;
|
||
// 客户邮箱(备用)
|
||
email?: string;
|
||
// 客户电话
|
||
telephone?: string;
|
||
// 客户系统信息
|
||
customer_sysinfo?: {
|
||
// 操作系统
|
||
os?: string;
|
||
// 时区
|
||
timezone?: string;
|
||
// 视口大小
|
||
viewport_size?: string;
|
||
// IP地址
|
||
ip?: string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 语言
|
||
language?: string;
|
||
// Cookie信息
|
||
cookies?: string;
|
||
// 日期时间
|
||
date_time?: string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 浏览器
|
||
browser?: string;
|
||
// 主题
|
||
theme_dir?: string;
|
||
// 屏幕大小
|
||
screen_size?: string;
|
||
// 系统信息ID
|
||
id?: number;
|
||
// 用户代理
|
||
user_agent?: string;
|
||
};
|
||
|
||
// ========================================
|
||
// 地址信息
|
||
// ========================================
|
||
// 配送地址
|
||
shipping_address?: {
|
||
// 收件人
|
||
first_name?: string;
|
||
// 收件人姓
|
||
last_name?: string;
|
||
// 收件人全名
|
||
name?: string;
|
||
// 公司名称
|
||
company?: string;
|
||
// 联系电话
|
||
phone?: string;
|
||
// 地址1
|
||
address1?: string;
|
||
// 地址2
|
||
address2?: string;
|
||
// 城市
|
||
city?: string;
|
||
// 省份
|
||
province?: string;
|
||
// 邮政编码
|
||
zip?: string;
|
||
// 国家名称
|
||
country_name?: string;
|
||
// 国家代码
|
||
country_code?: string;
|
||
// 地区
|
||
area?: string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 省份代码
|
||
province_code?: string;
|
||
// 电话区号
|
||
tel_area_code?: string;
|
||
// 省份ID
|
||
province_id?: number;
|
||
// 地址ID
|
||
id?: number;
|
||
// 国家ID
|
||
country_id?: number;
|
||
// 完整地址
|
||
full_address?: string;
|
||
// 验证状态
|
||
verify_status?: string;
|
||
};
|
||
// 账单地址
|
||
billing_address?: {
|
||
// 地区
|
||
area?: string;
|
||
// 邮政编码
|
||
zip?: string;
|
||
// 地址2
|
||
address2?: string;
|
||
// 城市
|
||
city?: string;
|
||
// 地址1
|
||
address1?: string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 收件人姓
|
||
last_name?: string;
|
||
// 省份代码
|
||
province_code?: string;
|
||
// 国家代码
|
||
country_code?: string;
|
||
// 电话区号
|
||
tel_area_code?: string;
|
||
// 省份
|
||
province?: string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 联系电话
|
||
phone?: string;
|
||
// 省份ID
|
||
province_id?: number;
|
||
// 国家名称
|
||
country_name?: string;
|
||
// 收件人全名
|
||
name?: string;
|
||
// 公司名称
|
||
company?: string;
|
||
// 地址ID
|
||
id?: number;
|
||
// 收件人
|
||
first_name?: string;
|
||
// 国家ID
|
||
country_id?: number;
|
||
};
|
||
// 支付地址
|
||
payment_address?: string;
|
||
// 支付城市
|
||
payment_city?: string;
|
||
// 支付区域
|
||
payment_zone?: string;
|
||
// 支付邮政编码
|
||
payment_postcode?: string;
|
||
// 支付国家
|
||
payment_country?: string;
|
||
// 配送城市
|
||
shipping_city?: string;
|
||
// 配送区域
|
||
shipping_zone?: string;
|
||
// 配送邮政编码
|
||
shipping_postcode?: string;
|
||
// 配送国家
|
||
shipping_country?: string;
|
||
|
||
// ========================================
|
||
// 商品信息
|
||
// ========================================
|
||
// 订单商品列表
|
||
products?: Array<{
|
||
// 商品ID
|
||
id?: number;
|
||
// 商品名称
|
||
name?: string;
|
||
// 商品标题
|
||
product_title?: string;
|
||
// 变体标题
|
||
variant_title?: string;
|
||
// 商品ID
|
||
product_id?: number;
|
||
// 变体ID
|
||
variant_id?: number;
|
||
// 商品数量
|
||
quantity?: number;
|
||
// 商品价格
|
||
price?: string | number;
|
||
// 折扣价格
|
||
discount_price?: number;
|
||
// 税费价格
|
||
tax_price?: number;
|
||
// SKU编码
|
||
sku?: string;
|
||
|
||
// SKU代码
|
||
sku_code?: string;
|
||
sku_value?: string | any[];
|
||
// 条形码
|
||
barcode?: string;
|
||
// 商品来源
|
||
data_from?: string;
|
||
// 促销ID
|
||
promotion_id?: number;
|
||
// 促销名称
|
||
promotion_name?: string;
|
||
// DIY优惠名称
|
||
diy_offer_name?: string;
|
||
// DIY优惠ID
|
||
diy_offer_id?: number;
|
||
// 供应商
|
||
vendor?: string;
|
||
// 商品是否应税
|
||
taxable?: number;
|
||
// 商品图片URL
|
||
src?: string;
|
||
// 属性MD5值
|
||
property_md5?: string;
|
||
// 商品重量
|
||
weight?: number;
|
||
// 商品推广码
|
||
spm?: string;
|
||
// 商品类型
|
||
product_type?: string;
|
||
// 商品SPU编码
|
||
spu?: string;
|
||
// 内部标题
|
||
inner_title?: string;
|
||
// 商品属性
|
||
properties?: any[];
|
||
// 是否为属性商品
|
||
is_property?: number;
|
||
// 商品详情URL
|
||
product_detail_url?: string;
|
||
// 详情URL
|
||
detail_url?: string;
|
||
// 商品备注
|
||
note?: string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
}>;
|
||
|
||
// ========================================
|
||
// 支付信息
|
||
// ========================================
|
||
// 支付方式
|
||
payment_method?: string;
|
||
// 支付ID
|
||
payment_id?: number;
|
||
// 支付类型
|
||
payment_type?: string;
|
||
// 支付卡信息列表
|
||
payment_cards?: Array<{
|
||
// 商店ID
|
||
store_id?: number;
|
||
// 卡号长度
|
||
card_len?: number;
|
||
// 卡号后缀
|
||
card_suffix?: number;
|
||
// 有效期年份
|
||
year?: number;
|
||
// 支付状态
|
||
payment_status?: number;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 有效期月份
|
||
month?: number;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 支付ID
|
||
payment_id?: number;
|
||
// 支付接口
|
||
payment_interface?: string;
|
||
// 卡号前缀
|
||
card_prefix?: number;
|
||
// 卡ID
|
||
id?: number;
|
||
// 订单ID
|
||
order_id?: number;
|
||
// 卡号
|
||
card?: string;
|
||
// 交易号
|
||
transaction_no?: string;
|
||
}>;
|
||
// 支付时间
|
||
pay_at?: number | null;
|
||
// 支付时间(备用)
|
||
date_paid?: number | string;
|
||
// 系统支付ID
|
||
sys_payment_id?: number;
|
||
|
||
// ========================================
|
||
// 交易信息
|
||
// ========================================
|
||
// 交易信息
|
||
transaction?: {
|
||
// 交易备注
|
||
note?: string;
|
||
// 交易金额
|
||
amount?: number | string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 商家ID
|
||
merchant_id?: string;
|
||
// 支付类型
|
||
payment_type?: string;
|
||
// 商家账户
|
||
merchant_account?: string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 支付ID
|
||
payment_id?: number;
|
||
// 管理员ID
|
||
admin_id?: number;
|
||
// 管理员名称
|
||
admin_name?: string;
|
||
// 交易ID
|
||
id?: number;
|
||
// 支付方式
|
||
payment_method?: string;
|
||
// 交易号
|
||
transaction_no?: string;
|
||
};
|
||
|
||
// ========================================
|
||
// 物流信息
|
||
// ========================================
|
||
// 物流状态
|
||
fulfillment_status?: number;
|
||
// 物流履行列表
|
||
fulfillments?: Array<{
|
||
// 物流回传状态
|
||
payment_tracking_status?: number;
|
||
// 物流备注
|
||
note?: string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 物流追踪接口编号
|
||
courier_code?: string;
|
||
// 物流公司ID
|
||
courier_id?: number;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 物流ID
|
||
id?: number;
|
||
// 物流单号
|
||
tracking_number?: string;
|
||
// 物流公司名称
|
||
tracking_company?: string;
|
||
// 物流回传结果
|
||
payment_tracking_result?: string;
|
||
// 物流回传时间
|
||
payment_tracking_at?: number;
|
||
// 物流商品列表
|
||
products?: Array<{
|
||
// 订单商品表ID
|
||
order_product_id?: number;
|
||
// 数量
|
||
quantity?: number;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// 发货商品表ID
|
||
id?: number;
|
||
}>;
|
||
}>;
|
||
// 物流区域计划列表
|
||
shipping_zone_plans?: Array<{
|
||
// 物流价格
|
||
shipping_price?: number | string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// ID
|
||
id?: number;
|
||
// 物流区域名称
|
||
shipping_zone_name?: string;
|
||
// 物流区域ID
|
||
shipping_zone_id?: number;
|
||
// 物流区域计划ID
|
||
shipping_zone_plan_id?: number;
|
||
// 物流区域计划名称
|
||
shipping_zone_plan_name?: string;
|
||
// 商品ID列表
|
||
product_ids?: number[];
|
||
}>;
|
||
// 物流区域计划名称
|
||
shipping_zone_plan_name?: string;
|
||
// 配送方式列表
|
||
shipping_lines?: Array<ShopyyShippingLineDTO>;
|
||
|
||
// ========================================
|
||
// 促销与优惠券
|
||
// ========================================
|
||
// 优惠券代码
|
||
coupon_code?: string;
|
||
// 优惠券名称
|
||
coupon_name?: string;
|
||
// 优惠券ID
|
||
coupon_id?: number;
|
||
// 促销ID
|
||
promotion_id?: number;
|
||
// 商品促销ID列表
|
||
product_promotion_ids?: number[];
|
||
// 免费配送价格
|
||
free_shipping_price?: number;
|
||
// 免费配送计划名称
|
||
free_shipping_plan_name?: string;
|
||
// 免费配送ID
|
||
free_shipping_id?: number;
|
||
// DIY优惠列表
|
||
diy_offers?: any[];
|
||
// 费用项列表
|
||
fee_lines?: Array<ShopyyFeeLineDTO>;
|
||
// 优惠券项列表
|
||
coupon_lines?: Array<ShopyyCouponLineDTO>;
|
||
|
||
// ========================================
|
||
// 财务信息
|
||
// ========================================
|
||
// 财务状态
|
||
financial_status?: number;
|
||
// 财务附加状态
|
||
financial_additional_status?: number;
|
||
// 退款状态
|
||
refund_status?: number;
|
||
// 退款金额
|
||
refund_price?: number;
|
||
// 退款列表
|
||
refunds?: any[];
|
||
|
||
// ========================================
|
||
// 跟踪信息
|
||
// ========================================
|
||
// 访问者ID
|
||
visitor_id?: string;
|
||
// 来源设备
|
||
source_device?: string;
|
||
// 着陆页
|
||
landing_page?: string;
|
||
// 结账类型
|
||
checkout_type?: string;
|
||
// 结账令牌
|
||
checkout_token?: string;
|
||
// IP地址
|
||
ip?: string;
|
||
// UTM来源
|
||
utm_source?: string;
|
||
// UTM媒介
|
||
utm_medium?: string;
|
||
// UTM术语
|
||
utm_term?: string;
|
||
// UTM内容
|
||
utm_content?: string;
|
||
// UTM广告系列
|
||
utm_campaign?: string;
|
||
// UTM信息列表
|
||
utms?: Array<{
|
||
// UTM术语
|
||
utm_term?: string;
|
||
// 更新时间
|
||
updated_at?: number;
|
||
// UTM广告系列
|
||
utm_campaign?: string;
|
||
// UTM媒介
|
||
utm_medium?: string;
|
||
// 创建时间
|
||
created_at?: number;
|
||
// ID
|
||
id?: number;
|
||
// 访问ID
|
||
visit_id?: string;
|
||
// 类型
|
||
type?: string;
|
||
// 来源设备
|
||
source_device?: string;
|
||
// UTM内容
|
||
utm_content?: string;
|
||
// UTM来源
|
||
utm_source?: string;
|
||
}>;
|
||
|
||
// ========================================
|
||
// 系统信息
|
||
// ========================================
|
||
// 商店ID
|
||
store_id?: number;
|
||
// 品牌ID
|
||
brand_id?: number;
|
||
// 版本
|
||
version?: string;
|
||
// 域名
|
||
domain?: string;
|
||
// 扩展字段1
|
||
ext1?: string;
|
||
// 扩展字段2
|
||
ext2?: string;
|
||
// 扩展字段3
|
||
ext3?: string;
|
||
// 扩展字段4
|
||
ext4?: string;
|
||
|
||
// ========================================
|
||
// 附加信息
|
||
// ========================================
|
||
// 订单备注
|
||
note?: string;
|
||
// 管理员备注
|
||
admin_note?: string;
|
||
// 订单标签
|
||
tags?: string[];
|
||
// 最新错误原因
|
||
latest_error_reason?: string;
|
||
// 备注属性
|
||
note_attributes?: any[];
|
||
// 附加信息
|
||
additional_info?: any;
|
||
// 重新营销邮件发送状态
|
||
recart_mail_sended?: number;
|
||
// 重新营销邮件结果
|
||
recart_mail_result?: string;
|
||
// 重新营销邮件发生时间
|
||
recart_mail_happened_at?: number;
|
||
|
||
// ========================================
|
||
// 时间戳信息
|
||
// ========================================
|
||
// 订单创建时间
|
||
created_at?: number | string;
|
||
// 订单添加时间
|
||
date_added?: string;
|
||
// 订单更新时间
|
||
updated_at?: number | string;
|
||
// 订单更新日期
|
||
date_updated?: string;
|
||
// 订单最后修改时间
|
||
last_modified?: string;
|
||
// 订单支付时间
|
||
act_at?: number;
|
||
// 订单提交类型
|
||
submit_type?: string;
|
||
}
|
||
|
||
|
||
|
||
export class ShopyyShippingLineDTO {
|
||
// 配送方式DTO用于承载统一配送方式数据
|
||
id?: string | number;
|
||
|
||
method_title?: string;
|
||
|
||
method_id?: string;
|
||
|
||
total?: string;
|
||
|
||
total_tax?: string;
|
||
|
||
taxes?: any[];
|
||
|
||
meta_data?: any[];
|
||
|
||
}
|
||
|
||
export class ShopyyFeeLineDTO {
|
||
// 费用项DTO用于承载统一费用项数据
|
||
id?: string | number;
|
||
|
||
name?: string;
|
||
|
||
tax_class?: string;
|
||
|
||
tax_status?: string;
|
||
|
||
total?: string;
|
||
|
||
total_tax?: string;
|
||
|
||
taxes?: any[];
|
||
|
||
meta_data?: any[];
|
||
}
|
||
|
||
export class ShopyyCouponLineDTO {
|
||
// 优惠券项DTO用于承载统一优惠券项数据
|
||
id?: string | number;
|
||
code?: string;
|
||
discount?: string;
|
||
discount_tax?: string;
|
||
meta_data?: any[];
|
||
|
||
}
|
||
|
||
// 客户类型
|
||
export interface ShopyyCustomer {
|
||
// 主键与兼容ID
|
||
id?: number;
|
||
customer_id?: number;
|
||
// 姓名
|
||
first_name?: string;
|
||
firstname?: string;
|
||
last_name?: string;
|
||
lastname?: string;
|
||
fullname?: string;
|
||
customer_name?: string;
|
||
// 联系信息
|
||
email?: string;
|
||
customer_email?: string;
|
||
contact?: string;
|
||
phone?: string;
|
||
// 地址集合
|
||
addresses?: any[];
|
||
default_address?: any;
|
||
// 国家
|
||
country?: { country_name?: string };
|
||
// 统计字段
|
||
orders_count?: number;
|
||
order_count?: number;
|
||
orders?: number;
|
||
total_spent?: number | string;
|
||
total_spend_amount?: number | string;
|
||
total_spend_money?: number | string;
|
||
// 创建与更新时间可能为时间戳
|
||
created_at?: number | string;
|
||
date_added?: string;
|
||
updated_at?: number | string;
|
||
date_updated?: string;
|
||
}
|
||
|
||
// 评论类型
|
||
export interface ShopyyReview {
|
||
// 主键ID
|
||
id: number;
|
||
// 产品ID
|
||
product_id: number;
|
||
// 客户ID
|
||
customer_id: number;
|
||
// 国家ID
|
||
country_id: number;
|
||
// IP地址
|
||
ip: string;
|
||
// 评分星级
|
||
star: number;
|
||
// 客户名称
|
||
customer_name: string;
|
||
// 客户邮箱
|
||
customer_email: string;
|
||
// 回复内容
|
||
reply_content: string;
|
||
// 评论内容
|
||
content: string;
|
||
// 状态 1表示正常
|
||
status: number;
|
||
// 是否包含图片 0表示不包含
|
||
is_image: number;
|
||
// 图片列表
|
||
images: any[];
|
||
// 更新时间戳
|
||
updated_at: number;
|
||
// 创建时间戳
|
||
created_at: number;
|
||
}
|
||
|
||
|
||
export interface ShopyyWebhookEvent {
|
||
id: number;
|
||
'event_name': string;
|
||
'event_code': string;
|
||
"event_decript": string;
|
||
isemail_event: number;
|
||
email_event_file: string;
|
||
email_event_status: number;
|
||
is_webhook: number;
|
||
is_script_event: number;
|
||
created_at: number;
|
||
updated_at: number;
|
||
}
|
||
export interface ShopyyWebhook {
|
||
id: number;
|
||
"webhook_name": string;
|
||
"url": string;
|
||
event_id: number;
|
||
event_name: string;
|
||
event_code: string;
|
||
}
|
||
|
||
// 发货相关DTO
|
||
// 批量履行
|
||
// https://www.apizza.net/project/e114fb8e628e0f604379f5b26f0d8330/browse
|
||
export class ShopyyFulfillmentDTO {
|
||
"order_number": string;
|
||
"tracking_company": string;
|
||
"tracking_number": string;
|
||
"courier_code": number;
|
||
"note": string;
|
||
"mode": "replace" | 'cover' | null// 模式 replace(替换) cover (覆盖) 空(新增)
|
||
}
|
||
// https://www.apizza.net/project/e114fb8e628e0f604379f5b26f0d8330/browse
|
||
export class ShopyPartFulfillmentDTO {
|
||
order_number: string;
|
||
note: string;
|
||
tracking_company: string;
|
||
tracking_number: string;
|
||
courier_code: string;
|
||
products: ({
|
||
quantity: number,
|
||
order_product_id: string
|
||
})[]
|
||
}
|
||
// https://www.apizza.net/project/e114fb8e628e0f604379f5b26f0d8330/browse
|
||
export class ShopyyCancelFulfillmentDTO {
|
||
order_id: string;
|
||
fulfillment_id: string;
|
||
}
|
||
|
||
export class ShopyyBatchFulfillmentItemDTO {
|
||
fulfillments: ShopyPartFulfillmentDTO[]
|
||
}
|