I have a large dataset that I need to push to the account-level shipping settings in Google Merchant Center. I am using the Google Shopping API via the PHP Client Library.
If I load a subset of the data and call it once at the end, it works fine:
$settings = $clientservice->shippingsettings->get('XXXXXX', 'XXXXXX');
for each data point that represents a service
for each data point that represents a rate group
create weight/destination state table
next
next
$settings->setServices($services);
$updatedSettings = $clientservice->shippingsettings->update('XXXXXX', 'XXXXXX', $settings);
However, if I load the entire set of data and try to apply it at once, I get a 413 Request Too Large response. So I would like to load it incrementally, one service at a time. I tried this:
$settings = $clientservice->shippingsettings->get('XXXXXX', 'XXXXXX');
for each data point that represents a service
for each data point that represents a rate group
create weight/destination state table
next
$settings->setServices([$service]);
$updatedSettings = $clientservice->shippingsettings->patch('XXXXXX', 'XXXXXX', $settings);
next
However, each service just overwrites the previous one. "patch" seems to operate just like "update", as best I can tell. Anyone know how to make this work?