# 9 店铺
# 1 店铺列表
# 1.1 查询店铺列表(GET)
查询当前账号下已绑定/已创建的店铺列表。
# URL
https://developers.cjdropshipping.com/api2.0/v1/shop/getShops
# CURL
curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shop/getShops' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# 请求参数
无入参
# 返回参数
success
{
"code": 200,
"result": true,
"message": "Success",
"data": [
{
"id": "1424608189734850560",
"createDate": "2024-01-01 12:00:00",
"name": "MyShop",
"status": 1,
"type": "shopify",
"updateDate": "2024-06-01 12:00:00",
"individuationNum": "001",
"fulfillmentStatus": "auto",
"marketplace": "us",
"aliasName": "Alias",
"syncInventory": 1,
"syncInventoryRate": 100,
"isCb": 0,
"trackUrlTemplate": "https://example.com/track/{number}",
"emailNotification": 1,
"email": "user@example.com",
"countryCode": "US",
"storeCountry": "United States",
"platformLogoUrl": "https://example.com/logo.png",
"currencyCode": "USD",
"businessType": 1,
"deliveryProfileOpen": 1,
"haveDeliveryProfileScopes": 1,
"deliveryProfileSpecifiedShop": 1,
"deliveryProfileNewShop": 0
}
],
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
| 字段 | 字段定义 | 类型 | 长度 | 备注 |
|---|---|---|---|---|
| id | 店铺 ID | string | 50 | |
| createDate | 创建时间 | string | 30 | 示例:2023-09-19 03:27:07 |
| name | 店铺名称 | string | 200 | |
| status | 店铺状态 | int | 5 | 店铺状态:0=删除,1=启用, 2=停用, 3=授权失败, 4=自动失效, 5=转移中 |
| type | 店铺类型/平台 | string | 50 | 参考 平台列表 |
| updateDate | 更新时间 | string | 30 | |
| individuationNum | 个性化编号 | string | 50 | |
| fulfillmentStatus | 履约状态 | string | 50 | |
| marketplace | 市场 | string | 50 | |
| aliasName | 店铺别名 | string | 200 | |
| syncInventory | 是否同步库存 | int | 1 | 1/0 |
| syncInventoryRate | 库存同步比例 | int | 5 | 单位 % |
| isCb | 是否跨境店 | int | 1 | 1/0 |
| trackUrlTemplate | 物流跟踪 URL 模板 | string | 500 | |
| emailNotification | 是否邮件通知 | int | 1 | 1/0 |
| 通知邮箱 | string | 200 | ||
| countryCode | 国家代码 | string | 20 | |
| storeCountry | 国家 | string | 100 | |
| platformLogoUrl | 平台 Logo | string | 500 | |
| currencyCode | 币种 | string | 10 | |
| businessType | 业务类型 | int | 5 | |
| deliveryProfileOpen | 是否开启发货档案 | int | 1 | 1/0 |
| haveDeliveryProfileScopes | 是否拥有发货档案权限 | int | 1 | 1/0 |
| deliveryProfileSpecifiedShop | 发货档案-指定店铺标志 | int | 1 | 1/0 |
| deliveryProfileNewShop | 发货档案-新店铺标志 | int | 1 | 1/0 |
# 2 店铺商品
# 2.1 保存商品(POST)
保存店铺商品到CJ系统。
# URL
https://developers.cjdropshipping.com/api2.0/v1/store/product/saveProduct
# CURL
curl --location 'https://developers.cjdropshipping.com/api2.0/v1/store/product/saveProduct' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"id": "prod123",
"title": "示例商品",
"image": "https://example.com/image.jpg",
"description": "商品描述",
"priceMin": 10.00,
"priceMax": 20.00,
"priceCurrency": "USD"
}'
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| id | 店铺商品ID | string | Y | 64 | |
| title | 商品标题 | string | Y | 500 | |
| image | 商品图片URL | string | Y | 400 | |
| description | 商品描述 | string | N | 5000 | |
| priceMin | 价格最小值 | BigDecimal | N | 20 | 需配合priceCurrency |
| priceMax | 价格最大值 | BigDecimal | N | 20 | 需配合priceCurrency |
| priceCurrency | 价格币种 | string | N | 10 | 如 USD |
# 返回
成功
{
"code": 200,
"result": true,
"message": "success",
"data": true,
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
错误
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| code | 错误码 | int | 20 | 返回错误码标准表 |
| result | 是否正常返回 | boolean | 1 | |
| message | 返回信息 | string | 200 | |
| data | object | 接口数据返回 | ||
| requestId | 请求Id | string | 48 | 用于日志查询错误 |
# 2.2 批量保存变体(POST)
批量保存店铺商品变体。
# URL
https://developers.cjdropshipping.com/api2.0/v1/store/product/saveVariantBatch
# CURL
curl --location 'https://developers.cjdropshipping.com/api2.0/v1/store/product/saveVariantBatch' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data '{
"variants": [
{
"id": "var001",
"productId": "prod123",
"title": "红色 - XL",
"sku": "SKU-RED-XL",
"image": "https://example.com/red-xl.jpg",
"shopPrice": 15.00,
"shopPriceCurrency": "USD",
"weight": 250,
"weightUnit": "g"
}
]
}'
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| variants | 变体列表 | Array | Y | - | |
| - id | 变体ID | string | Y | 64 | |
| - productId | 商品ID | string | Y | 64 | |
| - title | 变体标题 | string | Y | 500 | |
| - sku | 变体SKU | string | Y | 200 | |
| - image | 变体图片URL | string | Y | 500 | |
| - shopPrice | 变体价格 | BigDecimal | N | 20 | |
| - shopPriceCurrency | 价格币种 | string | N* | 10 | 价格存在则必填 |
| - weight | 重量 | BigDecimal | N | 20 | |
| - weightUnit | 重量单位 | string | N | 10 | 如 g, kg |
| - oldInventoryQuantity | 旧库存数量 | long | N | - |
# 返回
成功
{
"code": 200,
"result": true,
"message": "success",
"data": [
{
"id": "var001",
"productId": "prod123",
"saveSuccess": true,
"saveFailMessage": null
}
],
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| id | 变体ID | string | 64 | |
| productId | 商品ID | string | 64 | |
| saveSuccess | 保存结果 | boolean | 1 | |
| saveFailMessage | 失败原因 | string | 500 | 成功时为null |
错误
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| code | 错误码 | int | 20 | 返回错误码标准表 |
| result | 是否正常返回 | boolean | 1 | |
| message | 返回信息 | string | 200 | |
| data | object | 接口数据返回 | ||
| requestId | 请求Id | string | 48 | 用于日志查询错误 |
# 2.3 店铺商品分页查询(GET)
分页查询当前账号名下的店铺商品,支持按商品关联状态过滤。本接口不返回变体列表(如需变体请使用 2.4 店铺商品详情查询)。账号由 Access-Token 解析注入,仅返回当前账号自身的店铺商品。
# URL
https://developers.cjdropshipping.com/api2.0/v1/shop/product/queryPage
# CURL
curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shop/product/queryPage?pageNum=1&pageSize=10&relevanceStatusValues=0&relevanceStatusValues=1' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| pageNum | 页码 | int | N | - | 默认 1 |
| pageSize | 每页条数 | int | N | - | 默认 10,最大 10(一次最多查10个) |
| shopId | 店铺ID | string | N | 200 | |
| shopProductId | 店铺商品ID(精确) | string | N | 200 | |
| searchKey | 商品标题模糊匹配 | string | N | 200 | |
| relevanceStatusValues | 商品关联状态过滤集合 | Set<Integer> | N | - | 0-未关联 1-部分关联 2-已关联 3-下架关联;不传表示不过滤 |
# 返回
成功
{
"code": 200,
"result": true,
"message": "success",
"data": {
"pageNum": 1,
"pageSize": 10,
"total": 1,
"list": [
{
"shopId": "shop_1",
"shopName": "MyShop",
"shopType": "Shopify",
"platformProductId": "p_1",
"platformProductTitle": "Rose",
"platformProductImage": "https://example.com/p.jpg",
"platformProductPrices": "9.99-19.99",
"platformProductPricesCurrency": "USD",
"platformProductHandle": "rose",
"platformProductType": "Flowers",
"platformProductCategoryId": "cat_1",
"platformProductTags": "tag1,tag2",
"shopProductStatus": 1,
"relevanceStatus": 1,
"createDateTime": 1782700800000
}
]
},
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
| 返回字段 | 字段意思 | 字段类型 | 备注 |
|---|---|---|---|
| pageNum | 当前页码 | int | |
| pageSize | 每页条数 | int | |
| total | 总数 | int | |
| list[].shopId | 店铺ID | string | |
| list[].shopName | 店铺名称 | string | |
| list[].shopType | 店铺平台类型 | string | 如 Shopify |
| list[].platformProductId | 店铺商品ID | string | |
| list[].platformProductTitle | 商品标题 | string | |
| list[].platformProductImage | 商品主图 | string | |
| list[].platformProductPrices | 价格区间 | string | TEMU 不返回 |
| list[].platformProductPricesCurrency | 价格币种 | string | |
| list[].platformProductHandle | 商品句柄 | string | |
| list[].platformProductType | 商品类型 | string | |
| list[].platformProductCategoryId | 分类ID | string | |
| list[].platformProductTags | 标签 | string | |
| list[].shopProductStatus | 状态 | int | 1-上架 2-删除 3-下架 |
| list[].relevanceStatus | 关联状态 | int | 0-未关联 1-部分关联 2-已关联 3-下架关联 |
| list[].createDateTime | 创建时间 | long | 毫秒级时间戳 |
错误
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
# 2.4 店铺商品详情查询(GET)
按 shopId + platformProductIds 查询店铺商品详情,返回商品及其变体列表。shopId 与 platformProductIds 必传,platformProductIds 最多 10 个。账号由 Access-Token 解析注入,仅返回当前账号自身的店铺商品。
# URL
https://developers.cjdropshipping.com/api2.0/v1/shop/product/queryDetail
# CURL
curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/shop/product/queryDetail?shopId=shop_1&platformProductIds=p_1&platformProductIds=p_2' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| shopId | 店铺ID | string | Y | 200 | |
| platformProductIds | 店铺商品ID集合(最多10个) | array | Y | - | 重复传参:platformProductIds=a&platformProductIds=b |
# 返回
成功(data 为商品详情数组,每个元素含变体集合 variants)
{
"code": 200,
"result": true,
"message": "success",
"data": [
{
"shopId": "shop_1",
"shopName": "MyShop",
"shopType": "Shopify",
"platformProductId": "p_1",
"platformProductTitle": "Rose",
"platformProductImage": "https://example.com/p.jpg",
"platformProductPrices": "9.99-19.99",
"platformProductPricesCurrency": "USD",
"platformProductHandle": "rose",
"platformProductType": "Flowers",
"platformProductCategoryId": "cat_1",
"platformProductTags": "tag1,tag2",
"shopProductStatus": 1,
"relevanceStatus": 1,
"createDateTime": 1782700800000,
"variants": [
{
"platformProductId": "p_1",
"platformVariantId": "v_1",
"platformVariantSku": "SKU-1",
"platformVariantTitle": "红色",
"platformVariantImage": "https://example.com/v.jpg",
"price": 9.99,
"priceUSD": 9.99,
"priceCurrency": "USD",
"grams": "250",
"weight": 250,
"weightUnit": "g",
"relevanceStatus": "2",
"inventoryItemStatus": "2",
"shopProductStatus": 1,
"createDateTime": 1782700800000
}
]
}
],
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
| 返回字段 | 字段意思 | 字段类型 | 备注 |
|---|---|---|---|
| data[].shopId | 店铺ID | string | |
| data[].shopName | 店铺名称 | string | |
| data[].shopType | 店铺平台类型 | string | 如 Shopify |
| data[].platformProductId | 店铺商品ID | string | |
| data[].platformProductTitle | 商品标题 | string | |
| data[].platformProductImage | 商品主图 | string | |
| data[].platformProductPrices | 价格区间 | string | TEMU 不返回 |
| data[].platformProductPricesCurrency | 价格币种 | string | |
| data[].platformProductHandle | 商品句柄 | string | |
| data[].platformProductType | 商品类型 | string | |
| data[].platformProductCategoryId | 分类ID | string | |
| data[].platformProductTags | 标签 | string | |
| data[].shopProductStatus | 状态 | int | 1-上架 2-删除 3-下架 |
| data[].relevanceStatus | 关联状态 | int | 0-未关联 1-部分关联 2-已关联 3-下架关联 |
| data[].createDateTime | 创建时间 | long | 毫秒级时间戳 |
| data[].variants | 变体集合 | array | 商品下的变体列表 |
| data[].variants[].platformProductId | 所属商品ID | string | |
| data[].variants[].platformVariantId | 变体ID | string | |
| data[].variants[].platformVariantSku | 变体SKU | string | |
| data[].variants[].platformVariantTitle | 变体标题 | string | |
| data[].variants[].platformVariantImage | 变体图片 | string | |
| data[].variants[].price | 价格 | BigDecimal | TEMU 不返回 |
| data[].variants[].priceUSD | 价格(美元) | BigDecimal | TEMU 不返回 |
| data[].variants[].priceCurrency | 价格币种 | string | |
| data[].variants[].grams | 重量(克) | string | |
| data[].variants[].weight | 重量 | BigDecimal | |
| data[].variants[].weightUnit | 重量单位 | string | |
| data[].variants[].relevanceStatus | 变体关联状态 | string | 0-未知 1-未关联 2-已关联 |
| data[].variants[].inventoryItemStatus | 履行服务状态 | string | 0-未使用 1-使用履行不管库存 2-使用履行及库存 3-仅用库存 |
| data[].variants[].shopProductStatus | 状态 | int | 1-上架 2-删除 3-下架 |
| data[].variants[].createDateTime | 创建时间 | long | 毫秒级时间戳 |
错误
{
"code": 1600100,
"result": false,
"message": "Param error",
"data": null,
"requestId": "323fda9d-3c94-41dc-a944-5cc1b8baf5b1"
}
# 3 店铺商品关联CJ商品
商品关联(Product Connection)用于将 CJ 商品/变体与店铺(平台)商品/变体绑定,绑定后下单可自动匹配 CJ 商品发货。
# 3.1 查询商品关联列表(GET)
查询当前账号下的商品关联记录,支持按店铺、店铺商品、店铺变体过滤。
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection
# CURL
curl --location --request GET 'https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection?shopId=xxx&platformProductId=yyy&page=1&pageSize=10' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# 请求参数
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| shopId | 店铺Id | string | N | 40 | 不传时默认使用API类型的店铺Id,店铺列表 |
| platformProductId | 店铺商品Id | string | N | 100 | 平台侧商品Id |
| platformVariantId | 店铺变体Id | string | N | 100 | 平台侧变体Id |
| page | 当前页 | int | N | - | 默认1 |
| pageSize | 每页条数 | int | N | - | 默认10,最大100 |
# Return
success
{
"code": 200,
"result": true,
"message": "Success",
"data": {
"total": 1,
"list": [
{
"shopId": "xxx",
"platformProductId": "yyy",
"platformVariantId": "zzz",
"cjProductId": "1424608189734850560",
"cjVariantId": "1424608152007086080",
"defaultArea": 1,
"logistics": "PacketPlus",
"sourceCountryCode": "CN",
"sourceCountry": "China",
"targetCountryCode": "US",
"targetCountry": "United States"
}
]
},
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
| 返回字段 | 字段意思 | 字段类型 | 长度 | 备注 |
|---|---|---|---|---|
| total | 总数 | int | 20 | |
| list | 关联列表 | list | - | |
| - shopId | 店铺Id | string | 40 | |
| - platformProductId | 店铺商品Id | string | 100 | |
| - platformVariantId | 店铺变体Id | string | 100 | |
| - cjProductId | CJ商品Id | string | 50 | |
| - cjVariantId | CJ变体Id | string | 50 | |
| - defaultArea | 默认区域 | int | 5 | |
| - logistics | 物流方式 | string | 200 | |
| - sourceCountryCode | 发货国家编号 | string | 20 | |
| - sourceCountry | 发货国家 | string | 100 | |
| - targetCountryCode | 目标国家编号 | string | 20 | |
| - targetCountry | 目标国家 | string | 100 |
# 3.2 创建商品关联(POST)
将一个 CJ 商品(及其下若干变体)与店铺商品(及其变体)建立关联关系。
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection
# CURL
curl --location --request POST 'https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' \
--header 'Content-Type: application/json' \
--data-raw '{
"shopId": "xxx",
"defaultArea": 1,
"logistics": "PacketPlus",
"cjProductId": "1424608189734850560",
"platformProductId": "yyy",
"sourceCountryCode": "CN",
"sourceCountry": "China",
"targetCountryCode": "US",
"targetCountry": "United States",
"variantList": [
{
"cjVariantId": "1424608152007086080",
"platformVariantId": "v_001"
}
]
}'
# 请求参数
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| shopId | 店铺Id | string | N | 50 | 不传时默认使用API类型的店铺Id,店铺列表 |
| defaultArea | 默认区域 | int | Y | 5 | |
| logistics | 物流方式 | string | Y | 200 | |
| cjProductId | CJ商品Id | string | Y | 50 | |
| platformProductId | 店铺商品Id | string | Y | 100 | |
| sourceCountryCode | 发货国家编号 | string | N | 20 | |
| sourceCountry | 发货国家 | string | N | 100 | |
| targetCountryCode | 目标国家编号 | string | N | 20 | |
| targetCountry | 目标国家 | string | N | 100 | |
| variantList | 商品变体集合 | list | Y | - | 至少一个变体 |
| - cjVariantId | CJ变体Id | string | Y | 50 | |
| - platformVariantId | 店铺变体Id | string | Y | 100 |
# Return
success
{
"code": 200,
"result": true,
"message": "Success",
"data": true,
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
# 3.3 解除商品关联(DELETE)
按店铺商品Id(可选变体Id)解除已建立的关联关系。
# URL
https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection
# CURL
curl --location --request DELETE 'https://developers.cjdropshipping.com/api2.0/v1/product/conn/connection?shopId=xxx&platformProductId=yyy&platformVariantId=zzz' \
--header 'CJ-Access-Token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
# 请求参数
| 参数名 | 字段意思 | 字段类型 | 必填 | 长度 | 备注 |
|---|---|---|---|---|---|
| shopId | 店铺Id | string | N | 50 | 不传时默认使用API类型的店铺Id,店铺列表 |
| platformProductId | 店铺商品Id | string | Y | 100 | |
| platformVariantId | 店铺变体Id | string | N | 100 | 不传则解除该店铺商品下所有变体关联 |
# Return
success
{
"code": 200,
"result": true,
"message": "Success",
"data": true,
"requestId": "ae543fd1-cdd7-4a61-974a-1340fea678c6"
}
← 8 消息