Merchant API v1beta was discontinued and shut down on February 28, 2026. For steps to transition to the latest stable version, seeMigrate from v1beta to v1.
Theaccounts.shippingSettingsresource lets you retrieve and update the shipping settings of your advanced
account and all associated sub-accounts.
Advanced accounts are usually used by integrators, aggregators, and channel
partners who manage online stores and API services for multiple businesses.
Businesses that have multiple online stores or brands that are sold on separate
websites can also choose to have sub-accounts under a single advanced account.
Google can update the estimated delivery time for some products automatically.
{ACCOUNT_ID}: The unique identifier of your
Merchant Center account.
{COUNTRY_CODE}: The CLDR (Common Locale Data Repository)
code of the country to which this service applies. Must match that of the
prices in rate groups.
{SERVICE_NAME}: Name of the service.
{PROGRAM_LABEL}: Loyalty program label set in your
loyalty program settings in Merchant Center.
{SHIPPING_LABEL}: A list of shipping labels defining the
products to which this rate group applies.
{PRICE}: The price represented as a number in micros. For
example, 1 USD = 1000000 micros.
{CURRENCY_CODE}: The currency of the price using
three-letter acronyms.
The request body should contain the full resource body of theaccounts.shippingSettingsresource, even if you are just updating a single
attribute, as anyNULLor missing values in the request body results in
nulling out the existing values.
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_accounts_v1importDeliveryTimefromgoogle.shopping.merchant_accounts_v1importInsertShippingSettingsRequestfromgoogle.shopping.merchant_accounts_v1importRateGroupfromgoogle.shopping.merchant_accounts_v1importServicefromgoogle.shopping.merchant_accounts_v1importShippingSettingsfromgoogle.shopping.merchant_accounts_v1importShippingSettingsServiceClientfromgoogle.shopping.merchant_accounts_v1importValue_ACCOUNT=configuration.Configuration().read_merchant_info()_PARENT=f"accounts/{_ACCOUNT}"definsert_shipping_settings():"""Inserts a ShippingSettings for a Merchant Center account."""# Gets OAuth Credentials.credentials=generate_user_credentials.main()# Creates a client.client=ShippingSettingsServiceClient(credentials=credentials)# Creates the request.request=InsertShippingSettingsRequest(parent=_PARENT,shipping_setting=ShippingSettings(# Etag needs to be an empty string on initial insert# On future inserts, call GET first to get the Etag# Then use the retrieved Etag on future inserts.# NOTE THAT ON THE INITIAL INSERT, YOUR SHIPPING SETTINGS WILL# NOT BE STORED, YOU HAVE TO CALL INSERT AGAIN WITH YOUR# RETRIEVED ETAG.etag="",services=[Service(service_name="Canadian Postal Service",active=True,delivery_countries=["CA"],currency_code="CAD",delivery_time=DeliveryTime(min_transit_days=0,max_transit_days=3,min_handling_days=0,max_handling_days=3,),rate_groups=[RateGroup(applicable_shipping_labels=["Oversized","Perishable",],single_value=Value(price_percentage="5.4"),name="Oversized and Perishable items",)],shipment_type=Service.ShipmentType.DELIVERY,minimum_order_value={"amount_micros":10000000,"currency_code":"CAD",},)],),)# Makes the request and prints the inserted ShippingSettings name.try:response=client.insert_shipping_settings(request=request)print("Inserted ShippingSettings below")print(response)# You can apply ShippingSettings to specific products by using the# `shippingLabel` field on the product.exceptRuntimeErrorase:print(e)if__name__=="__main__":insert_shipping_settings()
fromexamples.authenticationimportconfigurationfromexamples.authenticationimportgenerate_user_credentialsfromgoogle.shopping.merchant_accounts_v1importGetShippingSettingsRequestfromgoogle.shopping.merchant_accounts_v1importShippingSettingsServiceClient_ACCOUNT=configuration.Configuration().read_merchant_info()_PARENT=f"accounts/{_ACCOUNT}"defget_shipping_settings():"""Gets the ShippingSettings for a given Merchant Center account."""# Gets OAuth Credentials.credentials=generate_user_credentials.main()# Creates a client.client=ShippingSettingsServiceClient(credentials=credentials)# Creates the Shipping Settings namename=_PARENT+"/shippingSettings"# Creates the request.request=GetShippingSettingsRequest(name=name)# Makes the request and prints the retrieved ShippingSettings.try:response=client.get_shipping_settings(request=request)print("Retrieved ShippingSettings below")print(response)exceptRuntimeErrorase:print(e)if__name__=="__main__":get_shipping_settings()
Create a request using theaccount.shippingSettings.insertmethod. Copy theshippingsettingsresource from the response of theGETrequest to the insert request.
To add information about warehouses using the insert call, populate details
about it in thewarehousesresource in the request body.
Run the insert request.
The following sample request shows how to use theaccounts.shippingSettings.insertmethod to update warehouse setting for your
account. The request sets the time of day that an order can be accepted and
begin processing, handling days, and the shipping address.
Use the Accounts sub-API to manage regions, calledpostalCodeGroups, for
a Merchant Center account.
ThepostalCodeGroupsresource is a list of groupings, where each grouping is
a list of multiple postal codes that share the same shipping settings.
Use the Merchant API to manage yourpostalCodeGroupsas follows:
Make agetcall to retrieve all yourshippingsettingsandpostalCodeGroups.
Copy theshippingsettingsfrom thegetcall to theupdatecall.
If you don't use transit time labels in your shipping service, remove the
following entry from the request body.
"transitTimeLabels": ["all other labels"],
Populate the regions you want to use in thepostalCodeGroupssection for
theupdatecall.
Make anupdatecall with theshippingsettingsandpostalCodeGroupsresources.
Add same-day delivery
You can use Merchant API to configure same-day delivery shipping services if you
have local inventory. SeeAdd in-store information to local
products(addlocalinventory).
Orders placed after your same-day delivery cutoff time are scheduled for
next-day delivery by default.
To turn off next-day delivery, setno_delivery_post_cutofftotrue.
If you turn off next-day delivery, your shipping services are only visible
before the cutoff time each day.
Next-day delivery is available only when theshipmentTypeislocal_delivery.
Add a return policy
If you list products through Shopping Ads or organic listings, you can usereturnpolicyonlineto create, view, edit, or delete online return policies
with the following attributes:
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2026-05-26 UTC."],[],["The Merchant Accounts API manages shipping settings for all products under an account, including sub-accounts. Use `accounts.shippingSettings.insert` to add or update these settings, applying changes to all products unless using the Merchant Products API for individual updates. Manage regions via `postalCodeGroups` by retrieving, copying, and updating `shippingSettings` and `postalCodeGroups`. Configure same-day delivery for local inventory and set next-day delivery options. Also, you can add return policies using `returnpolicyonline.create`.\n"]]