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 resourceid, 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.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.
Sponsored product details
Enum values
Enums are serialized as strings. New values may be added toproductType, 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’sdata 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’sdata 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
Example request
Example request
Sample Responses
Example response (200)
Example response (200)
Example error response (400)
Example error response (400)
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 inproductIds, inside a single resource.
Behavior
- Removal is a soft delete. The product’s status becomes
Removedand 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-deletedwarning. 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 carrieswarnings 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
Example request
Example request
Sample Responses
When all requested products are removed without warnings, the endpoint returns200 with an empty outcome.
Example response (200)
Example response (200)
Example response with warning (200)
Example response with warning (200)
Example error response (400)
Example error response (400)
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
productIdorder. The order is stable across pages while the pool is unchanged, which makesoffsetandlimitpaging safe. - Only products currently in the pool are returned. Products that were removed are not.
- The
productTypeof every product is derived from the line item: an Onsite Display line item returnsDisplayProductproducts withdisplayProductDetails, and a Sponsored Products line item returnsSponsoredProductproducts withsponsoredProductDetails. - A line item with no products returns
200with an emptydataarray. Anoffsetat or beyond the end of the pool also returns an empty page, withmeta.countstill reporting the pool size. - A line item that does not exist and a line item that you cannot view return the same
403response.
Response
Sample Request
Example request
Example request
Sample Responses
Example response for an Onsite Display line item (200)
Example response for an Onsite Display line item (200)
Example response for a Sponsored Products line item (200)
Example response for a Sponsored Products line item (200)
Example response for an empty product pool (200)
Example response for an empty product pool (200)
Example error response (400)
Example error response (400)