My favorites | English | Sign in

More personalization in Google Friend Connect New!

Google Checkout

Google Checkout HTML API Short Attribute Reference

When you integrate with Google Checkout, your site must display a Google Checkout button in addition to your regular checkout options. The button will be contained within a form on your page, and that form will also contain hidden input fields that contain information about the items in the customer's shopping cart.

HTML Form

This section defines the input fields that you can use in Google Checkout HTML forms. Please note that some field names end with a pound sign (#), such as item_name_#. These names actually identify an item in a list, and you need to replace the pound sign with a numeral corresponding to an order in a list. As such, the first item added to a shopping cart uses the field names item_name_1 and item_description_1 while the second item uses the field names item_name_2 and item_description_2.

HTML forms that submit to Google Checkout must also include the following elements:

  • The <form> tag's action attribute must contain the following URL. Please note that you must replace the text MERCHANT_ID with your merchant ID. Please see step 2 of the sign-up process for information about how to find your merchant ID.

    https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/MERCHANT_ID
    
  • The <form> tag must specify the accept-charset attribute with the value utf-8.

    <form method="POST"
          action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/MERCHANT_ID"
          accept-charset="utf-8">
    
  • The form must contain the following hidden input field:

    <input type="hidden" name="_charset_"/>
    
  • For each item in the order, the form must include the following input fields with a value: item_name_#, item_description_# and item_price_#. These required fields are marked REQUIRED in the lists below.

The short attribute names listed below and their values are each placed in a hidden input form. Example:

<form method="POST"
  action="https://checkout.google.com/api/checkout/v2/checkoutForm/Merchant/1234567890"
      accept-charset="utf-8">

  <input type="hidden" name="item_name_1" value="Peanut Butter"/>

</form>

HTML API Short Attribute Names

This is the list of short attribute names for the HTML API. Each name in this list has an equivalent long name, found in the HTML API Parameter Reference. Short names are just aliases to long names, so are entirely equivalent and interchangeable, so it is fine to mix and match short and long names. We recommend using the shorter names wherever possible, as they are easier to read and less prone to typos.

The more advanced attributes do not have short name equivalents. For example, when using the short names, then you are allowed to charge tax in only one area, and the tax rate will apply to all items in the order. If you need to set different tax rates for different locations or to apply different tax rates to different items in the same order, then you should use the long form HTML API tags (or the XML API).

See the Interactive Code Demo for examples of some of these attributes in use. Choose a product, then switch between the "Short attribute names" and "Long attribute names" radio buttons to see their equivalence.

Note: Three fields are required and must contain values: item_name_#, item_description_#, and item_price_#.

Item-Level Input Fields

Shopping Cart Input Fields

Tax Input Fields

The tax input fields enable you to indicate where you charge taxes for orders. When a buyer selects a shipping address in the area where you charge taxes, the tax rate that you specify will be charged for all items in the order. However, if the buyer specifies a shipping address in another area, Google Checkout will not charge tax for the order. Similarly, if you do not specify a tax rate and the area where you charge tax, Google Checkout will not charge tax for the order.

Note: The short attribute tax rules allow you to charge tax in only one area, and the tax rate will apply to all items in the order. If you need to set different tax rates for different locations or to apply different tax rates to different items in the same order, then you should use the long form HTML API tags (or the XML API).

You can use the following short HTML input fields to specify your tax rate and the area where you charge taxes:

Shipping Input Fields

Google Checkout allows you to provide one or more shipping options for an order. If you specify more than one shipping option, Google Checkout will display a pulldown menu that lists those options on the Place Order page. The buyer will need to select a shipping option from the menu before completing the order. If you do not specify any shipping options, Google Checkout will not add any shipping charges to the order.

You can use HTML forms to specify two types of shipping options:

  • Flat-rate shipping options are options for which a change in the shipping address does not affect the order's shipping cost. You can use input fields to indicate that a shipping method is only available in a specific country, state/region, city or zip code.

  • Carrier-calculated shipping options are options for which Google will dynamically calculate the shipping cost based on the total weight of the items in your shopping cart. Google can calculate shipping costs for a variety of FedEx, UPS and USPS shipping methods.

Note: You can combine flat-rate and carrier-calculated shipping options. For example, if you charge the same standard shipping fee for all addresses in a country, you could use the input fields for flat-rate shipping options to specify that option. However, if your overnight shipping charges vary depending on the shipping address, you could use a carrier-calculated shipping option to specify your overnight shipping option.

Specifying unique names for shipping methods

You must specify a name for each shipping option. The name will be displayed to your customer, and an order may not specify two or more shipping methods that have the same name. Shipping method names are contained in the ship_method_name_# input field for flat-rate shipping methods and in the ccs_shipping_type_# input field for carrier-calculated shipping methods. Please note that carrier-calculated shipping is only available to U.S. merchants for orders shipped to U.S. addresses.

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

Input fields for flat-rate shipping methods

You can use the following short input field names to identify flat-rate shipping methods:

Input fields for carrier-calculated shipping methods

You can use the following short input field names to identify carrier-calculated shipping methods. Please note that Google Checkout currently only supports one package per order for carrier-calculated shipping. Thus, for all of the input field names that begin with ccs_package_, the value of the # symbol in the field name needs to be 1.

« Previous
(Working with a Development Site)
Next »
(Google Checkout Buttons)