| Note: This is the latest documentation. The previous version of this page is identical — only the left nav differs. |
This page shows sample forms that demonstrate how to construct HTML forms for different types of orders, shipping options and taxes. These forms cover the following examples:
Note: Examples marked with an asterisk use some HTML fields that are not part of a basic HTML integration.
The following example shows a sample HTML form for an order containing a single item. If the item does not specify a currency, the value is presumed to be in U.S. dollars (USD). The merchant offers one shipping method and also charges tax to customers shipping the item to the state of New York.
The following example uses the item_currency_# and ship_method_currency_# hidden input fields to specify that the prices of the item and the shipping option in the order are expressed in British pounds (GBP). The merchant in the example offers one shipping option and will ship items anywhere in the United Kingdom. The merchant also charges tax on orders being shipped in the United Kingdom.
The following example adds a second item to the simple example above. Please note that the example uses the hidden HTML input field names item_name_2, item_description_2, item_quantity_2, and item_price_2 for the second item in the order. The numeral 2 in the field names enables Google Checkout to determine that the name, price and description, and quantity all correspond to the second item in the order.
The following example demonstrates how you can apply coupons or discounts to an order. In the example, the coupon or discount is expressed as a distinct item that has a negative price. (The HTML input field names item_name_3, item_description_3, item_quantity_3, and item_price_3 all contain information about the coupon.)
This method of providing coupons or discounts limits the amount of the discount to a fixed value that is known at the time that you create the HTML for an order. The Google Checkout Program Policies and Guidelines specify that if you accept coupons on your site, you must allow Google Checkout buyers to use those coupons as well.
The following example adds a second shipping method to the simple example above. Please note that the example uses the hidden HTML input field names ship_method_name_2, ship_method_price_2 and ship_method_us_area_2 for the second shipping method. The numeral 2 in the field names enables Google Checkout to determine that the name, price and area all correspond to the second shipping method in the order.
The following example demonstrates how to provide the same shipping method in two different countries. In a standard integration using basic HTML, each shipping option can only be associated with a single country. As such, this example includes two shipping options with the same price. Each shipping option specifies a different country; one option is for shipping within the United Kingdom (UK) and the other option is for shipping to Germany (DE). Please note that each shipping method in the order must have a unique name. As such, in the example one option is named UPS - U.K. and the other option is named UPS - Germany.
The previous example showed how you can create different shipping options for each country to which you ship orders. However, for merchants that ship to many countries – for example, all of Europe – this list may become difficult to manage. This example demonstrates how to create a single shipping option and make that option available in multiple countries.
As noted in the previous example, the input fields for a standard integration using basic HTML does not allow you to assign one shipping method to many countries. As such, this example requires you to specify countries using one of the input field names from the Google Checkout HTML API. The HTML API offers more functionality than a basic HTML integration but also has much more complicated syntax.
In the example, the shipping option is associated with a country using the following HTML input field name. Please note that line breaks have been inserted in the input field name so that the name will print correctly.
checkout-flow-support.merchant-checkout-flow-support. shipping-methods.flat-rate-shipping-1.shipping-restrictions. allowed-areas.postal-area-1.country-code
The field name above contains two numbers:
The first number appears after the text flat-rate-shipping- and corresponds to a particular shipping method. So, if you are specifying countries that can be used with ship_method_name_2, then the number after flat-rate-shipping- would be 2. In the HTML example, each input field that specifies a country includes the text flat-rate-shipping-1 because there is only one shipping method. If there were two shipping methods available in multiple countries, some countries would be associated with flat-rate-shipping-1 and others with flat-rate-shipping-2.
The second number appears after the text postal-area- and corresponds to a country. The first country associated with a shipping method is assigned the number 1, the second country is 2 and so forth. In the example, the shipping method is available in three countries, which are identified by postal-area-1, postal-area-2 and postal-area-3.
This example demonstrates how to offer a shipping option that is available everywhere except for a small number of countries. Specifically, this sample order offers two shipping methods. One method is available in the United States and the other is available everywhere else except for North Korea.
Like the previous example, this example uses special input fields that are not among the basic HTML input fields. This example also requires you to associate a number with the shipping method and the country where the shipping method is not available.
checkout-flow-support.merchant-checkout-flow-support. shipping-methods.flat-rate-shipping-2.shipping-restrictions. excluded-areas.postal-area-1.country-code
In the example below, the input field ship_method_world_2 indicates that the second shipping option is available worldwide. Then, specific countries are excluded from the shipping option using the special tag. Each input field includes the text flat-rate-shipping-2 since the exclusion is associated with the second shipping option. And since there are two countries where the shipping option is unavailable, those countries are specified using input fields containing the text postal-area-1 and postal-area-2.
| « Previous (Google Checkout Buttons) |
Next » (Input Fields in the User Interface) |