단일 API 호출에서 custombatch
를 사용하여 여러 제품을 한 번에 insert
, get
또는 delete
할 수 있습니다.
다음 요청 URL을 사용하여 커스텀 일괄 API를 호출합니다.
POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch
요청 본문에는 특정 매개변수(batchId
, merchantID
, method
)가 포함됩니다.
get 또는 delete를 실행하는 경우에만 productId
를 사용하세요. productId
는 custombatch
의 삽입 API 호출에 필요하지 않습니다.
custombatch:insert
다음 요청 URL은 products.custombatch method=insert
POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch
두 개의 새 제품을 삽입하려면 각 제품의 batchId
, API 호출 권한이 있는 판매자의 merchantId
, insert
메서드를 지정합니다.
다음 예에서 batchId
값은 각각 1111
과 1112
이며 각 제품의 고유 식별자입니다. merchantId:
1234567
는 API 호출을 하도록 승인된 판매자이고 메서드는 get
, delete
또는 insert
입니다.
insert
는 새 제품을 만듭니다. 지정된 제품의 channel
, contentLanguage
, offerId
, feedLabel
속성 값이 있는 경우 이 메서드는 항목을 업데이트하고 제품에 대한 이전 API 호출의 모든 데이터를 바꿉니다.
다음은 단일 API 호출을 사용하여 티셔츠 두 장을 판매자 센터 데이터베이스에 insert
하는 샘플 JSON 본문입니다.
{
"entries": [
{
"batchId": 1111,
"merchantId": 1234567,
"method": "insert",
"product": {
"kind": "content#product",
"offerId": "1111111111",
"title": "Google Tee Black",
"description": "The Black Google Tee is available in unisex sizing and
features a retail fit.",
"link": "http://my.site.com/blacktee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "black",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531656",
"itemGroupId": "google_tee",
"mpn": "608802531656",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Large"
],
"includedDestination": [
"Shopping"
]
}
},
{
"batchId": 1112,
"merchantId": 1234567,
"method": "insert",
"product": {
"kind": "content#product",
"offerId": "2222222222",
"title": "Google Tee Green",
"description": "100% cotton jersey fabric sets this Google t-shirt above
the crowd. Features the google logo across the chest. Unisex sizing.",
"link": "http://my.site.com/greentee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "green",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531649",
"itemGroupId": "google_tee",
"mpn": "608802531649",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Medium"
],
"includedDestination": [
"Shopping"
]
}
}
]
}
API 호출이 성공하면 HTTP 200
코드와 삽입된 제품이 포함된 JSON 응답이 반환됩니다. 반환되는 JSON의 형식은 다음과 유사합니다.
{
"kind": "content#productsCustomBatchResponse",
"entries": [
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1111,
"product": {
"kind": "content#product",
"id": "online:en:US:1111111111",
"offerId": "1111111111",
"title": "Google Tee Black",
"description": "The Black Google Tee is available in unisex sizing and
features a retail fit.",
"link": "http://my.site.com/blacktee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "black",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531656",
"itemGroupId": "google_tee",
"mpn": "608802531656",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Large"
],
"includedDestination": [
"Shopping"
]
}
},
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1112,
"product": {
"kind": "content#product",
"id": "online:en:US:2222222222",
"offerId": "2222222222",
"title": "Google Tee Green",
"description": "100% cotton jersey fabric sets this Google t-shirt above
the crowd. Features the google logo across the chest. Unisex sizing.",
"link": "http://my.site.com/greentee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "green",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531649",
"itemGroupId": "google_tee",
"mpn": "608802531649",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Medium"
],
"includedDestination": [
"Shopping"
]
}
}
]
}
custombatch:get
다음 요청 URL은 method=get
를 사용하여 products.custombatch
를 호출합니다.
POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch
제품을 가져오려면 API 호출의 제품에 고유한 batchId
, API 호출을 하도록 승인된 판매자의 merchantId
, 메서드 get
, 검색 중인 제품의 productId
를 지정합니다.
다음은 productId
값으로 지정된 이전 custombatch:insert
예를 사용하여 삽입된 두 제품을 검색하기 위한 샘플 JSON 요청 본문입니다. batchId
는 목록의 각 항목에서 고유합니다.
{
"entries": [
{
"batchId": 1113,
"merchantId": 1234567,
"method": "get",
"productId": "online:en:US:1111111111"
},
{
"batchId": 1114,
"merchantId": 1234567,
"method": "get",
"productId": "online:en:US:2222222222"
}
]
}
이 호출은 HTTP 200
코드와 다음과 같은 응답 본문을 반환합니다.
{
"kind": "content#productsCustomBatchResponse",
"entries": [
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1113,
"product": {
"kind": "content#product",
"id": "online:en:US:1111111111",
"offerId": "1111111111",
"title": "Google Tee Black",
"description": "The Black Google Tee is available in unisex sizing and features a retail fit.",
"link": "http://my.site.com/blacktee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX1100.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "black",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531656",
"itemGroupId": "google_tee",
"mpn": "608802531656",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Large"
],
"includedDestination": [
"Shopping"
]
}
},
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1114,
"product": {
"kind": "content#product",
"id": "online:en:US:2222222222",
"offerId": "2222222222",
"title": "Google Tee Green",
"description": "100% cotton jersey fabric sets this Google t-shirt above the crowd.
Features the google logo across the chest. Unisex sizing.",
"link": "http://my.site.com/greentee/",
"imageLink": "https://shop.example.com/.../images/GGOEGXXX0906.jpg",
"contentLanguage": "en",
"targetCountry": "US",
"feedLabel": "US",
"channel": "online",
"ageGroup": "adult",
"availability": "in stock",
"availabilityDate": "2019-01-25T13:00:00-08:00",
"brand": "Google",
"color": "green",
"condition": "new",
"gender": "male",
"googleProductCategory": "1604",
"gtin": "608802531649",
"itemGroupId": "google_tee",
"mpn": "608802531649",
"price": {
"value": "21.99",
"currency": "USD"
},
"sizes": [
"Medium"
],
"includedDestination": [
"Shopping"
]
}
}
]
}
custombatch:delete
다음 요청 URL은 method=delete
로 products.custombatch
를 만드는 데 사용됩니다.
POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch
제품을 삭제하려면 이 API 호출 내에서 제품 고유의 batchId
, 이 API 호출을 하도록 승인된 판매자의 merchantId
, 메서드 delete
, 삭제할 제품의 productId
를 지정합니다.
{
"entries": [
{
"batchId": 1115,
"merchantId": 1234567,
"method": "delete",
"productId": "online:en:US:1111111111"
},
{
"batchId": 1116,
"merchantId": 1234567,
"method": "delete",
"productId": "online:en:US:2222222222"
}
]
}
이 호출은 HTTP 200
코드와 삭제된 항목의 batchId
값을 반환합니다.
{
"kind": "content#productsCustomBatchResponse",
"entries": [
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1115
},
{
"kind": "content#productsCustomBatchResponseEntry",
"batchId": 1116
}
]
}