> ## Documentation Index
> Fetch the complete documentation index at: https://developers.criteo.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Onsite Sponsored Products Line Items

export const EndpointBadge = ({method = "GET", children}) => {
  const METHOD_STYLES = {
    GET: {
      bg: "mint-bg-[#2AB673]"
    },
    POST: {
      bg: "mint-bg-[#3064E3]"
    },
    PUT: {
      bg: "mint-bg-[#C28C30]"
    },
    PATCH: {
      bg: "mint-bg-[#DA622B]"
    },
    DELETE: {
      bg: "mint-bg-[#CB3A32]"
    },
    API: {
      bg: "mint-bg-black"
    }
  };
  const key = method.toUpperCase();
  const styles = METHOD_STYLES[key] ?? METHOD_STYLES.API;
  return <div className="relative mt-7">
      <span className={`absolute -top-2 -left-2 z-10 ${styles.bg} text-white px-2.5 py-0.5 rounded-full text-xs font-bold tracking-wide`}>
        {key}
      </span>
      {children}
    </div>;
};

<Note>
  **Getting Started**

  Learn more about how open auction line items work with our API in [Onsite Sponsored Products](/retail-media/v2025.10/docs/onsite-sponsored-products)
</Note>

 

## **Endpoints**

<table>
  <thead>
    <tr>
      <th>
        <p>
          Verb
        </p>
      </th>

      <th>
        <p>
          Endpoint
        </p>
      </th>

      <th>
        <p>
          Description
        </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <p>
          <b>
            GET
          </b>
        </p>
      </td>

      <td>
        <p>
          <code>
            /campaigns/\{campaignId}/auction-line-items
          </code>
        </p>
      </td>

      <td>
        <p>
          Get all Open Auction Line items from a specific Campaign
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <b>
            POST
          </b>
        </p>
      </td>

      <td>
        <p>
          <code>
            /campaigns/\{campaignId}/auction-line-items
          </code>
        </p>
      </td>

      <td>
        <p>
          Create an Open Auction Line item
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <b>
            GET
          </b>
        </p>
      </td>

      <td>
        <p>
          <code>
            /auction-line-items/\{lineItemId}
          </code>
        </p>
      </td>

      <td>
        <p>
          Get a specific Open Auction Line item
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <b>
            PUT
          </b>
        </p>
      </td>

      <td>
        <p>
          <code>
            /auction-line-items/\{lineItemId}
          </code>
        </p>
      </td>

      <td>
        <p>
          Update a specific Open Auction Line item
        </p>
      </td>
    </tr>
  </tbody>
</table>

<Info>
  **Info**

  * Create operations using the `POST` method expect every **Required** field; omitting **Optional** fields will set those fields to **Default** values
  * Update operations using the `PUT` method expect every **Writeable** field; omitting these fields is equivalent to setting them to `null`, if possible
</Info>

 

## **Line Item Attributes**

<table>
  <thead>
    <tr>
      <th>
        <p>
          Attribute
        </p>
      </th>

      <th>
        <p>
          Data Type
        </p>
      </th>

      <th>
        <p>
          Description
        </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <p>
          <code>
            id
          </code>
        </p>
      </td>

      <td>
        <p>
          string
        </p>
      </td>

      <td>
        <p>
          Auction line item ID, generated internally by Criteo
        </p>

        <p>
          Acceptable values: int64
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            name
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          string
        </p>
      </td>

      <td>
        <p>
          Line item name, must be unique within the

          <a href="/retail-media/v2025.10/docs/campaign">
            Campaign
          </a>
        </p>

        <p>
          Accepted values: between 2 and 255-chars string
        </p>

        <p>
          Writeable? Y / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            campaignId
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          string
        </p>
      </td>

      <td>
        <p>
          <a href="/retail-media/v2025.10/docs/campaign">
            Campaign
          </a>

          ID, in which the respective line item belongs and generated internally by Criteo
        </p>

        <p>
          Acceptable values: int64
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            targetRetailerId
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          string
        </p>
      </td>

      <td>
        <p>
          <a href="/retail-media/v2025.10/docs/retailers">
            Retailer
          </a>

          ID where the line item will serve ads on
        </p>

        <p>
          Accepted values: int64
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            startDate
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          date
        </p>
      </td>

      <td>
        <p>
          Line item start date, in the

          <a href="/retail-media/v2025.10/docs/account">
            Account
          </a>

          timezone
        </p>

        <p>
          Accepted values:

          <code>
            YYYY-MM-DD
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            endDate
          </code>
        </p>
      </td>

      <td>
        <p>
          date
        </p>
      </td>

      <td>
        <p>
          Line item end date (optional), in the

          <a href="/retail-media/v2025.10/docs/account">
            Account
          </a>

          timezone
        </p>

        <p>
          Accepted values:

          <code>
            YYYY-MM-DD
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            budget
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          Lifetime spend cap of line item (optional), uncapped if omitted or set to

          <code>
            null
          </code>
        </p>

        <p>
          Accepted values:

          <code>
            budget
          </code>

          ≥ 0.0
        </p>

        <p>
          Default:

          <code>
            null
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            budgetSpent
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          Amount the line item has already sent
        </p>

        <p>
          Accepted values:

          <code>
            budgetSpent
          </code>

          ≥ 0.0
        </p>

        <p>
          Default:

          <code>
            0.0
          </code>
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            budgetRemaining
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          Amount the line item has remaining until cap is hit;

          <code>
            null
          </code>

          if budget is uncapped
        </p>

        <p>
          Accepted values: 0 ≤

          <code>
            budgetRemaining
          </code>

          ≤

          <code>
            budget
          </code>
        </p>

        <p>
          Default:

          <code>
            0.0
          </code>
        </p>

        <p>
          Writeable? N / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            monthlyPacing
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          Amount the line item can spend per calendar month (optional), in the

          <a href="/retail-media/v2025.10/docs/account">
            Account
          </a>

          timezone
        </p>

        <p>
          Accepted values:

          <code>
            null
          </code>

          or greater than zero
        </p>

        <p>
          Default:

          <code>
            null
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            dailyPacing
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          Amount the line item can spend per calendar month (optional), in the

          <a href="/retail-media/v2025.10/docs/account">
            Account
          </a>

          timezone
        </p>

        <p>
          It resets each day overwritten by calculation if

          <code>
            isAutoDailyPacing
          </code>

          is enabled; uncapped if omitted of set to

          <code>
            null
          </code>
        </p>

        <p>
          Accepted values:

          <code>
            null
          </code>

          or greater than zero
        </p>

        <p>
          Default:

          <code>
            null
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            isAutoDailyPacing
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          boolean
        </p>
      </td>

      <td>
        <p>
          To activate, either line item

          <code>
            endDate
          </code>

          and budget, or

          <code>
            monthlyPace
          </code>

          , must be specified; overwrites

          <code>
            dailyPacing
          </code>

          with calculation if not set prior
        </p>

        <p>
          Accepted values:

          <code>
            true
          </code>

          ,

          <code>
            false
          </code>
        </p>

        <p>
          Default:

          <code>
            false
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            bidStrategy
          </code>
        </p>
      </td>

      <td>
        <p>
          enum
        </p>
      </td>

      <td>
        <p>
          Bid algorithm optimizing for sales conversions, sales revenue or clicks
        </p>

        <p>
          Accepted values:

          <code>
            conversion
          </code>

          ,

          <code>
            revenue
          </code>

          ,

          <code>
            clicks
          </code>
        </p>

        <p>
          Default:

          <code>
            conversion
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            targetBid
          </code>

          <span>\*</span>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          If optimizing for

          <code>
            conversion
          </code>

          or

          <code>
            revenue
          </code>

          , a target average amount to bid (as each bid is modulated up/down by our optimization algorithm); else bids stay constant, if optimizing for

          <code>
            clicks
          </code>
        </p>

        <p>
          Bidding is uncapped if omitted or set to

          <code>
            null
          </code>
        </p>

        <p>
          ℹ️ Note:
        </p>

        <ul>
          <li>
            Must meet

            <code>
              minBid
            </code>

            for line item to deliver ads, which depends on selected products (available through the

            <a href="/retail-media/v2025.10/docs/catalogs">
              Catalog
            </a>

            )
          </li>

          <li>
            Input excludes platform fees
          </li>
        </ul>

        <p>
          Accepted values: at least the greatest value of

          <code>
            minBid
          </code>

          across all products in the line item
        </p>

        <p>
          Default:

          <code>
            0.3
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            maxBid
          </code>
        </p>
      </td>

      <td>
        <p>
          decimal
        </p>
      </td>

      <td>
        <p>
          If optimizing for

          <code>
            conversion
          </code>

          or

          <code>
            revenue
          </code>

          , the maximum amount allowed to bid for each display (respected regardless of

          <code>
            targetBid
          </code>

          ). Does not apply if optimizing for

          <code>
            clicks
          </code>
        </p>

        <p>
          Bidding is uncapped if omitted or set to

          <code>
            null
          </code>
        </p>

        <p>
          ℹ️ Note:
        </p>

        <ul>
          <li>
            Must meet

            <code>
              minBid
            </code>

            for line item to deliver ads, which depends on selected products (available through the

            <a href="/retail-media/v2025.10/docs/catalogs">
              Catalog
            </a>

            )
          </li>

          <li>
            Input excludes platform fees
          </li>
        </ul>

        <p>
          Accepted values: at least

          <code>
            0.1
          </code>
        </p>

        <p>
          Writeable? Y / Nullable? Y
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            status
          </code>
        </p>
      </td>

      <td>
        <p>
          enum
        </p>
      </td>

      <td>
        <p>
          Line item status, can only be updated by user to

          <code>
            active
          </code>

          or

          <code>
            paused
          </code>
        </p>

        <p>
          Other values are applied automatically depending start/end dates, financials or missing attributes required for line item to deliver ads. To understand the conditions that cause status changes, check out

          <a href="/retail-media/v2025.10/docs/campaign-lineitem-status">
            Campaign & Line Item Status
          </a>
        </p>

        <p>
          Accepted values:

          <code>
            active
          </code>

          ,

          <code>
            paused
          </code>

          ,

          <code>
            scheduled
          </code>

          ,

          <code>
            ended
          </code>

          ,

          <code>
            budgetHit
          </code>

          ,

          <code>
            noFunds
          </code>

          ,

          <code>
            draft
          </code>

          ,

          <code>
            archived
          </code>
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            createdAt
          </code>
        </p>
      </td>

      <td>
        <p>
          timestamp
        </p>
      </td>

      <td>
        <p>
          Timestamp of line item creation, in UTC
        </p>

        <p>
          Accepted values:

          <code>
            yyyy-mm-ddThh:mm:ss±hh:mm
          </code>

          (in

          <a href="https://en.wikipedia.org/wiki/ISO_8601">
            ISO-8601
          </a>

          )
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          <code>
            updatedAt
          </code>
        </p>
      </td>

      <td>
        <p>
          timestamp
        </p>
      </td>

      <td>
        <p>
          Timestamp of last line item update, in UTC
        </p>

        <p>
          Accepted values:

          <code>
            yyyy-mm-ddThh:mm:ss±hh:mm
          </code>

          (in

          <a href="https://en.wikipedia.org/wiki/ISO_8601">
            ISO-8601
          </a>

          )
        </p>

        <p>
          Writeable? N / Nullable? N
        </p>
      </td>
    </tr>
  </tbody>
</table>

*\*Required*

<Info>
  **Field Definitions**

  * **Writeable (Y/N)**: Indicates if the field can be modified in requests.
  * **Nullable (Y/N)**: Indicates if the field can accept null/empty values.
  * **Primary Key**: A unique, immutable identifier of the entity, generated internally by Criteo. Primary keys are typically ID fields (e.g., `retailerId`, `campaignId`, `lineItemId`) and are usually required in the URL path.
</Info>

<br />

## **Create an Onsite Sponsored Products Line Item**

This endpoint creates a new Onsite Sponsored Products line item in the specified campaign.

<EndpointBadge method="post">
  ```http theme={null}
  https://api.criteo.com/{version}/retail-media/campaigns/{campaignId}/auction-line-items
  ```
</EndpointBadge>

**Sample Request**

<CodeGroup>
  ```bash cURL theme={null}
  curl -L -X POST 'https://api.criteo.com/{version}/retail-media/campaigns/405429491681951744/auction-line-items' \
    -H 'Content-Type: application/json' \
    -H 'Accept: application/json' \
    -H 'Authorization: Bearer <MY_ACCESS_TOKEN>' \
    -d '{
          "data": {
            "type": "RetailMediaAuctionLineItem",
            "attributes": {
              "name": "API Campaign",
              "startDate": "2023-01-23",
              "targetRetailerId": "299",
              "endDate": "2023-01-31",
              "status": "active",
              "budget": "1.00",
              "targetBid": "5",
              "maxBid": "5",
              "monthlyPacing": "50",
              "dailyPacing": "5",
              "isAutoDailyPacing": false,
              "bidStrategy": "conversion"
            }
          }
        }'
  ```

  ```python Python expandable theme={null}
  import http.client
  import json

  conn = http.client.HTTPSConnection("api.criteo.com")
  payload = json.dumps({
    "data": {
      "type": "RetailMediaAuctionLineItem",
      "attributes": {
        "name": "API Campaing",
        "startDate": "2023-01-23",
        "targetRetailerId": "299",
        "endDate": "2023-01-31",
        "status": "active",
        "budget": "1.00",
        "targetBid": "5",
        "maxBid": "5",
        "monthlyPacing": "50",
        "dailyPacing": "5",
        "isAutoDailyPacing": False,
        "bidStrategy": "conversion"
      }
    }
  })
  headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer <MY_ACCESS_TOKEN>'
  }
  conn.request("POST", "/{version}/retail-media/campaigns/405429491681951744/auction-line-items", payload, headers)
  res = conn.getresponse()
  data = res.read()
  print(data.decode("utf-8"))
  ```

  ```java Java theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();
  MediaType mediaType = MediaType.parse("application/json");
  RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"type\":\"RetailMediaAuctionLineItem\",\"attributes\":{\"name\":\"API Campaing\",\"startDate\":\"2023-01-23\",\"targetRetailerId\":\"299\",\"endDate\":\"2023-01-31\",\"status\":\"active\",\"budget\":\"1.00\",\"targetBid\":\"5\",\"maxBid\":\"5\",\"monthlyPacing\":\"50\",\"dailyPacing\":\"5\",\"isAutoDailyPacing\":false,\"bidStrategy\":\"conversion\"}}\n}");
  Request request = new Request.Builder()
    .url("https://api.criteo.com/{version}/retail-media/campaigns/405429491681951744/auction-line-items")
    .method("POST", body)
    .addHeader("Content-Type", "application/json")
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .build();
  Response response = client.newCall(request).execute();
  ```

  ```php PHP theme={null}
  <?php
  require_once 'HTTP/Request2.php';
  $request = new HTTP_Request2();
  $request->setUrl('https://api.criteo.com/{version}/retail-media/campaigns/405429491681951744/auction-line-items');
  $request->setMethod(HTTP_Request2::METHOD_POST);
  $request->setConfig(array(
    'follow_redirects' => TRUE
  ));
  $request->setHeader(array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>'
  ));
  $request->setBody('{"data":{"type":"RetailMediaAuctionLineItem","attributes":{"name":"API Campaing","startDate":"2023-01-23","targetRetailerId":"299","endDate":"2023-01-31","status":"active","budget":"1.00","targetBid":"5","maxBid":"5","monthlyPacing":"50","dailyPacing":"5","isAutoDailyPacing":false,"bidStrategy":"conversion"}}}');
  try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
      echo $response->getBody();
    }
    else {
      echo 'Unexpected HTTP status:' . $response->getStatus() . ' ' .
      $response->getReasonPhrase();
    }
  }
  catch(HTTP_Request2_Exception $e) {
    echo 'Error:' . $e->getMessage();
  }
  ```
</CodeGroup>

**Sample Response**

```json theme={null}
{
    "data": {
        "id": "405482503263227904",
        "type": "RetailMediaAuctionLineItem",
        "attributes": {
            "id": "405482503263227904",
            "name": "API Line Item",
            "startDate": "2023-01-23",
            "endDate": "2023-01-31",
            "maxBid": 5.00000000,
            "budget": 1.00000000,
            "monthlyPacing": 50.00000000,
            "dailyPacing": 5.00000000,
            "bidStrategy": "conversion",
            "targetRetailerId": "299",
            "status": "draft",
            "targetBid": 5.00000000,
            "isAutoDailyPacing": false,
            "campaignId": "405429491681951744",
            "budgetSpent": 0.00000000,
            "budgetRemaining": 1.00000000,
            "createdAt": "2023-01-23T22:02:42+00:00",
            "updatedAt": "2023-01-23T22:02:42+00:00"
        }
    },
    "warnings": [],
    "errors": []
}
```

## **Get all Onsite Sponsored Products Line Items**

This endpoint lists all Onsite Sponsored Products line items in the specified campaign.

Results are paginated using `pageIndex` and `pageSize` query parameters; if omitted, defaults to `0` and `25`, respectively. See [API Response](/retail-media/v2025.10/docs/api-response#pagination).

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/{version}/retail-media/campaigns/{campaignId}/auction-line-items
  ```
</EndpointBadge>

**Sample Request**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.criteo.com/{version}/retail-media/campaigns/8343086999167541140/auction-line-items?pageIndex=0&pageSize=25" \
      -H "Authorization: Bearer <MY_ACCESS_TOKEN>"
  ```

  ```python Python theme={null}
  import requests

  url = "https://api.criteo.com/{version}/retail-media/campaigns/76216196459831296/auction-line-items?pageIndex=0&pageSize=25"

  payload={}
  headers = {
    'Accept': 'application/json',
    'Authorization': 'Bearer <MY_ACCESS_TOKEN>'
  }

  response = requests.request("GET", url, headers=headers, data=payload)

  print(response.text)
  ```

  ```java Java theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

  MediaType mediaType = MediaType.parse("text/plain");

  RequestBody body = RequestBody.create(mediaType, "");

  Request request = new Request.Builder()
    .url("https://api.criteo.com/{version}/retail-media/campaigns/76216196459831296/auction-line-items?pageIndex=0&pageSize=25")
    .method("GET", body)
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .build();

  Response response = client.newCall(request).execute();
  ```

  ```php PHP theme={null}
  <?php
  require_once 'HTTP/Request2.php';
  $request = new HTTP_Request2();
  $request->setUrl('https://api.criteo.com/{version}/retail-media/campaigns/76216196459831296/auction-line-items?pageIndex=0&pageSize=25');
  $request->setMethod(HTTP_Request2::METHOD_GET);
  $request->setConfig(array(
    'follow_redirects' => TRUE
  ));

  $request->setHeader(array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>'
  ));

  try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
      echo $response->getBody();
    }
    
    else {
      echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
      $response->getReasonPhrase();
    }
  }

  catch(HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
  }
  ```
</CodeGroup>

**Sample Response**

```json expandable theme={null}
{
    "data": [
        {
            "id": "9979917896105882144",
            "type": "RetailMediaLineItem",
            "attributes": {
                "campaignId": "8343086999167541140",
                "name": "Line Item 123",
                "targetRetailerId": "3239117063738827231",
                "startDate": "2020-04-06",
                "endDate": null,
                "budget": null,
                "budgetSpent": 2383.87,
                "budgetRemaining": null,
                "monthlyPacing": null,
                "dailyPacing": null,
                "isAutoDailyPacing": false,
                "bidStrategy": "conversion",
                "targetBid": 1.50,
                "maxBid": 2.50,
                "status": "active",
                "createdAt": "2020-04-06T17:29:11+00:00",
                "updatedAt": "2020-04-06T17:29:11+00:00"
            }
        },
        // ...
        {
            "id": "6854840188706902009",
            "type": "RetailMediaLineItem",
            "attributes": {
                "campaignId": "8343086999167541140",
                "name": "Line Item 789",
                "targetRetailerId": "18159942378514859684",
                "startDate": "2020-04-08",
                "endDate": null,
                "budget": 8000.00,
                "budgetSpent": 1921.23,
                "budgetRemaining": 6078.77,
                "monthlyPacing": 1000.00,
                "dailyPacing": 33.33,
                "isAutoDailyPacing": true,
                "bidStrategy": "conversion",
                "targetBid": 0.75,
                "maxBid": 1.25,
                "status": "paused",
                "createdAt": "2020-04-06T23:42:47+00:00",
                "updatedAt": "2020-06-03T03:01:52+00:00"       
            }
        }
    ],
    "metadata": {
        "totalItemsAcrossAllPages": 105,
        "currentPageSize": 25,
        "currentPageIndex": 0,
        "totalPages": 5,
        "nextPage": "https://api.criteo.com/{version}/retail-media/campaigns/8343086999167541140/line-items?pageIndex=1&pageSize=25",
        "previousPage": null
    }
}
```

## **Get a specific Onsite Sponsored Products Line Item**

This endpoint retrieves the specified Onsite Sponsored Products line item

<EndpointBadge method="get">
  ```http theme={null}
  https://api.criteo.com/{version}/retail-media/auction-line-items/{lineItemId}
  ```
</EndpointBadge>

**Sample Request**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.criteo.com/{version}/retail-media/auction-line-items/2465695028166499188" \
      -H "Authorization: Bearer <MY_ACCESS_TOKEN>"
  ```

  ```python Python theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

  MediaType mediaType = MediaType.parse("text/plain");

  RequestBody body = RequestBody.create(mediaType, "");

  Request request = new Request.Builder()
    .url("https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760")
    .method("GET", body)
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .build();

  Response response = client.newCall(request).execute();
  ```

  ```java Java theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

  MediaType mediaType = MediaType.parse("text/plain");

  RequestBody body = RequestBody.create(mediaType, "");

  Request request = new Request.Builder()
    .url("https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760")
    .method("GET", body)
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .build();

  Response response = client.newCall(request).execute();
  ```

  ```php PHP theme={null}
  <?php
  require_once 'HTTP/Request2.php';
  $request = new HTTP_Request2();
  $request->setUrl('https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760');
  $request->setMethod(HTTP_Request2::METHOD_GET);
  $request->setConfig(array(
    'follow_redirects' => TRUE
  ));
  $request->setHeader(array(
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>'
  ));

  try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
      echo $response->getBody();
    }
    
    else {
      echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
      $response->getReasonPhrase();
    }
  }

  catch(HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
  }
  ```
</CodeGroup>

**Sample Response**

```json theme={null}
{
    "data": { 
        "id": "2465695028166499188",
        "type": "RetailMediaLineItem",
        "attributes": {
            "campaignId": "8343086999167541140",
            "name": "My New Line Item",
            "targetRetailerId": "18159942378514859684",
            "startDate": "2020-04-06",
            "endDate": null,
            "budget": null,
            "budgetSpent": 0.00,
            "budgetRemaining": null,
            "monthlyPacing": null,
            "dailyPacing": null,
            "isAutoDailyPacing": false,
            "bidStrategy": "conversion",
            "targetBid": 0.30,
            "maxBid": null,
            "status": "draft",
            "createdAt": "2020-04-06T06:11:23+00:00",
            "updatedAt": "2020-04-06T06:11:23+00:00"
        }
    }
}
```

## **Update a specific Onsite Sponsored Products Line Item**

This endpoint updates the specified Onsite Sponsored Products line item.  In this example, we enable auto daily pacing by setting a monthly pace simultaneously.  Note that with auto daily pacing enabled, daily pacing is automatically calculated and overwrites its previous value, if any.  Also, note the draft state of the line item because products to be promoted have not yet been added.

<EndpointBadge method="put">
  ```http theme={null}
  https://api.criteo.com/{version}/retail-media/auction-line-items/{lineItemId}
  ```
</EndpointBadge>

**Sample Request**

<CodeGroup>
  ```bash cURL theme={null}
  curl -X PUT "https://api.criteo.com/{version}/retail-media/auction-line-items/2465695028166499188" \
    -H "Authorization: Bearer <MY_ACCESS_TOKEN>" \
    -H "Content-Type: application/json" \
    -d '{
          "data": {
            "id": "2465695028166499188",
            "type": "RetailMediaLineItem",
            "attributes": {
              "name": "My New Line Item",
              "startDate": "2020-04-06",
              "endDate": null,
              "budget": null,
              "monthlyPacing": 30.00,
              "dailyPacing": null,
              "isAutoDailyPacing": true,
              "bidStrategy": "conversion",
              "targetBid": 0.30,
              "maxBid": null,
              "status": "active"
            }
          }
        }'
  ```

  ```python Python expandable theme={null}
  import requests
  import json

  url = "https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760"

  payload = json.dumps({
    "data": {
      "id": "2465695028166499188",
      "type": "RetailMediaLineItem",
      "attributes": {
        "name": "My New Line Item",
        "startDate": "2020-04-06",
        "endDate": None,
        "budget": None,
        "monthlyPacing": 30.00,
        "dailyPacing": None,
        "isAutoDailyPacing": True,
        "bidStrategy": "conversion",
        "targetBid": 0.30,
        "maxBid": None,
        "status": "active"
      }
    }
  })
  headers = {
    'Content-Type': 'application/json',
    'Accept': 'application/json',
    'Authorization': 'Bearer <MY_ACCESS_TOKEN>'
  }

  response = requests.request("PUT", url, headers=headers, data=payload)

  print(response.text)
  ```

  ```java Java theme={null}
  OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

  MediaType mediaType = MediaType.parse("application/json");

  RequestBody body = RequestBody.create(mediaType, "{\"data\":{\"id\":\"2465695028166499188\",\"type\":\"RetailMediaLineItem\",\"attributes\":{\"name\":\"My New Line Item\",\"startDate\":\"2020-04-06\",\"endDate\":null,\"budget\":null,\"monthlyPacing\":30.00,\"dailyPacing\":null,\"isAutoDailyPacing\":true,\"bidStrategy\":\"conversion\",\"targetBid\":0.30,\"maxBid\":null,\"status\":\"active\"}}}");

  Request request = new Request.Builder()
    .url("https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760")
    .method("PUT", body)
    .addHeader("Content-Type", "application/json")
    .addHeader("Accept", "application/json")
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .build();
  Response response = client.newCall(request).execute();
  ```

  ```php PHP expandable theme={null}
  <?php
  require_once 'HTTP/Request2.php';
  $request = new HTTP_Request2();
  $request->setUrl('https://api.criteo.com/{version}/retail-media/auction-line-items/358669652976373760');
  $request->setMethod(HTTP_Request2::METHOD_PUT);
  $request->setConfig(array(
    'follow_redirects' => TRUE
  ));

  $request->setHeader(array(
    'Content-Type' => 'application/json',
    'Accept' => 'application/json',
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>'
  ));

  $request->setBody('{"data":{"id":"2465695028166499188","type":"RetailMediaLineItem","attributes":{"name":"My New Line Item","startDate":"2020-04-06","endDate":null,"budget":null,"monthlyPacing":30.00,"dailyPacing":null,"isAutoDailyPacing":true,"bidStrategy":"conversion","targetBid":0.30,"maxBid":null,"status":"active"}}}');

  try {
    $response = $request->send();
    if ($response->getStatus() == 200) {
      echo $response->getBody();
    }
    
    else {
      echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
      $response->getReasonPhrase();
    }
  }

  catch(HTTP_Request2_Exception $e) {
    echo 'Error: ' . $e->getMessage();
  }
  ```
</CodeGroup>

**Sample Response**

```json theme={null}
{
    "data": { 
        "id": "2465695028166499188",
        "type": "RetailMediaLineItem",
        "attributes": {
            "campaignId": "8343086999167541140",
            "name": "My New Line Item",
            "targetRetailerId": "18159942378514859684",
            "startDate": "2020-04-06",
            "endDate": null,
            "budget": null,
            "budgetSpent": 0.00,
            "budgetRemaining": null,
            "monthlyPacing": 3000.00,
            "dailyPacing": 120.00,
            "isAutoDailyPacing": true,
            "bidStrategy": "conversion",
            "targetBid": 0.30,
            "maxBid": null,
            "status": "draft",
            "createdAt": "2020-04-06T06:11:23+00:00",
            "updatedAt": "2020-04-06T06:17:48+00:00"
        }
    }
}
```

## **Responses**

<table>
  <thead>
    <tr>
      <th>
        <p>
          Responses
        </p>
      </th>

      <th>
        <p>
          Description
        </p>
      </th>
    </tr>
  </thead>

  <tbody>
    <tr>
      <td>
        <p>
          🔵

          <code>
            200
          </code>
        </p>
      </td>

      <td>
        <p>
          Call completed with success
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          🔵

          <code>
            201
          </code>
        </p>
      </td>

      <td>
        <p>
          Line item created with success
        </p>
      </td>
    </tr>

    <tr>
      <td>
        <p>
          🔴

          <code>
            400
          </code>
        </p>
      </td>

      <td>
        <p>
          Bad request leading to a validation error
        </p>

        <p>
          *Common validation errors*
        </p>

        <ul>
          <li>
            Invalid

            <code>
              isAutoDailyPacing
            </code>

            \- Cannot turn on

            <code>
              IsAutoDailyPacing
            </code>

            and add a

            <code>
              dailyPacing
            </code>

            value. Only one of the two options can be used
          </li>
        </ul>
      </td>
    </tr>
  </tbody>
</table>
