Skip to main content

Overview

The product pool of a line item holds the products that the line item can promote. Adding a product makes it available to the line item; it does not assign it to a Creative Product Collection. Removing a product takes it out of the pool, so the line item stops promoting it. Adding products is the step that follows creating a line item with Line Item Core. Identify eligible products to add by accessing your account catalog. Products can be removed from the pool at any point in the line item’s lifecycle. All three endpoints use the same product resource. A product is identified by its resource id, its type is always LineItemProduct, and its type-specific fields are grouped under a single detail object selected by productType. The products returned by an add are therefore in the same shape as the products you later fetch.
The long-term goal is to support product operations across line item types. Adding and removing products currently supports Onsite Display Auction line items, with productType DisplayProduct. Fetching products supports both Onsite Display and Sponsored Products line items. Additional product types will be documented as support is added.

Relationship to the current API

The add and delete endpoints replace the equivalent routes documented in Promoted Products, which remain available on stable versions in the meantime.
The removal route uses the same path on Experimental and on stable versions, but the request body is different. On experimental, send the productIds body described below. On a stable version, keep sending the array of promoted product resources documented in Promoted Products.

Endpoints

Product resource

Exactly one detail object is present on each product. The other is omitted rather than returned as null.

Display product details

When you add a display product, send displayProductDetails as an empty object, {}. It carries no request fields today.

Enum values

Enums are serialized as strings. New values may be added to productType, approvalStatus, and status without a version change, so do not fail on a value you do not recognize; treat it as Unknown.

Add Products to a Line Item

Adds one or more products to the product pool of an existing line item.

Path parameters

Request body

The body’s data is an array with one product resource per product to add. At least one product is required. A single request accepts at most 1500 distinct products, and a line item’s product pool holds at most 1500 products.

Behavior

  • The add is all-or-nothing. If any product fails validation, the request fails and the product pool is left unchanged.
  • Every product in the request is validated, and the response reports every problem found, each pointing at the product it concerns, for example @data/2/id.
  • A product ID is invalid if it is not present in the retailer catalog available to the line item’s account.
  • Adding a product that is already in the product pool is a no-op. No duplicate is created and no error is returned for that product.
  • Adding a product that was previously removed from the line item returns it to the product pool.
  • Duplicate product IDs within the same request are deduplicated, ignoring case. The product is added once and returned once.
  • Products are added to the product pool only. They are not assigned to a Creative Product Collection.

Response

The response’s data lists the requested products, once each and in request order, as product resources. Approval is tracked for a line item’s products as a whole, so every display product in the response carries the same approvalStatus.

Sample Request

Sample Responses

When product IDs are not found in the catalog, the response includes one error per unknown product, and nothing is added.

Errors

Remove Products from a Line Item

Removes one or more products from the product pool of an existing line item.

Path parameters

Request body

Unlike the add operation, products are supplied as a flat list of IDs in productIds, inside a single resource.

Behavior

  • Removal is a soft delete. The product’s status becomes Removed and the line item stops promoting it. The product is not erased, and it remains in your account catalog.
  • Products are removed from both the current line item and its proposal, so a pending change set stays consistent with the live one.
  • The operation is idempotent. Removing a product ID that is not in the product pool, or that was already removed, succeeds, removes nothing for that ID, and is reported as a product-already-deleted warning. Repeating the same request has no further effect.
  • Duplicate product IDs within the same request are deduplicated, ignoring case. Each product is removed once.
  • Validation is all-or-nothing. If the request is invalid, for example because it exceeds 1500 IDs, the entire request is rejected and the product pool is left unchanged.
  • Products are removed from the product pool only. They are not yet removed from Creative Product Collections that reference them; that behavior will follow.
  • Removing every product from a line item is allowed. The line item may stop being served as a result.

Response

The response carries warnings and errors only; it does not list the products that were removed. To confirm the resulting state of the pool, fetch the line item’s products.

Sample Request

Sample Responses

When all requested products are removed without warnings, the endpoint returns 200 with an empty outcome.
When one or more product IDs are not in the product pool, the response includes a warning for each of them. Matching products are still removed.

Errors

Fetch Products of a Line Item

Retrieves a page of the product pool of an existing line item.

Parameters

Behavior

  • The operation is read-only and has no side effects.
  • Products are returned in ascending productId order. The order is stable across pages while the pool is unchanged, which makes offset and limit paging safe.
  • Only products currently in the pool are returned. Products that were removed are not.
  • The productType of every product is derived from the line item: an Onsite Display line item returns DisplayProduct products with displayProductDetails, and a Sponsored Products line item returns SponsoredProduct products with sponsoredProductDetails.
  • A line item with no products returns 200 with an empty data array. An offset at or beyond the end of the pool also returns an empty page, with meta.count still reporting the pool size.
  • A line item that does not exist and a line item that you cannot view return the same 403 response.

Response

Sample Request

Sample Responses

Errors