Orders: setlineitemmetadata

Sets (or overrides if it already exists) merchant provided annotations in the form of key-value pairs. A common use case would be to supply us with additional structured information about a line item that cannot be provided via other methods. Submitted key-value pairs can be retrieved as part of the orders resource. Try it now.

Request

HTTP request

POST https://www.googleapis.com/content/v2/merchantId/orders/orderId/setLineItemMetadata

Parameters

Parameter name Value Description
Path parameters
merchantId unsigned long The ID of the account that manages the order. This cannot be a multi-client account.
orderId string The ID of the order.

Authorization

This request requires authorization with the following scope:

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

For more information, see the authentication and authorization page.

Request body

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

{
  "operationId": string,
  "lineItemId": string,
  "productId": string,
  "annotations": [
    {
      "key": string,
      "value": string
    }
  ]
}
Property name Value Description Notes
operationId string The ID of the operation. Unique across all operations for a given order.
lineItemId string The ID of the line item to set metadata. Either lineItemId or productId is required.
productId string The ID of the product to set metadata. This is the REST ID used in the products service. Either lineItemId or productId is required.
annotations[] list
annotations[].key string Key for additional merchant provided (as key-value pairs) annotation about the line item.
annotations[].value string Value for additional merchant provided (as key-value pairs) annotation about the line item.

Response

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

{
  "kind": "content#ordersSetLineItemMetadataResponse",
  "executionStatus": string
}
Property name Value Description Notes
kind string Identifies what kind of resource this is. Value: the fixed string "content#ordersSetLineItemMetadataResponse".
executionStatus string The status of the execution.

Acceptable values are:
  • "duplicate"
  • "executed"

Send feedback about...

Content API for Shopping