여러 상품 목록에 대해 생성 혹은 수정하도록 한번에 동기화 합니다.
- 상품 id가 존재하면 해당 id로 상품을 찾아 수정합니다.
- 상품 id가 없으면 상품 코드(sku) 혹은 상품 URL(url)을 기준으로 상품의 기등록 여부를 판단하여 수정 혹은 새롭게 등록합니다.
POST https://papi.shoplive.cloud/v1/goods/{accessKey}/sync
REQUEST
Parameter | Type | Source | Description | Required | Note |
---|---|---|---|---|---|
accessKey | string | path | 발급 받은 accessKey | O | 샵라이브에서 발급받은 고객사의 키 |
Authorization | string | header | JWT 인증 토큰 | O | |
body | list<Goods > | body | 상품 데이터 객체 목록 | O |
RESPONSE
Parameter | Type | Description | Note |
---|---|---|---|
results | list<UploadGoodsRowResult > | 동기화된 상품 목록 | |
totalCount | int32 | 전체 건수 | |
createCount | int32 | 생성 건수 | |
updateCount | int32 | 수정 건수 | |
failCount | int32 | 실패 건수 |
Example
curl --location --request POST 'https://papi.shoplive.cloud/v1/goods/{access key}/sync' \
--header 'Authorization: Bearer {jwt token}' \
--header 'Content-Type: application/json' \
--data-raw '[{
"name": "상품명2",
"brand": "shoplive",
"description": null,
"url": "https://www.shoplive.cloud/2",
"sku": "shoplive-goods-3",
"mediaUrl": "https://shopping-phinf.pstatic.net/main_2658650/26586502065.jpg",
"originalPrice": 100000.0,
"discountedPrice": 50000.0,
"discountPercentage": 50.0
},{
"name": "상품명1_3",
"brand": "shoplive",
"description": null,
"url": "https://www.shoplive.cloud",
"sku": "shoplive-goods-1",
"mediaUrl": "https://shopping-phinf.pstatic.net/main_2658650/26586502065.jpg",
"originalPrice": 500000.0,
"discountedPrice": 30000.0,
"discountPercentage": 40.0
}]'
HTTP/1.1 200
Content-Type: application/json;charset=UTF-8
{
"results": [
{
"id": 731,
"name": "상품명2",
"brand": "shoplive",
"description": null,
"url": "https://www.shoplive.cloud/2",
"sku": "shoplive-goods-3",
"mediaUrl": "https://shopping-phinf.pstatic.net/main_2658650/26586502065.jpg",
"medias": [
{
"id": 733,
"mediaType": "IMAGE",
"url": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8.jpg",
"size": 18501,
"width": 500,
"height": 500,
"thumbnails": [
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w120.jpg",
"original": false,
"width": 120,
"height": 120,
"size": 2323
},
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w240.jpg",
"original": false,
"width": 240,
"height": 240,
"size": 5675
},
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w480.jpg",
"original": false,
"width": 480,
"height": 480,
"size": 15871
}
]
}
],
"originalPrice": 100000.0,
"discountedPrice": 50000.0,
"currency": "KRW",
"discountPercentage": 50.0,
"row": 0,
"message": null,
"status": "CREATE"
},
{
"id": 729,
"name": "상품명1_3",
"brand": "shoplive",
"description": null,
"url": "https://www.shoplive.cloud",
"sku": "shoplive-goods-1",
"mediaUrl": "https://shopping-phinf.pstatic.net/main_2658650/26586502065.jpg",
"medias": [
{
"id": 734,
"mediaType": "IMAGE",
"url": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8.jpg",
"size": 18501,
"width": 500,
"height": 500,
"thumbnails": [
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w120.jpg",
"original": false,
"width": 120,
"height": 120,
"size": 2323
},
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w240.jpg",
"original": false,
"width": 240,
"height": 240,
"size": 5675
},
{
"imageUrl": "https://resource.shoplive.cloud/images/2be33800-4977-4ded-be1f-29ebda7bfee8_w480.jpg",
"original": false,
"width": 480,
"height": 480,
"size": 15871
}
]
}
],
"originalPrice": 500000.0,
"discountedPrice": 30000.0,
"currency": "KRW",
"discountPercentage": 40.0,
"row": 0,
"message": null,
"status": "UPDATE"
}
],
"totalCount": 2,
"createCount": 1,
"updateCount": 1,
"failCount": 0
}