English | Site Directory

Google Checkout APIs

Implementing the Merchant Calculations HTML API

Overview
Specifying that You Will Perform Custom Calculations
Handling Merchant Calculation Callbacks
Returning Merchant Calculation Results
HTML Parameter Definitions

Overview

The Merchant Calculations API enables you to use your own business logic to compute order totals using information that is not known when you post a Checkout API request. You can use this API to compute taxes, shipping costs, and price adjustments from coupons or gift certificates. To use this API, you must build and operate a fast, highly reliable web service that calculates these values.

The following sections explain how the Merchant Calculations API works:

Specifying that You Will Perform Custom Calculations
 
Handling Merchant Calculation Callbacks
 
Returning Merchant Calculation Results
 

Specifying that You Will Perform Custom Calculations

To perform custom calculations for an order before your customer confirms a purchase, you must include the merchant-calculations-url parameter in your Checkout API request. The merchant-calculations-url parameter's value is the URL to which Google Checkout will send requests for merchant calculations.

There are then several ways to instruct Google Checkout to send a request to your merchant calculations web service. You should use any methods that correspond to calculations that you intend to perform.

Shipping
 
Taxes
 
Coupons and Gift Certificates
 

Shipping

To indicate that you will calculate shipping costs for an order, include one or more merchant-calculated shipping methods in your Checkout API request. You must specify a unique name and a default shipping cost for each shipping option. Google will only use the default shipping cost if the merchant calculation callback request, which asks your web service to calculate shipping costs, fails for any reason.

You can also use address filters and shipping restrictions to specify whether a merchant-calculated shipping method is available in a specific geographic region. The example below shows two merchant-calculated shipping methods. The first method uses address filters to indicate that the shipping method is never available for shipping addresses in Alaska. The first shipping method also specifies that it will not be available for shipping addresses in Hawaii if the merchant calculation callback request fails. The second shipping method is available for all addresses.

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.name" value="FedEx Overnight Shipping"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.price" value="19.00"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.currency" value="USD"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.address-filters.excluded-areas.us-state-area-1.state" value="AK"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.shipping-restrictions.excluded-areas.us-state-area-1.state" value="HI"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.name" value="UPS Ground"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.price" value="8.00"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.currency" value="USD"/>

Please note that you cannot combine merchant-calculated shipping methods with other types of shipping methods, such as flat-rate shipping or carrier-calculated shipping methods.

Taxes

To indicate that you will calculate taxes, set the value of the merchant-calculated parameter to true in your Checkout API request. Even if you plan to calculate taxes for an order, you should still include default and alternate tax tables in your Checkout API request. If the merchant calculation callback fails for any reason, Google Checkout will use the default and alternate tax tables to compute taxes for the order.

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.merchant-calculated" value="true"/>

 Note: You can only use the Merchant Calculations API to calculate taxes if you use the default U.S. rounding rules for financial calculations.

The default U.S. rounding rules specify that taxes are calculated by assessing the tax rate to the total cost of all of the items and then using the HALF_EVEN rounding mode, or banker's rounding, to determine the tax for the order. These rules are substantially different from the default rounding rules for U.K. merchants. For U.K. merchants, the default behavior is to calculate tax separately for each item in the order and then apply the HALF_UP rounding mode to each calculation.

Coupons and Gift Certificates

To indicate that you accept coupons and will calculate discounts for coupons, set the value of the accept-merchant-coupons parameter to true in your Checkout API request. To indicate that you accept gift certificates and will calculate discounts for gift certificates, set the value of the accept-gift-certificates parameter to true in your Checkout API request.

If you set the accept-merchant-coupons or the accept-gift-certificates parameter to true, the Google Checkout Place Order page will display a field where your customer can enter coupon or gift certificate codes. Google Checkout does not limit the number of codes that a customer may enter. However, your response to a merchant calculation callback can specify that a coupon or gift certificate code is invalid.

The following snippet from a Checkout API request indicates that the merchant accepts coupons and gift certificates:

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.merchant-calculations-url" value="http://www.example.com/calc.php"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.accept-merchant-coupons" value="true"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.accept-gift-certificates" value="true"/>

Note: When Google Checkout calculates order totals, coupons are applied before shipping and taxes. Gift certificates are applied after shipping and taxes.


 Note: U.K. merchants cannot yet use the Merchant Calculations API for coupons or gift certificates. Google Checkout will ignore the accept-merchant-coupons and accept-gift-certificates parameters if they are included in a Checkout API request from a U.K. merchant.

Handling Merchant Calculation Callbacks

As discussed in the previous section, if you will perform custom calculations for an order, then your Checkout API request must specify the URL for your custom calculations web service. Google Checkout sends a merchant-calculation-callback request to your web service each time any of the following events occur:

  • The buyer proceeds to the Place Order page to complete a Google Checkout order. To reach the Place Order page, the buyer could create a new Google account or sign in to an existing Google account. If the buyer has recently shopped with Google Checkout and still has a valid cookie, the buyer could also proceed directly to the Place Order after clicking on a Google Checkout button.
  • The buyer enters a new shipping address on the Place Order page.
  • The buyer enters a coupon or gift certificate code.
  • The buyer changes the shipping address for the order.

A merchant-calculation-callback request contains two types of information.

  • It contains the complete shopping cart information from the Checkout API request for the order.
  • It contains information that you need for computing shipping costs, taxes or price adjustments for the order.

The following sections explain how the callback request identifies amounts that you are supposed to calculate.

Shipping
 
Taxes
 
Coupons and Gift Certificates
 

Shipping

You must calculate the shipping cost for each shipping method identified in the merchant-calculation-callback request. That request will list the shipping methods that you included in your Checkout API request. However, if your Checkout API request specified address filters for a shipping method, the callback request will only include a shipping method if the buyer's shipping address is located in an allowed area for the method.

In the callback request, the method parameter identifies individual shipping methods.

To protect the buyer's privacy before the order is placed, Google Checkout does not send street address information in merchant-calculation-callback requests. Instead, the callback request contains an anonymous address, which only specifies the city, region/state, postal code and country code for the shipping address.

The example below shows two merchant-calculated shipping methods. The name assigned to each shipping method is shown in bold text.

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.name" value="FedEx Overnight Shipping"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.price" value="19.00"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-1.currency" value="USD"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.name" value="UPS Ground"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.price" value="8.00"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-2.currency" value="USD"/>

This excerpt shows how these two shipping methods would be identified in a merchant-calculation-callback request. Again, the names of the two shipping methods are shown in bold text.


_type=merchant-calculation-callback
  ...
  &calculate.addresses.anonymous-address-1.id=739030698069958
  &calculate.addresses.anonymous-address-1.country-code=US
  &calculate.addresses.anonymous-address-1.city=Mountain%20View
  &calculate.addresses.anonymous-address-1.region=CA
  &calculate.addresses.anonymous-address-1.postal-code=94043
  &calculate.shipping.method-1.name=FedEx%20Overnight%20Shipping
  &calculate.shipping.method-2.name=UPS%20Ground

Taxes

You must calculate taxes for an order if the tax element in the merchant-calculation-callback request has a value of true.

The following excerpt is from a callback request that indicates that the merchant needs to calculate taxes for an order but does not need to calculate shipping costs or price adjustments for either coupons or gift certificates. The parameter that indicates that the merchant must calculate taxes is shown in bold text.


_type=merchant-calculation-callback
  ...
  &calculate.addresses.anonymous-address-1.id=739030698069958
  &calculate.addresses.anonymous-address-1.country-code=US
  &calculate.addresses.anonymous-address-1.city=Mountain%20View
  &calculate.addresses.anonymous-address-1.region=CA
  &calculate.addresses.anonymous-address-1.postal-code=94043
  &calculate.tax=true

Coupons and Gift Certificates

You must calculate price adjustments for each code identified in a callback request. Google Checkout uses the code attribute of the <merchant-code-string> tag to identify coupon and gift certificate codes. Please note that you must determine whether each code is for a coupon or a gift certificate.

The following XML excerpt is from a callback request that indicates that the merchant needs to calculate price adjustments for either coupons or gift certificates (or both). In this example the merchant does not need to calculate shipping costs or taxes. The gift certificate and coupon codes in the example are shown in bold text.


_type=merchant-calculation-callback
  ...
  &calculate.addresses.anonymous-address-1.id=739030698069958
  &calculate.addresses.anonymous-address-1.country-code=US
  &calculate.addresses.anonymous-address-1.city=Mountain%20View
  &calculate.addresses.anonymous-address-1.region=CA
  &calculate.addresses.anonymous-address-1.postal-code=94043
  &calculate.merchant-code-strings.merchant-code-string-1.code=GiftCard12345
  &calculate.merchant-code-strings.merchant-code-string-2.code=FirstVisitCoupon

Sample merchant-calculation-callback Request

This section describes a merchant's interactions with the Merchant Calculations API for a sample order with the following characteristics:

  • The merchant has indicated that it will calculate shipping costs, taxes and price adjustments for coupons or gift certificates.

  • The merchant offers three shipping options for overnight, two-day and ground shipping.

  • The merchant uses address filters to indicate that the overnight shipping option is not available for shipping addresses in Alaska and Hawaii.

The following list identifies the different user actions that would prompt Google Checkout to send a merchant-calculation-callback request for this order.

  1. The buyer clicks the Google Checkout button on the merchant's page and proceeds to the Sign In/Sign Up page in the Google Checkout order flow. The buyer creates a new Google user account and enters a billing address in New York, prompting Google to send a merchant-calculation-callback request with that address. The callback request asks the merchant to calculate shipping costs for all three of the merchant's shipping options.

  2. The buyer adds a new shipping address in Alaska, prompting Google to send a second callback request with the new address. Since overnight shipping to Alaska is not available, this callback request specifies that the merchant only needs to calculate shipping costs for the two-day and ground shipping options.

  3. The buyer adds a coupon code, prompting Google to send a third request. Like the previous callback, this request instructs the merchant to calculate costs for two shipping options. The request also provides the buyer's coupon code.

  4. The buyer adds a gift certificate code, prompting Google to send a fourth request. This request contains the same instructions for calculating shipping costs as the previous two requests as well as the coupon code and the gift certificate code.

The following excerpt shows the last of these callback requests. The example contains two method parameters, which identify the shipping methods for which the merchant must calculate shipping costs. The request also contains two merchant-code-string parameters, each of which could hold either a coupon code or a gift certificate code. Finally, the request indicates that the merchant should calculate tax for the order.

_type=merchant-calculation-callback
  &shopping-cart.cart-expiration.good-until-date=2007-12-31T23%3A59%3A59-05%3A00
  &shopping.items.item-1.merchant-item-id=GGLAA1453
  &shopping.items.item-1.item-name=Dry%20Food%20Pack
  &shopping.items.item-1.item-description=One%20pack%20of%20nutritious%20dried%20food%20for%20emergencies.
  &shopping.items.item-1.quantity=1
  &shopping.items.item-1.unit-price=4.99
  &shopping.items.item-1.unit-price.currency=USD
  &shopping.items.item-2.merchant-item-id=MGS2GBMP3
  &shopping.items.item-2.item-name=Megasound%202GB%20MP3%20Player
  &shopping.items.item-2.item-description=This%20portable%20MP3%20player%20stores%900%20songs.
  &shopping.items.item-2.quantity=1
  &shopping.items.item-2.unit-price=79.99
  &shopping.items.item-2.unit-price.currency=USD
  &buyer-language=en_US

  &calculate.addresses.anonymous-address-1.id=739030698069958
  &calculate.addresses.anonymous-address-1.country-code=US
  &calculate.addresses.anonymous-address-1.city=Anchorage
  &calculate.addresses.anonymous-address-1.region=CA
  &calculate.addresses.anonymous-address-1.postal-code=99501
  &calculate.tax=true
  &calculate.shipping.method-1.name=FedEx%20Two-day%20Shipping
  &calculate.shipping.method-2.name=UPS%20Ground
  &calculate.merchant-code-strings.merchant-code-string-1.code=GiftCard12345
  &calculate.merchant-code-strings.merchant-code-string-2.code=FirstVisitCoupon

Returning Merchant Calculation Results

Each time you receive a <merchant-calculation-callback> request, you must process the request, calculate the appropriate values and return a <merchant-calculation-results> XML response.

The following guidelines explain how to create a <merchant-calculation-results> response.

  • If you use merchant-calculated shipping methods, your response will contain one set of calculated costs for each of those methods. In the response, the HTML parameter names will associate an index value with the recurring result element to associate calculated amounts with a particular shipping method. For each result, you must provide all calculated amounts – including shipping costs, taxes and price adjustments – that the callback requested.

    If you do not use merchant-calculated shipping methods, your response will only contain one set of calculated amounts. In the response, all of the HTML parameter names will specify the index value of 1 for the result element.

  • The address-id parameter identifies the shipping address associated with the result. The parameter value must correspond to the id parameter value in the callback as shown in the sample parameters below. Note that since each <merchant-calculation-callback> request only specifies one address, this value will be the same for each set of calculated results in your response.

    Callback
    _type=merchant-calculation-callback
      &calculate.addresses.anonymous-address-1.id=739030698069958
      ...
    
    Response
    _type=merchant-calculation-results
      &results.result-1.shipping-name=UPS%20Ground
      &results.result-1.address-id=739030698069958
      ...
    
  • Each result also contains additional information depending on the types of calculations that you performed. Follow all applicable guidelines to create a <merchant-calculation-results> response.

    • Shipping - Set the following values if you are calculating shipping costs for an order.

      • The shipping-name parameter, which is only present if you are calculating shipping costs, identifies the shipping method associated with the result. The parameter value must correspond to the name of a shipping method specified in the callback as shown in the sample parameters below. Note that this value will be different for each set of calculated results in a response.

        Callback
        _type=merchant-calculation-callback
          ...
          &calculate.shipping.method-1.name=UPS%20Ground
        
        Response
        _type=merchant-calculation-results
          &results.result-1.shipping-name=UPS%20Ground
          &results.result-1.address-id=739030698069958
          ...
        
      • The shipping-rate parameter specifies the cost of shipping the order to the address location using the specified shipping method.

      • The shippable parameter indicates whether the order can be shipped to the specified address using the specified shipping method. For example, you could set the shippable parameter to false to prevent a shipping method from being used to ship an order to a post office box. If a shipping method is not available at a particular address, Google Checkout will not display that shipping option when the customer selects that address.

    • Taxes - If you need to calculate taxes for the order, each result must specify a total-tax parameter, which identifies the tax that should be charged for the corresponding shipping method and shipping address.

    • Coupons - If you are supposed to calculate price adjustments for coupons, each result set of calculated amounts must contain the code and valid parameters for each coupon code identified in the callback request. These parameters identify each coupon and indicate whether that coupon can be used. In addition, the response may also provide the message and calculated-amount parameters for each coupon.

    • Gift Certificates - If you are supposed to calculate price adjustments for gift certificates, each result set of calculated amounts must contain the code and valid parameters for each gift certificate code identified in the callback request. These parameters identify each gift certificate and indicate whether that gift certificate can be used. In addition, the response may also provide the message and calculated-amount parameters for each gift certificate.

When you have finished creating the <merchant-calculation-results> response, return it to Google as an HTTP response to the callback.

Sample merchant-calculation-results Response

The following HTML shows a sample <merchant-calculation-results> response. This response corresponds to the sample <merchant-calculation-callback> request in the previous section. The response contains calculations for two shipping methods, taxes, one coupon code and one gift certificate code.

HTML Parameter Definitions

Checkout API Tags for All Orders Using Merchant Calculations

merchant-calculations-url

The merchant-calculations-url parameter identifies the URL to which Google Checkout should send merchant-calculation-callback requests. Merchants only need to include this parameter in Checkout API requests if they have implemented the Merchant Calculations API.

Note: Your production calculation service must use port 443, which is the default port for HTTPS. You can use either port 443 or port 80 for your callback URL in the Sandbox environment.

API commands


Content format for parameter value


String (URI)

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.merchant-calculations-url" value="http://calculations.example.com"/>

Additional Checkout API Tags - Shipping

allow-us-po-box

The allow-us-po-box parameter indicates whether a particular shipping method can be used to ship an order to a U.S. post office (P.O.) box. To prevent a flat-rate shipping option from being offered to customers who are shipping orders to P.O. boxes in the United States, include this parameter with a value of false in the shipping-restrictions for the shipping option. The default value for this parameter is true.

Associated recurring elements


The flat-rate-shipping or merchant-calculated-shipping element needs to be numbered to associate the shipping restriction (or address filter) with the appropriate shipping method.

API commands


Content format for parameter value


Boolean

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.allow-us-po-box" value="false"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].allow-us-po-box" value="false"/>

country-area
The country-area parameter identifies a region of the United States. Valid values for this parameter are:
CONTINENTAL_48 - All U.S. states except Alaska and Hawaii
FULL_50_STATES - All U.S. states
ALL - All U.S. postal service addresses, including military addresses, U.S. insular areas, etc.

Associated recurring elements


When the country-area parameter is associated with a shipping method, the us-country-area element and either the flat-rate-shipping or merchant-calculated-shipping element need to be numbered. When the country-area parameter is associated with a default tax table, the default-tax-rule and us-country-area elements must both be numbered. When the country-area parameter is associated with an alternate tax table, the alternate-tax-table, alternate-tax-rule and us-country-area elements must all be numbered.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.[allowed-areas | excluded-areas].us-country-area-#.country-area" value="CONTINENTAL_48"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].[allowed-areas | excluded-areas].us-country-area-#.country-area" value="CONTINENTAL_48"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.default-tax-rule-#.tax-areas.us-country-area-#.country-area" value="CONTINENTAL_48"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.alternate-tax-rule-#.tax-areas.us-country-area-#.country-area" value="CONTINENTAL_48"/>


currency
The currency parameter identifies the unit of currency associated with a price, shipping cost or other monetary value. Every monetary value in a Google Checkout API request must specify the currency associated with that value. The value of the currency parameter must be a three-letter ISO 4217 currency code.

Associated recurring elements


The currency parameter includes recurring elements any time the monetary value associated with the currency also contains a recurring element. For example, in a Checkout API request, the unit-price parameter identifies the price of an item and contains the recurring item element. As such, the currency associated with the unit-price parameter value will also contain the repeating price parameter.

API commands


Content format for parameter value


String

Sample use(s)


In a Checkout API request:
item type="hidden" name="shopping-cart.items.item-1.unit-price" value="12.99"
item type="hidden" name="shopping-cart.items.item-1.unit-price.currency" value="USD"

In a new order notification:
order-adjustment.total-tax=1.38&order-adjustment.total-tax.currency=USD

In a refund order request:
amount=12.99&amount.currency=USD


merchant-calculations-url

The merchant-calculations-url parameter identifies the URL to which Google Checkout should send merchant-calculation-callback requests. Merchants only need to include this parameter in Checkout API requests if they have implemented the Merchant Calculations API.

Note: Your production calculation service must use port 443, which is the default port for HTTPS. You can use either port 443 or port 80 for your callback URL in the Sandbox environment.

API commands


Content format for parameter value


String (URI)

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.merchant-calculations-url" value="http://calculations.example.com"/>

name

In a Checkout API request, the name parameter value contains a string that can be used to identify a tax table or shipping method. The parameter value must be at least one non-space character and may not be longer than 255 characters. The name parameter can also be used in a Checkout API request to identify the name of a query string parameter that will be included in a web beacon URL for third-party conversion tracking. The parameter's value is the name that the third-party tracking provider uses in its web beacon URLs.

In a merchant calculation callback, the name parameter identifies the name of a shipping method.

In a new order notification, the name parameter specifies the name that Google uses to identify a promotion in the Merchant Center.

Associated recurring elements


When the name parameter specifies the name of a query string parameter that will be included in a web beacon URL for third-party conversion tracking, the parameterized-url element must be numbered to associate the URL with a particular web beacon. In addition, the url-parameter element must be numbered so that the parameter name may be associated with the parameter value, which is expressed using the type parameter. When the name parameter is associated with an alternate tax table, the alternate-tax-table element must be numbered. When the name parameter is associated with a shipping method in a Checkout API request, either the flat-rate-shipping, merchant-calculated-shipping or pickup element need to be numbered. When the name parameter is associated with a shipping method in a merchant calculation callback, the method element will be numbered. Finally, when the name parameter is associated with a promotion, the promotion element must be numbered so that the promotion name can be associated with a specific promotion.

Content format for parameter value


String

Sample use(s)


Identifying a shipping method in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.[flat-rate-shipping-# |merchant-calculated-shipping-# | pickup-shipping-#].name" value="Standard shipping"/

Identifying a tax table in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.name" value="reduced"/

Identifying a URL parameter in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-#.parameters.url-parameter-#.name" value="taxes"/

Identifying a shipping method in a merchant calculation callback:
calculate.shipping.method-#.name=FedEx

Identifying a promotion in a new order notification:
promotions.promotion-#.name=Google+10+off+50


postal-code-pattern

The postal-code-pattern parameter contains a postal code or a range of postal codes for a specific country. To specify a range of postal codes, use an asterisk as a wildcard operator. For example, you can provide a postal-code-pattern value of SW* to indicate that a shipping option is available or a tax rule applies in any postal code beginning with the characters SW.

Associated recurring elements


When the postal-code-pattern parameter is associated with a shipping method, the postal-area element and either the flat-rate-shipping or merchant-calculated-shipping element need to be numbered. When the postal-code-pattern parameter is associated with a default tax table, the default-tax-rule and postal-area elements must both be numbered. When the postal-code-pattern parameter is associated with an alternate tax table, the alternate-tax-table, alternate-tax-rule and postal-area elements must all be numbered.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.[allowed-areas | excluded-areas].postal-area.postal-code-pattern" value="SW*"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].[allowed-areas | excluded-areas].postal-area.postal-code-pattern" value="SW*"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.default-tax-rule-#.tax-areas.postal-area-#.postal-code-pattern" value="SW*"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.alternate-tax-rule-#.tax-areas.postal-area-#.postal-code-pattern" value="SW*"/>


price

The price parameter contains the cost to ship an order using a particular shipping method.

Associated recurring elements


The parameter name must contain one of the flat-rate-shipping, pickup or merchant-calculated-shipping elements, and that element must be numbered to associate the price with a particular shipping method.

API commands


Content format for parameter value


Decimal

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.price" value="3.99"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.pickup-#.price" value="0.00"/>
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.price" value="9.99"/>

state

The state parameter identifies a state where a particular tax rule is applied or where a particular shipping option is available or unavailable.

Associated recurring elements


When the state parameter is associated with a shipping method, the us-state-area element and either the flat-rate-shipping or merchant-calculated-shipping element need to be numbered. When the state parameter is associated with a default tax table, the default-tax-rule and us-state-area elements must both be numbered. When the state parameter is associated with an alternate tax table, the alternate-tax-table, alternate-tax-rule and us-state-area elements must all be numbered.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.[allowed-areas | excluded-areas].us-state-area-#.state" value="CT"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].[allowed-areas | excluded-areas].us-state-area-#.state" value="CT"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.default-tax-rule-#.tax-areas.us-state-area-#.state" value="CT"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.alternate-tax-rule-#.tax-areas.us-state-area-#.state" value="CT"/>


world-area

The world-area parameter represents the entire world. This parameter indicates that a shipping option is available worldwide or that a particular tax rule applies worldwide.

For shipping options, the world-area parameter can only appear as a subtag of the allowed-areas parameter. (Including the world-area parameter as a subtag of the excluded-areas parameter would make the corresponding shipping option unavailable to all shipping addresses.) However, you can use the world-area parameter to indicate that a shipping option is available worldwide and then identify specific excluded areas where the shipping option is unavailable. Those excluded areas could identify regions that are covered by other shipping options or regions where you do not ship items.

For tax rules, Google Checkout will select the first tax rule that matches the customer's shipping address. As such, if you use the world-area parameter to define the area where a tax rule applies, that tax rule must appear last in the list of tax rules in your API request. See the XML Examples for Tax Areas to see a feed excerpt that uses the world-area parameter for tax rules.

Associated recurring elements


When the world-area parameter is associated with a shipping method, the world-area element and either the flat-rate-shipping or merchant-calculated-shipping element need to be numbered. When the world-area parameter is associated with a default tax table, the default-tax-rule and world-area elements must both be numbered. When the world-area parameter is associated with an alternate tax table, the alternate-tax-table, alternate-tax-rule and world-area elements must all be numbered.

API commands


Content format for parameter value


Complex

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.[allowed-areas | excluded-areas].world-area-#" value=""/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].[allowed-areas | excluded-areas].world-area-#" value=""/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.default-tax-rule-#.tax-areas.world-area-#" value=""/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.alternate-tax-rule-#.tax-areas.world-area-#" value=""/>


zip-pattern

The zip-pattern parameter contains a zip code or a range of zip codes. To specify a range of zip codes, use an asterisk as a wildcard operator. For example, you can specify that a shipping option is available or a tax rule applies to zip codes 94040 through 94049 by entering 9404* as the zip-pattern value.

Associated recurring elements


When the zip-pattern parameter is associated with a shipping method, the us-zip-area element and either the flat-rate-shipping or merchant-calculated-shipping element need to be numbered. When the zip-pattern parameter is associated with a default tax table, the default-tax-rule and us-zip-area elements must both be numbered. When the zip-pattern parameter is associated with an alternate tax table, the alternate-tax-table, alternate-tax-rule and us-zip-area elements must all be numbered.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.flat-rate-shipping-#.shipping-restrictions.[allowed-areas | excluded-areas].us-zip-area-#.zip-pattern" value="100*"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.merchant-calculated-shipping-#.[shipping-restrictions | address-filters].[allowed-areas | excluded-areas].us-zip-area-#.zip-pattern" value="100*"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.default-tax-table.default-tax-rule-#.tax-areas.us-zip-area-#.zip-pattern" value="94043"/>

<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.alternate-tax-rule-#.tax-areas.us-zip-area-#.zip-pattern" value="94043"/>


Additional Checkout API Tags - Taxes

merchant-calculated
The merchant-calculated parameter contains a Boolean value that indicates whether tax for the order is calculated using a special process.

API commands


Content format for parameter value


Boolean

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.merchant-calculated" value=""/>

Additional Checkout API Tags - Gift Certificates

accept-gift-certificates

The accept-gift-certificates parameter indicates whether customers should be able to apply gift certificates to their order totals. If this parameter has a value of true, then Google Checkout will display an option for customers to enter gift certificate codes. These codes will then be passed to the merchant in a merchant-calculation-callback request.

API commands


Content format for parameter value


Boolean

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.accept-gift-certificates" value="true"/>

Additional Checkout API Tags - Coupons

accept-merchant-coupons

The accept-merchant-coupons parameter indicates whether customers should be able to apply coupon codes to their order totals. If this parameter has a value of true, then Google Checkout will display an option for customers to enter coupon codes. These codes will then be passed to the merchant in a merchant-calculation-callback request.

API commands


Content format for parameter value


Boolean

Sample use(s)


<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.merchant-calculations.accept-merchant-coupons" value="true"/>

Merchant Calculation Callbacks

_type

The _type parameter identifies the type of API request that is being submitted. Google will send this parameter in any API transaction, including synchronous responses, merchant calculation callbacks and notifications. You must also send this parameter for all API requests other than Checkout API requests, including merchant calculation results and Order Processing API commands.

Valid values for this parameter are:

add-merchant-order-number
add-tracking-data
archive-order
authorization-amount-notification
authorize-order
backorder-items
cancel-items
cancel-order
charge-amount-notification
chargeback-amount-notification
charge-order
checkout-redirect
deliver-order
demo-failure
diagnosis
error
merchant-calculation-callback
merchant-calculation-results
new-order-notification
notification-acknowledgment
order-state-change-notification
process-order
refund-amount-notification
refund-order
request-received
reset-items-shipping-information
return-items
risk-information-notification
send-buyer-message
ship-items
unarchive-order

Note: The value of the type parameter corresponds to the root tag of an XML API request.

Content format for parameter value


String

Sample use(s)


_type=new-order-notification
_type=ship-items
_type=merchant-calculation-results

buyer-id

The buyer-id parameter contains an ID that uniquely identifies the user to Google.

API commands


Content format for parameter value


Long

Sample use(s)


buyer-id=294873009217523

buyer-language

The buyer-language parameter identifies the customer's user interface language. At this time, this value is always en_US.

API commands


Content format for parameter value


String

Sample use(s)


buyer-language=en_US

city

The city parameter identifies the city associated with an order's billing or shipping address.

API commands


Content format for parameter value


String

Sample use(s)


In a carrier-calculated-shipping option in a Checkout API request:
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.ship-from.city" value="Mountain View"/>

In a merchant calculation callback:
calculate.addresses.anonymous-address-1.city=Mountain+View

In a new order notification:
[buyer-billing-address | buyer-shipping-address].city=Mountain+View

In a risk information notification:
billing-address.city=Mountain+View


code

The code parameter contains the code for a coupon or gift certificate that a customer would like to apply to an order or that was applied to an order.

Associated recurring elements


In a new order notification, the code parameter must contain either the coupon-adjustment or the gift-certificate-adjustment element, and that element must be numbered. In a merchant calculation callback request, the code parameter contains a numbered merchant-code-string element. In a merchant calculation results response, the code parameter must contain a numbered result element and either the coupon-result or the gift-certificate-result element, which must also be numbered.

API commands


Content format for parameter value


String

Sample use(s)


In a new order notification:
order-adjustment.merchant-codes.[coupon-adjustment-# | gift-certificate-adjustment-#].code=12345

In a merchant calculation callback:
calculate.merchant-code-strings.merchant-code-string-#.code=12345

In a merchant-calculation-results response:
results.result-#.merchant-code-results.[coupon-result-# | gift-certificate-result-#].code=12345


company-name

The company-name parameter identifies the company to which an order is being shipped. Please note that Google does not currently request this information from customers but may do so in the future. However, until then, this parameter will contain an empty value.

API commands


Content format for parameter value


String

Sample use(s)


In a new order notification:
[buyer-billing-address | buyer-shipping-address].company-name=Vandalay+Industries

In a risk information notification:
billing-address.company-name=Vandalay+Industries


contact-name

The contact-name parameter identifies the person to whom an order is being shipped.

API commands


Content format for parameter value


String

Sample use(s)


In a new order notification:
[buyer-billing-address | buyer-shipping-address].contact-name=Art+Vandalay

In a risk information notification:
billing-address.contact-name=Art+Vandalay


country-code

As a subtag of postal-area, the country-code parameter specifies a country associated with a tax areashipping restriction or address filter. In all other contexts, the country-code parameter identifies the country code associated with an order's billing address or shipping address. The value of this parameter must be a two-letter ISO 3166 country code.

Associated recurring elements


When the country-code parameter appears in a carrier-calculated shipping option in a Checkout API request, the shipping-package element must be numbered. In addition, the carrier-calculated-shipping element must be numbered with a value of 1. When Google sends this parameter in a merchant calculation callback, the anonymous-address element will be numbered with a value of 1.

API commands


Content format for parameter value


String

Sample use(s)


In a carrier-calculated-shipping option in a Checkout API request:
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.ship-from.country-code" value="US"/>

In a merchant calculation callback:
calculate.addresses.anonymous-address-1.country-code=US

In a new order notification:
[buyer-billing-address | buyer-shipping-address].country-code=US

In a risk information notification:
billing-address.country-code=US


currency
The currency parameter identifies the unit of currency associated with a price, shipping cost or other monetary value. Every monetary value in a Google Checkout API request must specify the currency associated with that value. The value of the currency parameter must be a three-letter ISO 4217 currency code.

Associated recurring elements


The currency parameter includes recurring elements any time the monetary value associated with the currency also contains a recurring element. For example, in a Checkout API request, the unit-price parameter identifies the price of an item and contains the recurring item element. As such, the currency associated with the unit-price parameter value will also contain the repeating price parameter.

API commands


Content format for parameter value


String

Sample use(s)


In a Checkout API request:
item type="hidden" name="shopping-cart.items.item-1.unit-price" value="12.99"
item type="hidden" name="shopping-cart.items.item-1.unit-price.currency" value="USD"

In a new order notification:
order-adjustment.total-tax=1.38&order-adjustment.total-tax.currency=USD

In a refund order request:
amount=12.99&amount.currency=USD


good-until-date

The good-until-date parameter identifies the date that the order in a Checkout API request expires. The date must be specified using the ISO 8601 Date and Time Format. The time must include the time-zone designator for UTC (Coordinated Universal Time), which is "Z", or you may specify a local time along with a time-zone offset in hours and minutes. A time zone offset of "+hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes ahead of UTC. A time zone offset of "-hh:mm" indicates that the date/time uses a local time zone which is "hh" hours and "mm" minutes behind UTC. The examples show dates formatted using the UTC time-zone designator and using time-zone offsets.

Note: If you specify a value for this element, Google Checkout will reject the shopping cart if the user submits the cart after the specified date.

API commands


Content format for parameter value


Date/Time

Sample use(s)


<input type="hidden" name="shopping-cart.cart-expiration.good-until-date" value="2007-12-31T11:59:59-05:00"/>

Sample use(s)


In a Checkout API request:
<input type="hidden" name="shopping-cart.cart-expiration.good-until-date" value="2007-12-31T11:59:59-05:00"/>

In a merchant calculation callback or new order notification:
shopping-cart.cart-expiration.good-until-date=2007-12-31T11%3A59%3A59-05%3A00


id

When the id parameter appears in a merchant calculation callback or when it is used to identify the point from which a package will be shipped for carrier-calculated shipping in a Checkout API request, the id parameter specifies a value that uniquely identifies an address. When it appears in a new order notification, the id parameter specifies a value that uniquely identifies a Google Checkout promotion.

Associated recurring elements


In a Checkout API request, the carrier-calculated-shipping element must be numbered with a value of 1 and the shipping-package element must also be numbered. In a merchant calculation callback, the anonymous-address element will be numbered with a value of 1. In a new order notification, the promotion element will be numbered so that the promotion ID can be associated with a specific promotion.

API commands


Content format for parameter value


String

Sample use(s)


In a merchant calculation callback:
calculate.addresses.anonymous-address-1.id=135abc

In a new order notification:
promotions.promotion-#.id=4910


item-description

The item-description parameter contains a description of an item.

Associated recurring elements


The item element, which must be numbered, associates this parameter with a specific item in an order.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="shopping-cart.items.item-#.item-description" value="Easy to use MP3 Player"/>
<input type="hidden" name="item_description_#" value="Easy to use MP3 Player"/>

item-name

The item-name parameter identifies the name of an item.

Associated recurring elements


The item element, which must be numbered, associates this parameter with a specific item in an order.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="shopping-cart.items.item-#.item-name" value="HelloWorld 2GB MP3 Player"/>

merchant-item-id

The merchant-item-id parameter contains a value, such as a stock keeping unit (SKU), that you use to uniquely identify an item. Google Checkout will include this value in the merchant calculation callbacks and the new order notification for the order. This value also appears in the order information displayed in the Merchant Center.

Note: To use the merchant-item-id to modify the shipping information for an item in an order, you must have provided the same merchant-item-id for that item in the Checkout API request for the order.

Associated recurring elements


The item element, which must be numbered, associates this parameter with a specific item in an order.

API commands


Content format for parameter value


String

Sample use(s)


<input type="hidden" name="shopping-cart.items.item-#.merchant-item-id" value="1234abcd"/>

name

In a Checkout API request, the name parameter value contains a string that can be used to identify a tax table or shipping method. The parameter value must be at least one non-space character and may not be longer than 255 characters. The name parameter can also be used in a Checkout API request to identify the name of a query string parameter that will be included in a web beacon URL for third-party conversion tracking. The parameter's value is the name that the third-party tracking provider uses in its web beacon URLs.

In a merchant calculation callback, the name parameter identifies the name of a shipping method.

In a new order notification, the name parameter specifies the name that Google uses to identify a promotion in the Merchant Center.

Associated recurring elements


When the name parameter specifies the name of a query string parameter that will be included in a web beacon URL for third-party conversion tracking, the parameterized-url element must be numbered to associate the URL with a particular web beacon. In addition, the url-parameter element must be numbered so that the parameter name may be associated with the parameter value, which is expressed using the type parameter. When the name parameter is associated with an alternate tax table, the alternate-tax-table element must be numbered. When the name parameter is associated with a shipping method in a Checkout API request, either the flat-rate-shipping, merchant-calculated-shipping or pickup element need to be numbered. When the name parameter is associated with a shipping method in a merchant calculation callback, the method element will be numbered. Finally, when the name parameter is associated with a promotion, the promotion element must be numbered so that the promotion name can be associated with a specific promotion.

Content format for parameter value


String

Sample use(s)


Identifying a shipping method in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.[flat-rate-shipping-# |merchant-calculated-shipping-# | pickup-shipping-#].name" value="Standard shipping"/

Identifying a tax table in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.tax-tables.alternate-tax-tables.alternate-tax-table-#.name" value="reduced"/

Identifying a URL parameter in a Checkout API request:
input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.parameterized-urls.parameterized-url-#.parameters.url-parameter-#.name" value="taxes"/

Identifying a shipping method in a merchant calculation callback:
calculate.shipping.method-#.name=FedEx

Identifying a promotion in a new order notification:
promotions.promotion-#.name=Google+10+off+50


postal-code

The postal-code parameter identifies the zip code or postal code associated with either a billing address or a shipping address.

Associated recurring elements


When the postal-code parameter appears in a carrier-calculated shipping option in a Checkout API request, the shipping-package element must be numbered. In addition, the carrier-calculated-shipping element must be numbered with a value of 1. When Google sends this parameter in a merchant calculation callback, the anonymous-address element will be numbered with a value of 1.

API commands


Content format for parameter value


String

Sample use(s)


In a carrier-calculated-shipping option in a Checkout API request:
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.ship-from.postal-code" value="94043"/>

In a merchant calculation callback:
calculate.addresses.anonymous-address-1.postal-code=94043

In a new order notification:
[buyer-billing-address | buyer-shipping-address].postal-code=94043

In a risk information notification:
billing-address.postal-code=94043


quantity

The quantity parameter identifies how many units of a particular item are included in the customer's shopping cart.

Associated recurring elements


The item element, which must be numbered, associates this parameter with a specific item in an order.

API commands


Content format for parameter value


Integer

Sample use(s)


<input type="hidden" name="shopping-cart.items.item-#.quantity" value="2"/>

region

The region parameter identifies the state or province associated with a billing address or shipping address.

Associated recurring elements


When the region parameter appears in a carrier-calculated shipping option in a Checkout API request, the shipping-package element must be numbered. In addition, the carrier-calculated-shipping element must be numbered with a value of 1. When Google sends this parameter in a merchant calculation callback, the anonymous-address element will be numbered with a value of 1.

API commands


Content format for parameter value


String

Sample use(s)


In a carrier-calculated-shipping option in a Checkout API request:
<input type="hidden" name="checkout-flow-support.merchant-checkout-flow-support.shipping-methods.carrier-calculated-shipping-1.shipping-packages.shipping-package-#.ship-from.region" value="CA"/>

In a merchant calculation callback:
calculate.addresses.anonymous-address-1.region=US

In a new order notification:
[buyer-billing-address | buyer-shipping-address].region=CA

In a risk information notification:
billing-address.region=CA


serial-number
The serial-number parameter contains an ID that uniquely identifies a Google Checkout notification.

API commands


Content format for parameter value


String

Sample use(s)


serial-number=dc66f8c7

tax

The tax parameter indicates whether the merchant needs to calculate taxes for the order.

Associated recurring elements


The result element must be numbered to associate the calculated tax with the calculated shipping amount for a particular shipping method.

API commands


Content format for parameter value


Boolean

Sample use(s)


results.result-#.tax=true

unit-price

The unit-price parameter identifies the cost of the item.

Associated recurring elements


The item element, which must be numbered, associates this parameter with a specific item in an order.

API commands


Content format for parameter value


Decimal

Sample use(s)


<input type="hidden" name="shopping-cart.items.item-#.unit-price" value="49.99"/>

Merchant Calculation Results

_type

The _type parameter identifies the type of API request that is being submitted. Google will send this parameter in any API transaction, including synchronous responses, merchant calculation callbacks and notifications. You must also send this parameter for all API requests other than Checkout API requests, including merchant calculation results and Order Processing API commands.

Valid values for this parameter are:

add-merchant-order-number
add-tracking-data
archive-order
authorization-amount-notification
authorize-order
backorder-items
cancel-items
cancel-order
charge-amount-notification
chargeback-amount-notification
charge-order
checkout-redirect
deliver-order
demo-failure
diagnosis
error
merchant-calculation-callback
merchant-calculation-results
new-order-notification
notification-acknowledgment
order-state-change-notification
process-order
refund-amount-notification
refund-order
request-received
reset-items-shipping-information
return-items
risk-information-notification
send-buyer-message
ship-items
unarchive-order

Note: The value of the type parameter corresponds to the root tag of an XML API request.

Content format for parameter value


String

Sample use(s)


_type=new-order-notification
_type=ship-items
_type=merchant-calculation-results

address-id
The address-id parameter contains an ID that identifies the shipping address associated with a result in a merchant calculation results response. The parameter value must correspond to the id of the anonymous address in the merchant calculation callback.

API commands


Content format for parameter value


String

Sample use(s)


merchant-calculation-results.results.result-#.address-id=938515801

calculated-amount

The calculated-amount parameter contains the calculated amount of a coupon or gift certificate.

Associated recurring elements


In a new order notification, the calculated-amount parameter must contain either the coupon-adjustment or the gift-certificate-adjustment element, and that element must be numbered. In a merchant calculation results response, the calculated-amount parameter must contain a numbered result element and either the coupon-result or the gift-certificate-result element, which must also be numbered.

API commands


Content format for parameter value


Decimal

Sample use(s)


In a new order notification:
order-adjustment.merchant-codes.[coupon-adjustment-# | gift-certificate-adjustment-#].calculated-amount=10.00

In a merchant-calculation-results response:
results.result-#.merchant-code-results.[coupon-result-# | gift-certificate-result-#].calculated-amount=10.00


code

The code parameter contains the code for a coupon or gift certificate that a customer would like to apply to an order or that was applied to an order.

Associated recurring elements


In a new order notification, the code parameter must contain either the coupon-adjustment or the gift-certificate-adjustment element, and that element must be numbered. In a merchant calculation callback request, the code parameter contains a numbered merchant-code-string element. In a merchant calculation results response, the code parameter must contain a numbered result element and either the coupon-result or the gift-certificate-result element, which must also be numbered.

API commands


Content format for parameter value


String

Sample use(s)


In a new order notification:
order-adjustment.merchant-codes.[coupon-adjustment-# | gift-certificate-adjustment-#].code=12345

In a merchant calculation callback:
calculate.merchant-code-strings.merchant-code-string-#.code=12345

In a merchant-calculation-results response:
results.result-#.merchant-code-results.[coupon-result-# | gift-certificate-result-#].code=12345


currency
The currency parameter identifies the unit of currency associated with a price, shipping cost or other monetary value. Every monetary value in a Google Checkout API request must specify the currency associated with that value. The value of the currency parameter must be a three-letter ISO 4217 currency code.

Associated recurring elements


The currency parameter includes recurring elements any time the monetary value associated with the currency also contains a recurring element. For example, in a Checkout API request, the unit-price parameter identifies the price of an item and contains the recurring item element. As such, the currency associated with the unit-price parameter value will also contain the repeating price parameter.

API commands