Shipping table rates
The rates of a shipping table: where a cart goes — a country, a region, a city, a postal code or a range of them — its bounds of subtotal, weight and quantity, the shipping class of its products, and the price the table charges then. :batch_create imports up to 1000 at once, all or none; :purge deletes them all.
List shipping table rates
Lists the rates of a shipping table, the oldest first. filter takes country_code, region and shipping_class_id — country_code = "" lists the rates for any country.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
query Parameters
page_sizeRows per page. Over the maximum is clamped, not rejected.
page_tokenOpaque token from a previous next_page_token. A token minted under a different order_by/filter is rejected.
skipRows to skip before the page (AIP-158). skip + page_size is capped at 10000; beyond that is OUT_OF_RANGE.
order_byComma-separated field [asc|desc], at most 3 keys. Default: create_time asc. Sortable: create_time.
filterAIP-160 subset (§8). Filterable: country_code, create_time, region, shipping_class_id. A field outside the list is INVALID_ARGUMENT.
List shipping table rates › Responses
One page of rates.
This page of rates, in the requested order.
next_page_tokenOpaque. Absent or empty means this was the last page.
total_sizeRows in the whole filtered collection, not in this page.
Create shipping table rate
Creates a rate of the table. Every field is optional: a rate without conditions is for every cart, a rate without a price is free. Its amounts are in the table's currency_code. INVALID_ARGUMENT answers every refusal at once, each on its field: a country_code that is no ISO 3166-1 alpha-2 code; a region, a city or a postal code without country_code; a region that is none of the codes of a country that has a list of them; postal_code_to without postal_code_from, or with bounds that are not letters then digits, of other letters, or the first above the second; an amount in another currency or below zero; a percent outside 0–100 or with a third decimal; a weight with a fourth decimal; a subtotal_from or weight_from not below its _to, a quantity_from above quantity_to; delivery_days_min above delivery_days_max, or either outside 0–365; a shipping_class_id that is not the website's; weight_threshold or a weight_rounding other than NONE while per_weight_amount is zero. A rate with the conditions of another rate of the table — compared after normalization: the city without regard to case, the postal codes without spaces and hyphens, a _from of zero as none — answers ALREADY_EXISTS naming that rate. The table's 10001st rate answers FAILED_PRECONDITION LIMIT.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
Create shipping table rate › Request Body
country_codeThe country the rate is for, its ISO 3166-1 alpha-2 code — either case on a write, stored upper case. Absent — any country. A region, a city and a postal code need it.
regionThe region of the country the rate is for: where the country has a list of regions, the code of one of them exactly (CO, address_formats/{country}); elsewhere any text, at most 200 characters. Absent — any region.
cityThe city the rate is for, at most 200 characters, stored trimmed and compared without regard to case. Absent — any city.
postal_code_fromThe postal code the rate is for, stored upper case, at most 20 letters, digits, spaces and hyphens: alone, one code — or, ending in *, every code that begins so (SW1A*); with postal_code_to, the first of a range, letters then digits (80000). Absent — any postal code.
postal_code_toThe last code of the range from postal_code_from, both included: letters then digits, the letters of postal_code_from, its number not below it (81699).
subtotal_fromThe least subtotal the rate is for, included — a google.type.Money in the table's currency_code, whose currency_code may be left out on a write. Absent — no bound.
subtotal_toThe subtotal the rate is below — excluded, so the next rate starts where this one ends: as subtotal_from, above it. Absent — no bound.
weight_fromThe least weight of the cart the rate is for, included, in the website's unit (general.catalog.weight_unit): a decimal with at most three digits after the point, written as a string. Absent — no bound.
weight_toThe weight the rate is below — excluded: as weight_from, above it. Absent — no bound.
quantity_fromThe least number of units the rate is for, included. Absent — no bound.
quantity_toThe most units the rate is for, included — not below quantity_from. Absent — no bound.
shipping_class_idThe id of the website's shipping class (catalog_shipping_classes) whose products the rate prices. Absent — the products no rate of their own class prices. Deleting the class deletes its rates.
base_amountWhat the rate charges whatever the cart, as a google.type.Money in the table's currency_code — whose currency_code may be left out on a write. Zero when omitted.
percentThe share of the subtotal the rate adds, as a decimal string: from 0 to 100 with at most two digits after the point ("12.5"). "0" when omitted.
per_item_amountWhat the rate adds for every unit, as base_amount. Zero when omitted.
per_weight_amountWhat the rate adds for every unit of weight above weight_threshold, as base_amount. Zero when omitted.
weight_thresholdThe weight per_weight_amount is not charged for, as weight_from. Only with a per_weight_amount above zero. Absent — none.
weight_roundingHow the weight per_weight_amount is charged for is rounded to a whole unit: NONE, UP or DOWN. Other than NONE only with a per_weight_amount above zero. NONE when omitted.
delivery_days_minThe fewest days the delivery takes, from 0 to 365 — not above delivery_days_max. Absent — unsaid.
delivery_days_maxThe most days the delivery takes, from 0 to 365. Absent — unsaid.
Create shipping table rate › Responses
The created resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
table_idThe id of the shipping table this is a rate of — the {shipping_table} of name. Fixed by the URL.
country_codeThe country the rate is for, its ISO 3166-1 alpha-2 code — either case on a write, stored upper case. Absent — any country. A region, a city and a postal code need it.
regionThe region of the country the rate is for: where the country has a list of regions, the code of one of them exactly (CO, address_formats/{country}); elsewhere any text, at most 200 characters. Absent — any region.
cityThe city the rate is for, at most 200 characters, stored trimmed and compared without regard to case. Absent — any city.
postal_code_fromThe postal code the rate is for, stored upper case, at most 20 letters, digits, spaces and hyphens: alone, one code — or, ending in *, every code that begins so (SW1A*); with postal_code_to, the first of a range, letters then digits (80000). Absent — any postal code.
postal_code_toThe last code of the range from postal_code_from, both included: letters then digits, the letters of postal_code_from, its number not below it (81699).
subtotal_fromThe least subtotal the rate is for, included — a google.type.Money in the table's currency_code, whose currency_code may be left out on a write. Absent — no bound.
subtotal_toThe subtotal the rate is below — excluded, so the next rate starts where this one ends: as subtotal_from, above it. Absent — no bound.
weight_fromThe least weight of the cart the rate is for, included, in the website's unit (general.catalog.weight_unit): a decimal with at most three digits after the point, written as a string. Absent — no bound.
weight_toThe weight the rate is below — excluded: as weight_from, above it. Absent — no bound.
quantity_fromThe least number of units the rate is for, included. Absent — no bound.
quantity_toThe most units the rate is for, included — not below quantity_from. Absent — no bound.
shipping_class_idThe id of the website's shipping class (catalog_shipping_classes) whose products the rate prices. Absent — the products no rate of their own class prices. Deleting the class deletes its rates.
base_amountWhat the rate charges whatever the cart, as a google.type.Money in the table's currency_code — whose currency_code may be left out on a write. Zero when omitted.
percentThe share of the subtotal the rate adds, as a decimal string: from 0 to 100 with at most two digits after the point ("12.5"). "0" when omitted.
per_item_amountWhat the rate adds for every unit, as base_amount. Zero when omitted.
per_weight_amountWhat the rate adds for every unit of weight above weight_threshold, as base_amount. Zero when omitted.
weight_thresholdThe weight per_weight_amount is not charged for, as weight_from. Only with a per_weight_amount above zero. Absent — none.
weight_roundingHow the weight per_weight_amount is charged for is rounded to a whole unit: NONE, UP or DOWN. Other than NONE only with a per_weight_amount above zero. NONE when omitted.
delivery_days_minThe fewest days the delivery takes, from 0 to 365 — not above delivery_days_max. Absent — unsaid.
delivery_days_maxThe most days the delivery takes, from 0 to 365. Absent — unsaid.
Get shipping table rate
One rate of a shipping table: what the table charges a cart that goes where the rate says — a country, a region, a city, a postal code or a range of them — and falls within its bounds of subtotal, weight and quantity, for the products of its shipping class. Its price is base_amount + percent of the subtotal + per_item_amount a unit + per_weight_amount a unit of weight above weight_threshold, in the table's currency. Its conditions are one of a kind in the table. A rate lives under its table and is deleted with it, and with its shipping class. At most 10000 per table; :batch_create writes up to 1000 at once, all or none, and :purge deletes them all.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
rate_idId of the parent rate.
Headers
If-None-MatchA matching etag answers 304 with no body (§16).
Get shipping table rate › Responses
The resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
table_idThe id of the shipping table this is a rate of — the {shipping_table} of name. Fixed by the URL.
country_codeThe country the rate is for, its ISO 3166-1 alpha-2 code — either case on a write, stored upper case. Absent — any country. A region, a city and a postal code need it.
regionThe region of the country the rate is for: where the country has a list of regions, the code of one of them exactly (CO, address_formats/{country}); elsewhere any text, at most 200 characters. Absent — any region.
cityThe city the rate is for, at most 200 characters, stored trimmed and compared without regard to case. Absent — any city.
postal_code_fromThe postal code the rate is for, stored upper case, at most 20 letters, digits, spaces and hyphens: alone, one code — or, ending in *, every code that begins so (SW1A*); with postal_code_to, the first of a range, letters then digits (80000). Absent — any postal code.
postal_code_toThe last code of the range from postal_code_from, both included: letters then digits, the letters of postal_code_from, its number not below it (81699).
subtotal_fromThe least subtotal the rate is for, included — a google.type.Money in the table's currency_code, whose currency_code may be left out on a write. Absent — no bound.
subtotal_toThe subtotal the rate is below — excluded, so the next rate starts where this one ends: as subtotal_from, above it. Absent — no bound.
weight_fromThe least weight of the cart the rate is for, included, in the website's unit (general.catalog.weight_unit): a decimal with at most three digits after the point, written as a string. Absent — no bound.
weight_toThe weight the rate is below — excluded: as weight_from, above it. Absent — no bound.
quantity_fromThe least number of units the rate is for, included. Absent — no bound.
quantity_toThe most units the rate is for, included — not below quantity_from. Absent — no bound.
shipping_class_idThe id of the website's shipping class (catalog_shipping_classes) whose products the rate prices. Absent — the products no rate of their own class prices. Deleting the class deletes its rates.
base_amountWhat the rate charges whatever the cart, as a google.type.Money in the table's currency_code — whose currency_code may be left out on a write. Zero when omitted.
percentThe share of the subtotal the rate adds, as a decimal string: from 0 to 100 with at most two digits after the point ("12.5"). "0" when omitted.
per_item_amountWhat the rate adds for every unit, as base_amount. Zero when omitted.
per_weight_amountWhat the rate adds for every unit of weight above weight_threshold, as base_amount. Zero when omitted.
weight_thresholdThe weight per_weight_amount is not charged for, as weight_from. Only with a per_weight_amount above zero. Absent — none.
weight_roundingHow the weight per_weight_amount is charged for is rounded to a whole unit: NONE, UP or DOWN. Other than NONE only with a per_weight_amount above zero. NONE when omitted.
delivery_days_minThe fewest days the delivery takes, from 0 to 365 — not above delivery_days_max. Absent — unsaid.
delivery_days_maxThe most days the delivery takes, from 0 to 365. Absent — unsaid.
Delete shipping table rate
One rate of a shipping table: what the table charges a cart that goes where the rate says — a country, a region, a city, a postal code or a range of them — and falls within its bounds of subtotal, weight and quantity, for the products of its shipping class. Its price is base_amount + percent of the subtotal + per_item_amount a unit + per_weight_amount a unit of weight above weight_threshold, in the table's currency. Its conditions are one of a kind in the table. A rate lives under its table and is deleted with it, and with its shipping class. At most 10000 per table; :batch_create writes up to 1000 at once, all or none, and :purge deletes them all.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
rate_idId of the parent rate.
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Delete shipping table rate › Responses
Deleted. No body (§7).
Update shipping table rate
Updates a rate, refused as a Create is — the rate as the write would leave it checked whole, so clearing country_code under a region the rate keeps is refused on region. New conditions another rate of the table has answer ALREADY_EXISTS.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
rate_idId of the parent rate.
query Parameters
update_maskComma-separated field paths to merge. A field named here and sent as null is cleared; without the mask a null is dropped (§7, §11).
Headers
If-MatchThe etag the client last read. A mismatch is ABORTED (409) with the current resource in the error details (§14).
Update shipping table rate › Request Body
country_codeThe country the rate is for, its ISO 3166-1 alpha-2 code — either case on a write, stored upper case. Absent — any country. A region, a city and a postal code need it.
regionThe region of the country the rate is for: where the country has a list of regions, the code of one of them exactly (CO, address_formats/{country}); elsewhere any text, at most 200 characters. Absent — any region.
cityThe city the rate is for, at most 200 characters, stored trimmed and compared without regard to case. Absent — any city.
postal_code_fromThe postal code the rate is for, stored upper case, at most 20 letters, digits, spaces and hyphens: alone, one code — or, ending in *, every code that begins so (SW1A*); with postal_code_to, the first of a range, letters then digits (80000). Absent — any postal code.
postal_code_toThe last code of the range from postal_code_from, both included: letters then digits, the letters of postal_code_from, its number not below it (81699).
subtotal_fromThe least subtotal the rate is for, included — a google.type.Money in the table's currency_code, whose currency_code may be left out on a write. Absent — no bound.
subtotal_toThe subtotal the rate is below — excluded, so the next rate starts where this one ends: as subtotal_from, above it. Absent — no bound.
weight_fromThe least weight of the cart the rate is for, included, in the website's unit (general.catalog.weight_unit): a decimal with at most three digits after the point, written as a string. Absent — no bound.
weight_toThe weight the rate is below — excluded: as weight_from, above it. Absent — no bound.
quantity_fromThe least number of units the rate is for, included. Absent — no bound.
quantity_toThe most units the rate is for, included — not below quantity_from. Absent — no bound.
shipping_class_idThe id of the website's shipping class (catalog_shipping_classes) whose products the rate prices. Absent — the products no rate of their own class prices. Deleting the class deletes its rates.
base_amountWhat the rate charges whatever the cart, as a google.type.Money in the table's currency_code — whose currency_code may be left out on a write. Zero when omitted.
percentThe share of the subtotal the rate adds, as a decimal string: from 0 to 100 with at most two digits after the point ("12.5"). "0" when omitted.
per_item_amountWhat the rate adds for every unit, as base_amount. Zero when omitted.
per_weight_amountWhat the rate adds for every unit of weight above weight_threshold, as base_amount. Zero when omitted.
weight_thresholdThe weight per_weight_amount is not charged for, as weight_from. Only with a per_weight_amount above zero. Absent — none.
weight_roundingHow the weight per_weight_amount is charged for is rounded to a whole unit: NONE, UP or DOWN. Other than NONE only with a per_weight_amount above zero. NONE when omitted.
delivery_days_minThe fewest days the delivery takes, from 0 to 365 — not above delivery_days_max. Absent — unsaid.
delivery_days_maxThe most days the delivery takes, from 0 to 365. Absent — unsaid.
Update shipping table rate › Responses
The updated resource.
nameThe resource name (§5) — the identity of this resource, and the path that addresses it: websites/{website}/cms_pages/{cms_page}. It is the handle to store, not a human label.
idThe last segment of name on its own, for a client that needs to build a child URL. Unique inside its parent, never across the platform.
create_timeWhen the resource was created (RFC 3339, UTC).
update_timeWhen the resource last changed (RFC 3339, UTC).
etagVersion of the persisted state. Send it back in If-Match on Update or Delete and the write is rejected with ABORTED if anyone else changed the resource meanwhile (§14).
table_idThe id of the shipping table this is a rate of — the {shipping_table} of name. Fixed by the URL.
country_codeThe country the rate is for, its ISO 3166-1 alpha-2 code — either case on a write, stored upper case. Absent — any country. A region, a city and a postal code need it.
regionThe region of the country the rate is for: where the country has a list of regions, the code of one of them exactly (CO, address_formats/{country}); elsewhere any text, at most 200 characters. Absent — any region.
cityThe city the rate is for, at most 200 characters, stored trimmed and compared without regard to case. Absent — any city.
postal_code_fromThe postal code the rate is for, stored upper case, at most 20 letters, digits, spaces and hyphens: alone, one code — or, ending in *, every code that begins so (SW1A*); with postal_code_to, the first of a range, letters then digits (80000). Absent — any postal code.
postal_code_toThe last code of the range from postal_code_from, both included: letters then digits, the letters of postal_code_from, its number not below it (81699).
subtotal_fromThe least subtotal the rate is for, included — a google.type.Money in the table's currency_code, whose currency_code may be left out on a write. Absent — no bound.
subtotal_toThe subtotal the rate is below — excluded, so the next rate starts where this one ends: as subtotal_from, above it. Absent — no bound.
weight_fromThe least weight of the cart the rate is for, included, in the website's unit (general.catalog.weight_unit): a decimal with at most three digits after the point, written as a string. Absent — no bound.
weight_toThe weight the rate is below — excluded: as weight_from, above it. Absent — no bound.
quantity_fromThe least number of units the rate is for, included. Absent — no bound.
quantity_toThe most units the rate is for, included — not below quantity_from. Absent — no bound.
shipping_class_idThe id of the website's shipping class (catalog_shipping_classes) whose products the rate prices. Absent — the products no rate of their own class prices. Deleting the class deletes its rates.
base_amountWhat the rate charges whatever the cart, as a google.type.Money in the table's currency_code — whose currency_code may be left out on a write. Zero when omitted.
percentThe share of the subtotal the rate adds, as a decimal string: from 0 to 100 with at most two digits after the point ("12.5"). "0" when omitted.
per_item_amountWhat the rate adds for every unit, as base_amount. Zero when omitted.
per_weight_amountWhat the rate adds for every unit of weight above weight_threshold, as base_amount. Zero when omitted.
weight_thresholdThe weight per_weight_amount is not charged for, as weight_from. Only with a per_weight_amount above zero. Absent — none.
weight_roundingHow the weight per_weight_amount is charged for is rounded to a whole unit: NONE, UP or DOWN. Other than NONE only with a per_weight_amount above zero. NONE when omitted.
delivery_days_minThe fewest days the delivery takes, from 0 to 365 — not above delivery_days_max. Absent — unsaid.
delivery_days_maxThe most days the delivery takes, from 0 to 365. Absent — unsaid.
Batch create (shipping table rates)
Creates up to 1000 rates of the table in one call — what an import of a CSV writes: {"requests": [{"rate": {…}}, …]}, each rate the body of a rate's Create. All or none: every request is checked before any is written, a refused one answers for the whole call on its own fields (requests[2].rate.region), and nothing is written. Two requests of the same conditions are INVALID_ARGUMENT on the second, requests[i].rate; a request with the conditions of a rate the table has is ALREADY_EXISTS on it; more rates than the table may hold, FAILED_PRECONDITION LIMIT. The answer lists the rates made under rates, in the requests' order.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
Batch create (shipping table rates) › Request Body optional
Batch create (shipping table rates) › Responses
The affected resource, or the method’s own response object (§10).
Purge (shipping table rates)
Deletes every rate of the table — what replacing a table from a CSV does first. With {"force": true} the rates are deleted and the answer, {"purge_count": N}, is how many went; without force (or with false) nothing is deleted and purge_count is how many would go (AIP-165). The table itself stays.
path Parameters
website_idId of the parent website.
shipping_table_idId of the parent shipping_table.
Purge (shipping table rates) › Request Body optional
Purge (shipping table rates) › Responses
The affected resource, or the method’s own response object (§10).