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.
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>
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_#.
Equivalent long form: shopping-cart.items.item-#.item-name
Equivalent long form: shopping-cart.items.item-#.item-description
Equivalent long form: shopping-cart.items.item-#.quantity
Equivalent long form: shopping-cart.items.item-#.unit-price
Equivalent long form: shopping-cart.items.item-#.unit-price.currency
Equivalent long form: shopping-cart.items.item-#.merchant-item-id
Equivalent long form: shopping-cart.items.item-#.item-weight.value
Equivalent long form: shopping-cart.items.item-#.item-weight.unit
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.edit-cart-url
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.continue-shopping-url
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:
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.tax-rules.default-tax-rule-#.rate
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.tax-rules.default-tax-rule-#.tax-areas.us-state-area-#.state
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.tax-rules.default-tax-rule-#.tax-areas.world-area-#
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.tax-rules.default-tax-rule-#.tax-areas.postal-area-#.country-code
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.tax-tables.tax-rules.default-tax-table.default-tax-rule-#.tax-areas.postal-area-#.postal-code-pattern
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:
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.name
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.price
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.price.currency
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.allowed-areas.us-country-area-#.country-area
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.allowed-areas.postal-area-#.country-code
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.allowed-areas.us-state-area-#.state
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.allowed-areas.world-area-#
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.
ccs_price_# - The parameter value contains the default shipping cost for the carrier-calculated-shipping option. If Google is unable to obtain the carrier's shipping rate for a shipping option, the buyer will still have the option of selecting that shipping option and paying this amount to have the order shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.price
ccs_currency_# - The parameter value identifies the currency for the shipping price. The default value is USD (U.S. dollars).
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.price.currency
ccs_company_# - The parameter value identifies the company that will ship the order. Valid values are FedEx, UPS and USPS.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.shipping-company
ccs_pickup_# - The parameter value specifies how the package will be transferred from the merchant to the shipper. Valid values are REGULAR_PICKUP, SPECIAL_PICKUP and DROP_OFF. The default value is DROP_OFF.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.carrier-pickup
ccs_shipping_type_# - The parameter value identifies the shipping option that is being offered to the buyer. The table below shows the valid values for this tag for each carrier. None of these shipping options are for international shipping. Please note that Google will reject an order that specifies a carrier-calculated shipping option for which the ccs_shipping_type is not valid for the specified carrier.
| FedEx | UPS | USPS |
|---|---|---|
|
|
|
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.shipping-type
ccs_additional_fixed_price_# - The parameter value specifies a fixed charge that will be added to the total cost of an order if the buyer selects the associated shipping option. If you also adjust the calculated shipping cost using the additional-variable-charge-percent field, the fixed charge will be added to the adjusted shipping rate.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.carrier-calculated-shipping-options.carrier-calculated-shipping-option-#.additional-fixed-charge
ccs_additional_fixed_currency_# - The parameter value specifies the currency of the additional fixed charge.
ccs_additional_variable_charge_percent_# - The parameter value specifies a percentage amount by which a carrier-calculated shipping rate will be adjusted. The value may be positive or negative. For example, if the value is 15, then the carrier's shipping rate will effectively be multiplied by 1.15 to determine the shipping cost presented to the buyer. So, if the carrier shipping rate were $10.00, the adjusted shipping rate would be $11.50 – i.e. $10.00 + ($10.00 X 15%). If the field value is negative, the calculated shipping rate will be discounted by the specified percentage.
ccs_package_height_unit_# - The parameter value specifies the unit of measurement that corresponds to a shipping package's height. The only valid value is IN.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.height.unit
ccs_package_height_# - The parameter value specifies the numeric component of a package's height.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.height.value
ccs_package_length_unit_# - The parameter value specifies the unit of measurement that corresponds to a shipping package's length. The only valid value is IN.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.length.unit
ccs_package_length_# - The parameter value specifies the numeric component of a package's length.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.length.value
ccs_package_width_unit_# - The parameter value specifies the unit of measurement that corresponds to a shipping package's width. The only valid value is IN.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.width.unit
ccs_package_width_# - The parameter value specifies the numeric component of a package's width.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.width.value
ccs_package_ship_from_id_# field contains a value that you use to identify the location from which a package will be shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.ship-from.id
ccs_package_ship_from_city_# - The parameter value identifies the city from which a package will be shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.ship-from.city
ccs_package_ship_from_region_# - The parameter value identifies the state/region from which a package will be shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.ship-from.region
ccs_package_ship_from_country_# - The parameter value identifies the country from which a package will be shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.ship-from.country-code
ccs_package_ship_from_postal_code_# - The parameter value identifies the zip or postal code from which a package will be shipped.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.ship-from.postal-code
ccs_package_delivery_address_category_# - The parameter value indicates whether the shipping method should be applied to a residential or a commercial address. Valid values for this tag are RESIDENTIAL and COMMERCIAL.
Equivalent long form: checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-1.delivery-address-category
| « Previous (Working with a Development Site) |
Next » (Google Checkout Buttons) |