Orders: createtestorder

Requires authorization

Sandbox only. Creates a test order. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2.1sandbox/merchantId/testorders

Parameters

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.

Authorization

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

Scope
https://www.googleapis.com/auth/content

Request body

In the request body, supply data with the following structure:

{
  "country": string,
  "testOrder": {
    "kind": "content#testOrder",
    "lineItems": [
      {
        "product": {
          "offerId": 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,
        "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,
    "predefinedDeliveryAddress": string,
    "predefinedBillingAddress": string,
    "predefinedEmail": string,
    "shippingCost": {
      "value": string,
      "currency": string
    },
    "promotions": [
      {
        "merchantPromotionId": string,
        "type": string,
        "subtype": string,
        "funder": string,
        "title": string,
        "shortTitle": string,
        "priceValue": {
          "value": string,
          "currency": string
        },
        "taxValue": {
          "value": string,
          "currency": string
        },
        "applicableItems": [
          {
            "lineItemId": string,
            "productId": string,
            "quantity": integer
          }
        ],
        "appliedItems": [
          {
            "lineItemId": string,
            "productId": string,
            "quantity": integer
          }
        ]
      }
    ],
    "notificationMode": string,
    "enableOrderinvoices": boolean
  },
  "templateName": string
}
Property name Value Description Notes
country string The CLDR territory code of the country of the test order to create. Affects the currency and addresses of orders created via template_name, or the addresses of orders created via test_order.

Acceptable values are:
  • "US"
  • "FR"
Defaults to US.
testOrder nested object The test order to create.
testOrder.kind string Identifies what kind of resource this is. Value: the fixed string "content#testOrder".
testOrder.lineItems[] list Line items that are ordered. At least one line item must be provided.
testOrder.lineItems[].product nested object Product data from the time of the order placement.
testOrder.lineItems[].product.offerId string An identifier of the item.
testOrder.lineItems[].product.targetCountry string The CLDR territory code of the target country of the product.
testOrder.lineItems[].product.contentLanguage string The two-letter ISO 639-1 language code for the item.

Acceptable values are:
  • "en"
  • "fr"
testOrder.lineItems[].product.title string The title of the product.
testOrder.lineItems[].product.price nested object The price for the product. Tax is automatically calculated for MFL orders. For non-MFL orders, tax settings from Merchant Center are applied.
testOrder.lineItems[].product.price.value string The price represented as a number. writable
testOrder.lineItems[].product.price.currency string The currency of the price. writable
testOrder.lineItems[].product.condition string Condition or state of the item.

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

Acceptable values are:
  • "economy"
  • "expedited"
  • "oneDay"
  • "sameDay"
  • "standard"
  • "twoDay"
testOrder.predefinedDeliveryAddress string Identifier of one of the predefined delivery addresses for the delivery.

Acceptable values are:
  • "dwight"
  • "jim"
  • "pam"
testOrder.predefinedBillingAddress string The billing address.

Acceptable values are:
  • "dwight"
  • "jim"
  • "pam"
testOrder.shippingCost nested object The price of shipping for all items. Shipping tax is automatically calculated for MFL orders. For non-MFL orders, tax settings from Merchant Center are applied. Note that shipping is not taxed in certain states.
testOrder.shippingCost.value string The price represented as a number. writable
testOrder.shippingCost.currency string The currency of the price. writable
testOrder.promotions[] list Promotions associated with the order.
testOrder.promotions[].merchantPromotionId string This field is used to identify promotions within merchants' own systems.
testOrder.promotions[].type string The scope of the promotion.

Acceptable values are:
  • "product"
  • "shipping"
testOrder.promotions[].subtype string The category of the promotion.

Acceptable values are:
  • "buyMGetMoneyOff"
  • "buyMGetNMoneyOff"
  • "buyMGetNPercentOff"
  • "buyMGetPercentOff"
  • "freeGift"
  • "freeGiftWithItemId"
  • "freeGiftWithValue"
  • "freeShippingOvernight"
  • "freeShippingStandard"
  • "freeShippingTwoDay"
  • "moneyOff"
  • "percentOff"
  • "rewardPoints"
  • "salePrice"
testOrder.promotions[].funder string The party funding the promotion.

Acceptable values are:
  • "google"
  • "merchant"
testOrder.promotions[].title string The title of the promotion.
testOrder.promotions[].shortTitle string A short title of the promotion to be shown on the checkout page.
testOrder.promotions[].taxValue nested object Estimated discount applied to tax (if allowed by law).
testOrder.promotions[].taxValue.value string The price represented as a number. writable
testOrder.promotions[].taxValue.currency string The currency of the price. writable
testOrder.promotions[].applicableItems[] list Items which this promotion may be applied to. If empty, there are no restrictions on applicable items and quantity.
testOrder.promotions[].applicableItems[].lineItemId string
testOrder.promotions[].applicableItems[].productId string
testOrder.promotions[].applicableItems[].quantity integer The quantity of the associated product.
testOrder.promotions[].appliedItems[] list Items which this promotion have been applied to.
testOrder.promotions[].appliedItems[].lineItemId string
testOrder.promotions[].appliedItems[].productId string
testOrder.promotions[].appliedItems[].quantity integer The quantity of the associated product.
testOrder.notificationMode string Determines if test order must be pulled by merchant or pushed to merchant via push integration.

Acceptable values are:
  • "checkoutIntegration"
  • "merchantPull"
testOrder.enableOrderinvoices boolean Whether the orderinvoices service should support this order.
templateName string The test order template to use. Specify as an alternative to testOrder as a shortcut for retrieving a template and then creating an order using that template.

Acceptable values are:
  • "template1"
  • "template1a"
  • "template1b"
  • "template2"
testOrder.promotions[].priceValue nested object Estimated discount applied to price. Amount is pre-tax or post-tax depending on location of order.
testOrder.promotions[].priceValue.value string The price represented as a number. writable
testOrder.promotions[].priceValue.currency string The currency of the price. writable
testOrder.predefinedEmail string Email address of the customer.

Acceptable values are:
  • "pog.dwight.schrute@gmail.com"
  • "pog.jim.halpert@gmail.com"
  • "pog.pam.beesly@gmail.com"

Response

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

{
  "kind": "content#ordersCreateTestOrderResponse",
  "orderId": string
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#ordersCreateTestOrderResponse".
orderId string The ID of the newly created test order.

Enviar comentarios sobre…

Content API for Shopping