Orders: gettestordertemplate

Requires authorization

Sandbox only. Retrieves an order template that can be used to quickly create a new order in sandbox. Try it now.


HTTP request

GET https://www.googleapis.com/content/v2sandbox/merchantId/testordertemplates/templateName


Parameter name Value Description
Path parameters
merchantId unsigned long The ID of the account that should manage the order. This cannot be a multi-client account.
templateName string The name of the template to retrieve.

Acceptable values are:
  • "template1"
  • "template1a"
  • "template1b"
  • "template2"


This request requires authorization with the following scope (read more about authentication and authorization).


Request body

Do not supply a request body with this method.


If successful, this method returns a response body with the following structure:

  "kind": "content#ordersGetTestOrderTemplateResponse",
  "template": {
    "kind": "content#testOrder",
    "lineItems": [
        "product": {
          "offerId": string,
          "channel": string,
          "targetCountry": string,
          "contentLanguage": string,
          "title": string,
          "price": {
            "value": string,
            "currency": string
          "condition": string,
          "gtin": string,
          "brand": string,
          "mpn": string,
          "variantAttributes": [
              "dimension": string,
              "value": string
          "itemGroupId": string,
          "imageLink": string
        "quantityOrdered": unsigned integer,
        "unitTax": {
          "value": string,
          "currency": string
        "shippingDetails": {
          "method": {
            "methodName": string,
            "carrier": string,
            "minDaysInTransit": unsigned integer,
            "maxDaysInTransit": unsigned integer
          "shipByDate": string,
          "deliverByDate": string
        "returnInfo": {
          "isReturnable": boolean,
          "daysToReturn": integer,
          "policyUrl": string
    "shippingOption": string,
    "customer": {
      "fullName": string,
      "email": string,
      "explicitMarketingPreference": boolean
    "predefinedDeliveryAddress": string,
    "paymentMethod": {
      "type": string,
      "lastFourDigits": string,
      "predefinedBillingAddress": string,
      "expirationMonth": integer,
      "expirationYear": integer
    "shippingCost": {
      "value": string,
      "currency": string
    "shippingCostTax": {
      "value": string,
      "currency": string
    "promotions": [
        "id": string,
        "productApplicability": string,
        "longTitle": string,
        "effectiveDates": string,
        "redemptionChannel": string,
        "genericRedemptionCode": string,
        "benefits": [
            "offerIds": [
            "type": string,
            "subType": string,
            "discount": {
              "value": string,
              "currency": string
            "taxImpact": {
              "value": string,
              "currency": string
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#ordersGetTestOrderTemplateResponse".
template nested object The requested test order template.
template.kind string Identifies what kind of resource this is. Value: the fixed string "content#testOrder".
template.lineItems[] list Line items that are ordered. At least one line item must be provided.
template.lineItems[].product nested object Product data from the time of the order placement.
template.lineItems[].product.offerId string An identifier of the item.
template.lineItems[].product.channel string The item's channel.

Acceptable values are:
  • "online"
template.lineItems[].product.targetCountry string The CLDR territory code of the target country of the product.
template.lineItems[].product.contentLanguage string The two-letter ISO 639-1 language code for the item.

Acceptable values are:
  • "en"
template.lineItems[].product.title string The title of the product.
template.lineItems[].product.price nested object The price for the product.
template.lineItems[].product.price.value string The price represented as a number. writable
template.lineItems[].product.price.currency string The currency of the price. writable
template.lineItems[].product.condition string Condition or state of the item.

Acceptable values are:
  • "new"
template.lineItems[].product.gtin string Global Trade Item Number (GTIN) of the item. Optional.
template.lineItems[].product.brand string Brand of the item.
template.lineItems[].product.mpn string Manufacturer Part Number (MPN) of the item. Optional.
template.lineItems[].product.variantAttributes[] list Variant attributes for the item. Optional.
template.lineItems[].product.variantAttributes[].dimension string The dimension of the variant.
template.lineItems[].product.variantAttributes[].value string The value for the dimension.
template.lineItems[].product.itemGroupId string Shared identifier for all variants of the same product. Optional.
template.lineItems[].quantityOrdered unsigned integer Number of items ordered.
template.lineItems[].unitTax nested object Unit tax for the line item.
template.lineItems[].unitTax.value string The price represented as a number. writable
template.lineItems[].unitTax.currency string The currency of the price. writable
template.lineItems[].shippingDetails nested object Details of the requested shipping for the line item.
template.lineItems[].shippingDetails.method nested object Details of the shipping method.
template.lineItems[].shippingDetails.method.methodName string The name of the shipping method.
template.lineItems[].shippingDetails.method.carrier string The carrier for the shipping. Optional. See shipments[].carrier in the Orders resource representation for a list of acceptable values.
template.lineItems[].shippingDetails.method.minDaysInTransit unsigned integer Minimum transit time.
template.lineItems[].shippingDetails.method.maxDaysInTransit unsigned integer Maximum transit time.
template.lineItems[].shippingDetails.shipByDate string The ship by date, in ISO 8601 format.
template.lineItems[].shippingDetails.deliverByDate string The delivery by date, in ISO 8601 format.
template.lineItems[].returnInfo nested object Details of the return policy for the line item.
template.lineItems[].returnInfo.isReturnable boolean Whether the item is returnable.
template.lineItems[].returnInfo.daysToReturn integer How many days later the item can be returned.
template.lineItems[].returnInfo.policyUrl string URL of the item return policy.
template.shippingOption string The requested shipping option.

Acceptable values are:
  • "economy"
  • "expedited"
  • "oneDay"
  • "sameDay"
  • "standard"
  • "twoDay"
template.customer nested object The details of the customer who placed the order.
template.customer.fullName string Full name of the customer.
template.customer.email string Email address of the customer.

Acceptable values are:
  • "pog.dwight.schrute@gmail.com"
  • "pog.jim.halpert@gmail.com"
  • "pog.pam.beesly@gmail.com"
template.customer.explicitMarketingPreference boolean If set, this indicates the user explicitly chose to opt in or out of providing marketing rights to the merchant. If unset, this indicates the user has already made this choice in a previous purchase, and was thus not shown the marketing right opt in/out checkbox during the checkout flow. Optional.
template.predefinedDeliveryAddress string Identifier of one of the predefined delivery addresses for the delivery.

Acceptable values are:
  • "dwight"
  • "jim"
  • "pam"
template.paymentMethod nested object The details of the payment method.
template.paymentMethod.type string The type of instrument. Note that real orders might have different values than the four values accepted by createTestOrder.

Acceptable values are:
  • "AMEX"
  • "VISA"
template.paymentMethod.lastFourDigits string The last four digits of the card number.
template.paymentMethod.predefinedBillingAddress string The billing address.

Acceptable values are:
  • "dwight"
  • "jim"
  • "pam"
template.paymentMethod.expirationMonth integer The card expiration month (January = 1, February = 2 etc.).
template.paymentMethod.expirationYear integer The card expiration year (4-digit, e.g. 2015).
template.shippingCost nested object The total cost of shipping for all items.
template.shippingCost.value string The price represented as a number. writable
template.shippingCost.currency string The currency of the price. writable
template.shippingCostTax nested object The tax for the total shipping cost.
template.shippingCostTax.value string The price represented as a number. writable
template.shippingCostTax.currency string The currency of the price. writable
template.promotions[] list The details of the merchant provided promotions applied to the order. More details about the program are here.
template.promotions[].id string The unique ID of the promotion.
template.promotions[].productApplicability string Whether the promotion is applicable to all products or only specific products.

Acceptable values are:
  • "allProducts"
  • "specificProducts"
template.promotions[].longTitle string The full title of the promotion.
template.promotions[].effectiveDates string The date and time frame when the promotion is active and ready for validation review. Note that the promotion live time may be delayed for a few hours due to the validation review.
Start date and end date are separated by a forward slash (/). The start date is specified by the format (YYYY-MM-DD), followed by the letter ?T?, the time of the day when the sale starts (in Greenwich Mean Time, GMT), followed by an expression of the time zone for the sale. The end date is in the same format.
template.promotions[].redemptionChannel string Indicates that the promotion is valid online.

Acceptable values are:
  • "online"
template.promotions[].genericRedemptionCode string Optional. The text code that corresponds to the promotion when applied on the retailer?s website.
template.promotions[].benefits[] list
template.promotions[].benefits[].offerIds[] list The OfferId(s) that were purchased in this order and map to this specific benefit of the promotion.
template.promotions[].benefits[].type string Describes whether the promotion applies to products (e.g. 20% off) or to shipping (e.g. Free Shipping).

Acceptable values are:
  • "product"
  • "shipping"
template.promotions[].benefits[].subType string Further describes the benefit of the promotion. Note that we will expand on this enumeration as we support new promotion sub-types.

Acceptable values are:
  • "freeOvernightShipping"
  • "freeShipping"
  • "freeTwoDayShipping"
  • "moneyOff"
  • "percentageOff"
template.promotions[].benefits[].discount nested object The discount in the order price when the promotion is applied.
template.promotions[].benefits[].discount.value string The price represented as a number. writable
template.promotions[].benefits[].discount.currency string The currency of the price. writable
template.promotions[].benefits[].taxImpact nested object The impact on tax when the promotion is applied.
template.promotions[].benefits[].taxImpact.value string The price represented as a number. writable
template.promotions[].benefits[].taxImpact.currency string The currency of the price. writable

Send feedback about...

Content API for Shopping