| Note: This is the latest documentation. The previous version of this page is also available. |
This page explains how to specify shipping costs and shipping options for a Google Checkout order. The Google Checkout shopping cart supports two different approaches for specifying the shipping costs and shipping options for an order:
You can specify fixed costs for shipping items or orders. With this approach, your customer generally does not have the ability to select between different shipping methods. However, you can offer two shipping methods if one of those methods is for free shipping. The following sections explain different variations of this approach:
You can specify different shipping options, each of which might have a different shipping rate, and then let your customer choose the desired shipping method and rate. For example, you could offer standard and overnight shipping options and thereby provide the customer with the option to pay higher shipping costs to receive the order more quickly. If you specify more than one shipping option, Google will display a pulldown menu that lists those options on the Place Order page. The customer will need to select a shipping option from the menu before completing the order.
The following sections describe the different types of shipping options that Google Checkout supports:
Flat-rate shipping - For flat-rate shipping methods, a change in the shipping address does not affect the shipping cost for the order. You can use shipping restrictions to limit the geographic areas where a flat-rate shipping option is available. The flat-rate shipping section of this document includes examples for the following use cases:
Carrier-calculated shipping - For carrier-calculated shipping methods, you identify one or more FedEx, UPS or USPS shipping methods that you offer. Google will then dynamically calculate the shipping cost for each option based on the total weight of the items in your shopping cart. The carrier-calculated shipping document defines the specific shipping methods that Google supports for each of these carriers. For carrier-calculated shipping options, the default shipping cost is only used if Google fails in its attempt to obtain the carrier's shipping rates. The carrier-calculated shipping section of this document includes examples for the following use cases:
Note: Carrier-calculated shipping is only available for U.S. merchants shipping to U.S. addresses.
Google Checkout also supports digital delivery. Unlike physical goods, digital goods do not need to be shipped (or picked up in a store). You can indicate that an item is a digital good by adding the product-digital CSS class to any HTML tag for that item. If all of the items in an order are digital goods, then Google Checkout will not display shipping options for the items.
Key point: If you do not include shipping information in a Checkout API request, Google Checkout will not charge the customer for shipping or handling. In addition, the method that you will use to ship the order may not be clearly communicated to the customer.
The following use cases explain how to identify shipping rates to the Google Checkout shopping cart for orders where all of the following conditions apply:
You offer one fixed-cost shipping option or or one fixed-cost shipping method and one free shipping option. However, you do not allow the customer to choose between two shipping methods that both have associated shipping charges.
You ship to all addresses in your country. If you are a U.S. merchant and you do not ship to all U.S. addresses, or if you are a U.K. merchant and you do not ship to all U.K. addresses, then these use cases may result in your being asked to send orders to addresses to which you do not ship orders.
You charge the same shipping rates for all addresses.
Key point: The following use cases explain how to set the product-shipping-first and product-shipping values to charge a fixed amount for each item in an order, a fixed amount for each order, or a fixed amount per order with an additional charge per item. Each item in the cart can specify a different product-shipping-first value than other items and a different product-shipping value than other items. To calculate the shipping cost for an order, Google selects the maximum product-shipping-first value for all items in the cart. To that amount, Google adds the product-shipping value for every item other than the one with the highest product-shipping-first value.
This use case demonstrates how to specify a fixed shipping cost for each item in a customer's shopping cart. To implement this type of shipping rule, use the product-shipping CSS class on the HTML element that contains the shipping cost for an item. Since the shipping cost is associated with the item, you can specify a different fixed cost for different types of items.
For example, suppose a camping store charges $5 to ship each sleeping bag in an order and $7 to ship each tent in an order. The store could use the following HTML to specify these shipping rules:
<div class="product"> <img class="product-image" src="sleepingbag.jpg"/> <span class="product-title">Sleeping Bag</span> Price: <span class="product-price">$39.99</span> Shipping: <span class="product-shipping">$5</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div> <div class="product"> <img class="product-image" src="tent.jpg"/> <span class="product-title">Tent</span> Price: <span class="product-price">$89.99</span> Shipping: <span class="product-shipping">$7</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div>
This section explains how to specify a fixed shipping cost for an order. To implement this type of shipping rule, use the product-shipping-first CSS class on the HTML element that contains the shipping cost for an order. Technically, the product-shipping-first class identifies the cost of shipping an item if the customer's shopping cart only contains that one item.
When Google calculates the shipping cost for an order, it will select the maximum product-shipping-first value for all of the items in the customer's shopping cart. (The following section explains how Google calculates shipping costs for items that specify a product-shipping value and a product-shipping-first value.)
The following two use cases demonstrate how you might implement fixed shipping costs for an order:
In this example, a book store charges $5 to ship an order regardless of how many books a customer orders. The store adds the following code to the HTML for every product:
Shipping: <span class="product-shipping-first">$5</span>
In this example, an electronics store charges a flat rate to ship an order, but the actual rate is determined by the item in the order that has the most expensive shipping cost. For example, a customer who orders an Ethernet card pays $5 dollars for shipping while a customer who orders a television pays $75. However, if the customer orders a television and an Ethernet card, he is charged $75 to ship the television but nothing to also ship the Ethernet card. The following HTML demonstrates how the store implements these shipping rules:
<div class="product"> <img class="product-image" src="ethernetcard.jpg"/> <span class="product-title">Ethernet Card</span> Price: <span class="product-price">$19.99</span> Shipping: <span class="product-shipping-first">$5</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div> <div class="product"> <img class="product-image" src="television.jpg"/> <span class="product-title">Television</span> Price: <span class="product-price">$499.99</span> Shipping: <span class="product-shipping-first">$75</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div>
This section explains how to specify a fixed shipping cost for an order and also charge an additional fee for each item in the order. To implement this type of shipping rule, use both the product-shipping-first and the product-shipping CSS classes on the HTML element that contain the shipping costs for an item.
When Google calculates the shipping cost for an order, it will select the maximum product-shipping-first value for all of the items in the customer's shopping cart. To that amount, Google will then add the product-shipping cost for every other item in the cart.
The following two use cases demonstrate how you might implement fixed shipping costs for an order:
In this example, a book store charges $3 to ship every order and also charges a flat fee of $1 for each book in the order. The store adds the following code to the HTML for every product:
<span class="product-shipping-first">$4</span> <span class="product-shipping">$1</span>
In this example, the cost of shipping the first item in the order (product-shipping-first) is $4 – the $3 flat fee for shipping any order plus the $1 fee for the first book in the order. In addition, the cost of shipping an additional item (product-shipping) is $1 for each item.
In this example, an electronics store charges a flat rate to ship an order, but the actual rate is determined by the item in the order that has the most expensive shipping cost. For example, a customer who only orders an Ethernet card pays $5 dollars for shipping while a customer who only orders a television pays $75. However, if the customer orders two televisions, then the cost of shipping the second television is only $35. In addition, the cost of shipping the Ethernet card is only $1 if a customer's order also contains an item that is more expensive to ship. The following HTML demonstrates how the store implements these shipping rules:
<div class="product">
<img class="product-image" src="ethernetcard.jpg"/>
<span class="product-title">Ethernet Card</span>
Price: <span class="product-price">$19.99</span>
Shipping: <span class="product-shipping-first">$5</span>
<span class="product-shipping" style="display:none">$1</span>
<div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button">
</div>
</div>
<div class="product">
<img class="product-image" src="television.jpg"/>
<span class="product-title">Television</span>
Price: <span class="product-price">$499.99</span>
Shipping: <span class="product-shipping-first">$75</span>
<span class="product-shipping" style="display:none">$35</span>
<div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button">
</div>
</div>
This use case demonstrates how to offer two shipping options where one option is for free shipping. This approach uses either the product-shipping and/or the product-shipping-first values, as described in the previous examples, as well as JavaScript controls to identify the shipping options.
The example below shows that a camping store charges $5 to ship each sleeping bag in an order and $7 to ship each tent in an order. In addition, the store offers free shipping on orders over $100 as indicated by the free-shipping-order-size parameter in the <script> tag. The following HTML specifies these shipping rules:
<div class="product">
<img class="product-image" src="sleepingbag.jpg"/>
<span class="product-title">Sleeping Bag</span>
Price: <span class="product-price">$39.99</span>
Shipping: <span class="product-shipping">$5</span>
<div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button">
</div>
</div>
<div class="product">
<img class="product-image" src="tent.jpg"/>
<span class="product-title">Tent</span>
Price: <span class="product-price">$89.99</span>
Shipping: <span class="product-shipping">$7</span>
<div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button">
</div>
</div>
....
<script id="googlecart-script" type="text/javascript"
src="http://checkout.google.com/seller/gsc/v2/cart.js?mid=MERCHANT_ID"
currency="USD"
free-shipping-order-size="100">
</script>
Note: The free-shipping-order-size amount is compared to the subtotal displayed in the cart. As such, the customer will only be able to select the free shipping option if the order subtotal equals or exceeds the free-shipping-order-size.
Please see the documentation for the shopping cart JavaScript controls for more information about free-shipping-order-size and other shipping-related controls.
The following use cases explain how to configure shipping options so that customers can choose between different options with different shipping rates or so that you can charge different amounts to ship to different areas. These use cases are likely relevant to your implementation if any of the following statements are true:
You let the customer choose between different shipping methods. The use cases below also apply if you only offer some shipping options, such as overnight shipping, for shipping addresses in certain areas.
You only ship to certain areas that does not include all addresses in your country. For example, a merchant that sells live lobsters might ship all orders using overnight shipping and, therefore, might not ship to all addresses in Alaska.
You charge different shipping rates to ship to different areas.
Form Wrapper for Enabling use of HTML API
All of these use cases utilize the Google Checkout shopping cart's support for the Google Checkout HTML API. To use API functionality, add the following <form> tag to your page and place all of the API instructions inside that tag
<form id="googlecart-checkout-config"> </form>
We recommend that if you are specifying multiple shipping options, that you create a single HTML file – e.g. googlecart.html – that can be included on all of your pages. The HTML file should contain the <form> tag described above and all of your shipping options as well as the <script> tag that adds the shopping cart JavaScript to your page.
Key point: If you specify shipping options in an HTML file that you include on each page of your site, that HTML file also needs to contain the <script> tag that includes the Google Checkout shopping cart JavaScript on your pages.
Then include that file on each page that displays the shopping cart:
<iframe src="googlecart.html" style="display:none">
Specifying unique names for shipping methods
When you harness HTML API functionality to specify shipping methods, you must specify a name for each shipping method that will be displayed to your customer during the order process. However, an order may not specify two or more shipping methods that have the same name. To verify that all names are unique, Google Checkout trims whitespace characters from the beginning and the end of the shipping method's name. Google Checkout then does a case-insensitive comparison of the names to ensure that they are unique. For example, Google Checkout would consider all of these names to be identical:
Regular shipping
REGULAR SHIPPING
Regular shipping
ReGuLaR sHiPPing
Flat-rate shipping options are options for which the shipping address does not affect the cost of shipping an order. For example, you might have a policy of charging $10 to ship to any U.S. address.
Key point: If you only offer one shipping option and the shipping cost is the same for all shipping addresses, then you will probably find it easier to set the product-shipping-first CSS class on each of your items. You should consider using flat-rate shipping methods if you offer multiple shipping methods or if the shipping cost for an order varies depending on the shipping address.
For a complete list of the input fields that you can use to specify carrier-calculated shipping options, please see the Basic HTML API Developer's Guide.
Example 1: Offering two flat-rate shipping methods
The example below includes two flat-rate shipping methods. The first option is for standard shipping, which costs $8. The second option is for overnight shipping, which costs $15. The second option is not available for addresses in Alaska and Hawaii.
<div class="product"> <img class="product-image" src="racket.jpg"/> <span class="product-title">Tennis Racket</span> Price: <span class="product-price">$13.99</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div> <form id="googlecart-checkout-config"> <input type="hidden" name="ship_method_name_1" value="Standard"/> <input type="hidden" name="ship_method_price_1" value="8.00"/> <input type="hidden" name="ship_method_currency_1" value="USD"/> <input type="hidden" name="ship_method_name_2" value="Overnight"/> <input type="hidden" name="ship_method_price_2" value="15.00"/> <input type="hidden" name="ship_method_currency_2" value="USD"/> <input type="hidden" name="ship_method_us_area_2" value="CONTINENTAL_48"/> </form>
Example 2: Adjusting shipping costs based on shipping addresses
The example below modifies the previous example by adding an option for overnight shipping to Alaska and Hawaii. However, while overnight shipping to the continental United States costs $15, overnight shipping to Alaska and Hawaii costs $25.
<form id="googlecart-checkout-config">
<input type="hidden" name="ship_method_name_1" value="Standard"/>
<input type="hidden" name="ship_method_price_1" value="8.00"/>
<input type="hidden" name="ship_method_currency_1" value="USD"/>
<input type="hidden" name="ship_method_name_2" value="Overnight"/>
<input type="hidden" name="ship_method_price_2" value="15.00"/>
<input type="hidden" name="ship_method_currency_2" value="USD"/>
<input type="hidden" name="ship_method_us_area_2" value="CONTINENTAL_48"/>
<input type="hidden" name="ship_method_name_3" value="Overnight - Alaska and Hawaii"/>
<input type="hidden" name="ship_method_price_3" value="25.00"/>
<input type="hidden" name="ship_method_currency_3" value="USD"/>
<input type="hidden"
name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-3.shipping-restrictions.allowed-areas.us-state-area-1.state"
value="AK"/>
<input type="hidden"
name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-3.shipping-restrictions.allowed-areas.us-state-area-2.state"
value="HI"/>
</form>
Example 3: Offering order delivery
Google Checkout does not define a special shipping method for order delivery. However, you can use a flat-rate shipping method to indicate that you offer delivery. The example below shows how a restaurant uses flat-rate shipping to offer delivery to a restricted set of zip codes. (The zip codes define a delivery area in Manhattan that is east of 5th Avenue between 41st Street and 60th Street.) In this example, there is a $2 delivery charge. However, you could offer free delivery by setting the price to $0 or by omitting the price and currency tags altogether.
<form id="googlecart-checkout-config">
<input type="hidden" name="ship_method_name_1" value="Delivery"/>
<input type="hidden" name="ship_method_price_1" value="2.00"/>
<input type="hidden" name="ship_method_currency_1" value="USD"/>
<input type="hidden"
name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.shipping-restrictions.allowed-areas.us-zip-area-1.zip-pattern"
value="10017"/>
<input type="hidden"
name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-1.shipping-restrictions.allowed-areas.us-zip-area-2.zip-pattern"
value="10021"/>
</form>
Example 4: Offering in-store pickup
You can define a flat-rate shipping method for in-store pickup similarly to the way you would define shipping methods for order delivery. However, for in-store pickup, you might not even want to specify shipping restrictions. The example below shows a merchant that offers standard shipping for $8 or free in-store pickup.
<form id="googlecart-checkout-config"> <input type="hidden" name="ship_method_name_1" value="Standard"/> <input type="hidden" name="ship_method_price_1" value="8.00"/> <input type="hidden" name="ship_method_currency_1" value="USD"/> <input type="hidden" name="ship_method_name_2" value="In-store pickup"/> <input type="hidden" name="ship_method_price_2" value="0.00"/> <input type="hidden" name="ship_method_currency_2" value="USD"/> </form>
You can offer carrier-calculated shipping options if you specify the weight of each product using the product-weight CSS class. All product weights are specified in pounds. Please note that this feature is only available to U.S. merchants for orders shipped to U.S. addresses. In addition, you cannot offer carrier-calculated shipping methods for orders that contain digital items.
For a list of the input fields that you can use to specify carrier-calculated shipping options, please see the Basic HTML API Developer's Guide.
Example 5: Offering two carrier-calculated shipping options
The example below shows a product that offers two carrier-calculated shipping options. The first shipping option is for FedEx Ground shipping and the second option is for FedEx Standard Overnight shipping. If, for any reason, Google is unable to calculate the shipping costs for the order, the customer will still be able to select the ground shipping option for $14.95 and the overnight option for $22.95.
<div class="product"> <img class="product-image" src="racket.jpg"/> <span class="product-title">Tennis Racket</span> Price: <span class="product-price">$13.99</span> <input class="product-weight" type="hidden" value=".7"/> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div> <form id="googlecart-checkout-config"> <input type="hidden" name="ccs_company_1" value="FedEx"/> <input type="hidden" name="ccs_shipping_type_1" value="Ground"/> <input type="hidden" name="ccs_price_1" value="14.95"/> <input type="hidden" name="ccs_company_2" value="FedEx"/> <input type="hidden" name="ccs_shipping_type_2" value="Standard Overnight"/> <input type="hidden" name="ccs_price_2" value="22.95"/> <input type="hidden" name="ccs_package_ship_from_id_1" value="ABC"/> <input type="hidden" name="ccs_package_ship_from_city_1" value="New York"/> <input type="hidden" name="ccs_package_ship_from_region_1" value="NY"/> <input type="hidden" name="ccs_package_ship_from_country_1" value="US"/> <input type="hidden" name="ccs_package_ship_from_postal_code_1" value="10022"/> </form>
Example 6: Combining flat-rate and carrier-calculated shipping options
The example below shows a product that offers two shipping options. Standard shipping costs $8 for all addresses, but the cost of overnight (FedEx Standard Overnight) shipping varies depending on the shipping address. carrier-calculated shipping options. If, for any reason, Google is unable to calculate the overnight shipping cost, the customer will still be able to select overnight shipping for $22.95.
<div class="product"> <img class="product-image" src="racket.jpg"/> <span class="product-title">Tennis Racket</span> Price: <span class="product-price">$13.99</span> <input class="product-weight" type="hidden" value=".7"/> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div> <form id="googlecart-checkout-config"> <input type="hidden" name="ship_method_name_1" value="Standard"/> <input type="hidden" name="ship_method_price_1" value="8.00"/> <input type="hidden" name="ship_method_currency_1" value="USD"/> <input type="hidden" name="ccs_company_1" value="FedEx"/> <input type="hidden" name="ccs_shipping_type_1" value="Standard Overnight"/> <input type="hidden" name="ccs_price_1" value="22.95"/> <input type="hidden" name="ccs_package_ship_from_id_1" value="ABC"/> <input type="hidden" name="ccs_package_ship_from_city_1" value="New York"/> <input type="hidden" name="ccs_package_ship_from_region_1" value="NY"/> <input type="hidden" name="ccs_package_ship_from_country_1" value="US"/> <input type="hidden" name="ccs_package_ship_from_postal_code_1" value="10022"/> </form>
Unlike physical goods, digital goods do not need to be shipped (or picked up in a store). If you will email your customer with instructions for accessing digital items, then you need to identify the items on your site that are digital goods. To identify a digital item, add the product-digital CSS class to any HTML tag for that item as demonstrated in the example below.
<div class="product"> <img class="product-image" src="beethoven_cd.jpg"> <span class="product-title product-digital">Moonlight Sonata</span> Price: <span class="product-price">9.99</span> <div role="button" alt="Add to cart" tabindex="0" class="googlecart-add-button"> </div> </div>
If all of the items in an order are digital goods, then Google Checkout will not display shipping options for the items. In addition, you can not use carrier-calculated shipping methods for orders that contain digital items.
| « Previous (Identifying Product Data) |
Next » (Understanding the Shopping Cart Widget) |