-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Description
Determine this is the right repository
- I determined this is the correct repository in which to report this bug.
Summary of the issue
Context
The type Shipping (belong in /shopping/merchant_products_v1/types/products_common.py) have two missing fields (handling_cutoff_time & handling_cutoff_timezone) compared to Google Merchant API documentation & Google discovery document
Google Merchant Product discovery document : https://merchantapi.googleapis.com/$discovery/rest?version=products_v1
Google Merchant API documentation : https://developers.google.com/merchant/api/reference/rpc/google.shopping.merchant.products.v1#shipping
Expected Behavior:
No error raised when one of those two field is specified to update/insert a product
Actual Behavior:
We can't specify those two fields when a ProductInput is required in a request, for example insert/update product. A ValueError is raised :
ValueError: Unknown field for Shipping: handling_cutoff_timezone
API client name and version
google-shopping-merchant-products = 1.3.0
Reproduction steps: code
from google.shopping import (
merchant_products_v1,
)
credentials = "MY_CREDENTIALS"
datasource = "my_datasource"
product = {
"content_language": "fr",
"offer_id": "9628548530525",
"feed_label": "test",
"product_attributes": {
"price": {"currency_code": "EUR", "amount_micros": "1000000"},
"shipping_height": {"unit": "cm", "value": 55.0},
"image_link": "https://www.example.com/image.jpg",
"shipping": [
{
"postal_code": "44200",
"region": "fr",
"price": {"currency_code": "EUR", "amount_micros": "4000000"},
"handling_cutoff_timezone": "5",
"max_transit_time": "5",
"min_handling_time": "2",
"min_transit_time": "5",
"country": "fr",
}
],
"availability": "IN_STOCK",
"product_width": {"value": 4.0, "unit": "cm"},
"product_height": {"value": 5.0, "unit": "cm"},
"title": "title",
"gtins": ["3234567890126"],
"product_length": {"value": 55.0, "unit": "cm"},
"description": "description",
"product_weight": {"unit": "kg", "value": 55.0},
"link": "https://www.example.com/product1",
},
"name": "accounts/124659270/productInputs/ZnJ-dGVzdH45NjI4NTQ4NTMwNTI1",
}
client = merchant_products_v1.ProductInputsServiceClient(
credentials=credentials,
)
result = client.update_product_input(
request=merchant_products_v1.UpdateProductInputRequest(
product_input=merchant_products_v1.ProductInput(product),
data_source=datasource,
)
)Reproduction steps: supporting files
No response
Reproduction steps: actual results
Reproduction steps: expected results
No response
OS & version + platform
Ubuntu 24.04.3 LTS
Python environment
3.10.19
Python dependencies
No response
Additional context
No response