배치 모드

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 값은 11111112입니다. 각 제품의 고유 식별자입니다. merchantId: 1234567는 API 호출 권한이 있는 판매자이며 은 get, delete 또는 insert입니다.

insert는 새 제품을 만듭니다. 속성 값이 존재하는 경우 특정 항목에 대해 channel, contentLanguage, offerId, feedLabel 이 메서드는 항목을 업데이트하고 이전 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은 products.custombatch 호출을 만듭니다. method=get:

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

제품을 가져오려면 제품 고유의 batchId를 지정하세요. merchantId API 호출, 메서드 get, 가져올 제품의 productId입니다.

다음은 두 제품을 가져오기 위한 샘플 JSON 요청 본문입니다. 이전 custombatch:insert 예를 사용하여 삽입, productId 값으로 표현됩니다. 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은 다음을 사용하여 products.custombatch를 만드는 데 사용됩니다. method=delete:

POST https://shoppingcontent.googleapis.com/content/v2.1/products/batch

제품을 삭제하려면 제품 고유의 batchId를 지정하세요. 이 API 호출 내에서 제품을 제출하면 승인된 판매자의 merchantId가 API 호출, 메서드 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
 
}
 
]
}