Thanks for the response. See below for both working and non-working content API calls:
This one works fine, loyalty_program is sent as an object, not an array:
{"entries":[
{"batchId":0,"merchantId":9954782,"method":"insert","productId":"online:en:US:SKU1023","product":{"kind":"content#product","id":"online:en:US:SKU1023","offerId":"SKU1023","title":"Title1023","description":"Product Description 1023","link":"
http://sap001.channeladvisor.com/american-standard-000117-0020a-cover-screw/p2?CAWELAID=120580500000638125","imageLink":"
http://sap001.channeladvisor.com/imagebase/resized/x500/Moenimages/113173.jpg","lifestyleImageLinks":["
http://lifestyle2"],"contentLanguage":"en","feedLabel":"US","channel":"online","adult":false,"autoPricingMinPrice":{"value":"11.00","currency":"USD"},"availability":"preorder","brand":"Brand1023","condition":"new","free_shipping_threshold":[{"country":"US","priceThreshold":{"value":"101.00","currency":"USD"}},{"country":" CA","priceThreshold":{"value":"99.99","currency":"USD"}}],"gtin":"UPC1023","mpn":"mpn1023","price":{"value":"2.00","currency":"USD"},"loyalty_program":{"programLabel":"My Loyalty Program 2","tierLabel":"My Silver Tier 2","price":{"value":"99","currency":"USD"},"loyaltyPoints":"5"},"productTypes":["Power Tools"]}}
]}
This one fails, loyalty_program is sent as an array, which according to the content API documentation shouldn't work anyway, but my question remains, how can I send multiple loyalty_programs? Sending multiples works fine in a TSV file, but we need this functionality in the content API.
{"entries":[
{"batchId":0,"merchantId":9954782,"method":"insert","productId":"online:en:US:SKU1002","product":{"kind":"content#product","id":"online:en:US:SKU1002","offerId":"SKU1002","title":"Title1002","description":"Product Description 1002","link":"
http://sap001.channeladvisor.com/american-standard-000117-0020a-cover-screw/p2?CAWELAID=120580500000639090","imageLink":"
http://sap001.channeladvisor.com/imagebase/resized/x500/Moenimages/113173.jpg","lifestyleImageLinks":["
http://lifestyle2"],"contentLanguage":"en","feedLabel":"US","channel":"online","adult":false,"autoPricingMinPrice":{"value":"11.00","currency":"USD"},"availability":"preorder","brand":"Brand1002","condition":"new","free_shipping_threshold":[{"country":"US","priceThreshold":{"value":"101.00","currency":"USD"}},{"country":" CA","priceThreshold":{"value":"99.99","currency":"USD"}}],"gtin":"UPC1002","mpn":"mpn1002","price":{"value":"2.00","currency":"USD"},"loyalty_program":[{"programLabel":"My Loyalty Program 2","tierLabel":"My Silver Tier 2","price":{"value":"99","currency":"USD"},"loyaltyPoints":"5"},{"programLabel":" My Loyalty Program 2","tierLabel":"My Gold Tier 2","price":{"value":"89","currency":"USD"},"loyaltyPoints":"10"}],"productTypes":["Power Tools"]}}
]}
response:
{
"entries": null,
"kind": null,
"error": {
"code": "400",
"message": "Invalid JSON payload received. Unknown name \"loyalty_program\" at 'body.entries[0].product': Proto field is not repeating, cannot start list.",
"errors": [
{
"domain": null,
"reason": "invalid",
"message": "Invalid JSON payload received. Unknown name \"loyalty_program\" at 'body.entries[0].product': Proto field is not repeating, cannot start list.",
"location": null
}
]
}
}