Skip to main content
Get StartedLearn more about how open auction line items work with our API in Onsite Sponsored Products.

Endpoints

Method

Endpoint

Description

GET

/campaigns/{campaignId}/auction-line-items

Get all auction line items from a specific campaign

POST

/campaigns/{campaignId}/auction-line-items

Create a new auction line item

GET

/auction-line-items/{lineItemId}

Get a specific auction line item

PUT

/auction-line-items/{lineItemId}

Update a specific auction line item

Field Definitions
  • 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.

Line Item Attributes

Attribute

Data Type

Description

id

string

Auction line item ID, generated internally by Criteo

Accepted values: string of int64

Writeable? N / Nullable? N

name*

string

Line item name, must be unique within the Campaign

Accepted values: between 2 and 255-chars string

Writeable? Y / Nullable? N

campaignId*

string

Campaign ID, in which the respective line item belongs and generated internally by Criteo

Accepted values: string of int64

Writeable? N / Nullable? N

targetRetailerId*

string

Retailer ID where the line item will serve ads on. For retailer-budgets campaigns, must match the campaign’sretailerId. Only one retailer is allowed per retailer-billed campaign.

Accepted values: string of int64

Writeable? N / Nullable? N

startDate*

date

Start date of the line item, used to schedule its activation and start serving ads. To understand the conditions that will cause a status to change, check out Campaign & Line Item Status

ℹ️ This now supports datetime offset to define the desired time zone, in the format of±hh:mm. If omitted in create/update operations, UTC will be considered the default time zone. Values are returned in UTC in responses; dates are normalized to account timezone internally.

Accepted values:yyyy-mm-ddThh:mm:ss±hh:mm or yyyy-mm-dd(in ISO-8601)

Writeable? Y / Nullable? N

endDate

date

End date of the line item; serves ads indefinitely if omitted or set tonull. To understand the conditions that will cause a status to change, check out Campaign & Line Item Status

ℹ️ This now supports datetime offset to define the desired time zone, in the format of±hh:mm. If omitted in create/update operations, UTC will be considered the default time zone. Values are returned in UTC in responses; dates are normalized to account timezone internally.

Accepted values:yyyy-mm-ddThh:mm:ss±hh:mm or yyyy-mm-dd(in ISO-8601 )

Default: ifnullor absent, line item will serve ads indefinitely

Writeable? Y / Nullable? Y

budget

decimal

Lifetime spend cap of line item (optional), uncapped if omitted or set tonull

Accepted values:budget≥ 0.0

Default:null

Writeable? Y / Nullable? Y

budgetSpent

decimal

Budget amount the line item has already spent

Accepted values:budgetSpent≥ 0.0

Default:0.0

Writeable? N / Nullable? N

budgetRemaining

decimal

Amount the line item has remaining until cap is hit;nullif budget is uncapped

Accepted values: 0 ≤budgetRemainingbudget

Default:0.0

Writeable? N / Nullable? Y

monthlyPacing

decimal

Amount the line item can spend per calendar month (optional), in the Account time zone. Omitting or setting tonullleaves the monthly spend uncapped.

Accepted values:monthlyPacing≥ 0.0 (ornull)

Default:0.0

Writeable? Y / Nullable? Y

dailyPacing

decimal

Amount the line item can spend per calendar day (optional), in the Account time zone. It resets each day; overwritten by calculation ifisAutoDailyPacingis enabled; uncapped if omitted or set tonull

Accepted values:dailyPacing≥ 0.0 (ornull)

Default:0.0

Writeable? Y / Nullable? Y

isAutoDailyPacing

boolean

To activate, either line itemendDateand budget, ormonthlyPace, must be specified; overwritesdailyPacingwith calculation if not set prior

Accepted values:true,false

Default:false

Writeable? Y / Nullable? N

bidStrategy

enum

Indicate whether Adaptive CPC is enabled or notautomatedwill trigger a validation against themaxBidto ensure that it is present.manualwill trigger a validation against thetargetBidto ensure that a bid for the line item have been input.

Accepted values:automated,manual

Default:manual

Writeable? Y / Nullable? N

optimizationStrategy

enum

Bid algorithm optimizing for sales conversions, sales revenue or clicks

Accepted values:conversion,revenue,clicks

Default:conversion

Writeable? Y / Nullable? N

targetBid

bidStrategy decimal

If optimizing forconversionorrevenue, a target average amount to bid (as each bid is modulated up/down by our optimization algorithm); else bids stay constant, if optimizing forclicksBidding is uncapped if omitted or set tonull

ℹ️ Note:

  • Must meetminBidfor line item to deliver ads, which depends on selected products (available through the Catalog)
  • Input excludes platform fees

Accepted values: at least the greatest value ofminBidacross all products in the line item

Default:0.3

Writeable? Y / Nullable? Y

maxBid

decimal

If optimizing forconversionorrevenue, the maximum amount allowed to bid for each display (respected regardless oftargetBid). Does not apply if optimizing forclicksBidding is uncapped if omitted or set tonull

ℹ️ Note:

  • Must meetminBidfor line item to deliver ads, which depends on selected products (available through the Catalog)
  • Input excludes platform fees

Accepted values: at least0.1

⚠️ Note: As of 2026-01, maxBid is required when bidStrategy: automated. When set to null, the API returns 0 in responses, but the system treats it internally as uncapped (no bid ceiling).

Writeable? Y / Nullable? Y

status

enum

Line item status; can only be updated by a user toactiveorpaused; all other values are applied automatically depending on financials, flight dates, or missing attributes required for line item to serve. To understand the conditions that will cause a status to change, check out Campaign & Line Item Status

Accepted values:active,paused,scheduled,ended,budgetHit,noFunds,draft,archived

Writeable? Y / Nullable? N

flightSchedule

object

Settings allowing custom scheduling for serving ads serving, organized by a combination oflegs. In case ofnullor emptylegs, the line item status will remain unchanged along the weekdays and hours, as long as other delivery parameters are respected - see Campaign & Line Item Status

Accepted values: see below

Writeable? Y / Nullable? Y

keywordStrategy

enum

Keyword strategy used to target users according to the promoted products appended in the line item and their competitors

ℹ️ Note: “Conquesting” is not available for all retailers; when creating a new line item for those retailers, a validation error will return which can be avoided by omitting this attribute from the request

Accepted values:

  • genericAndBranded: enables users who submit general keywords and also keywords related to the brand(s) to target the promoted products associated with the line item (default behavior)
  • conquesting: enables users who submit keywords identified as competitor(s) from the brand(s) related to the promoted products associated with the line item (manual review required)
  • genericBrandedAndConquesting: enables users who submit keywords related to both brand(s) and competitor(s) from the promoted products of line item (manual review required)

Default:genericAndBranded

Writeable? Y / Nullable? N

createdAt

timestamp

Timestamp of line item creation, in UTC

Accepted values:yyyy-mm-ddThh:mm:ss±hh:mm(in ISO-8601)

Writeable? N / Nullable? N

updatedAt

timestamp

Timestamp of last line item update, in UTC

Accepted values:yyyy-mm-ddThh:mm:ss±hh:mm(in ISO-8601)

Default: same ascreatedAt

Writeable? N / Nullable? N

(*) Required for create operations
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.

Flight Schedule Legs Attributes

Attribute

Data Type

Description

dayOfWeek

enum

Day of the week or day type that the respectivelegshould be effective, i.e., the respective line item should be activated (in case all other conditions are satisfied)

Accepted values:sunday,monday,tuesday,wednesday,thursday,friday,saturday,everyday,weekdays,weekends

Writeable? Y / Nullable? N

startTime

time

Start time that the respectivelegshould be effective, i.e., the respective line item should be activated (in case all other conditions are satisfied)

ℹ️ This time value will be interpreted considering the time zone provided in thestartDate/endDateabove

Accepted values:hh:mm, with values between00:00and23:59

Writeable? Y / Nullable? N

endTime

time

End time that the respectivelegshould be effective, i.e., the respective line item should be deactivated (in case all other conditions are satisfied)

ℹ️ This time value will be interpreted considering the time zone provided in thestartDate/endDateabove

Accepted values:hh:mm, with values between00:00and23:59

Writeable? Y / Nullable? N


Get all Onsite Sponsored Products Line Items

This endpoint lists all Onsite Sponsored Products line items in the specified campaign.
This endpoint now returns null in the budgetRemaining field for line items with uncapped budgets and line items with missing budgets.
Results are paginated using offset and limit query parameters; if omitted, defaults to 0 and 500, respectively. See API Response. Sample Request
curl -L -X GET "https://api.criteo.com/{version}/retail-media/campaigns/544937665113018368/auction-line-items?offset=0&limit=500" \
    -H "Authorization: Bearer <MY_ACCESS_TOKEN>" \
    -H "Accept: application/json"
import http.client

conn = http.client.HTTPSConnection("api.criteo.com")

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

conn.request("GET", "/{version}/retail-media/campaigns/544937665113018368/auction-line-items?offset=0&limit=500", headers=headers)

res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

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

Response response = client.newCall(request).execute();
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.criteo.com/{version}/retail-media/campaigns/544937665113018368/auction-line-items?offset=0&limit=500');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig([
    'follow_redirects' => TRUE
]);
$request->setHeader([
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>',
    'Accept' => 'application/json'
]);

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();
}
Sample Response
{
    "data": [
        {
            "id": "9979917896105882144",
            "type": "SponsoredProductsLineItem",
            "attributes": {
                "name": "Line Item 123 Always On",
                "campaignId": "544937665113018368",
                "targetRetailerId": "12345",
                "startDate": "2024-09-01T04:00:00+00:00",
                "endDate": null,
                "status": "active",
                "budget": 5000.00,
                "budgetSpent": 2354.38,
                "budgetRemaining": 2645.62,
                "maxBid": 2.50,
                "targetBid": null,
                "monthlyPacing": null,
                "dailyPacing": null,
                "isAutoDailyPacing": false,
                "bidStrategy": "automated",
                "optimizationStrategy": "conversion",
                "flightSchedule": null,
                "keywordStrategy": "genericBrandedAndConquesting",
                "createdAt": "2024-08-24T15:46:45.1578781+00:00",
                "updatedAt": "2025-08-12T08:02:36.9158515+00:00"
            }
        },
        // ...
        {
            "id": "6854840188706902009",
            "type": "SponsoredProductsLineItem",
            "attributes": {
                "name": "Line Item 456 - Weekends Only",
                "campaignId": "544937665113018368",
                "targetRetailerId": "6789",
                "startDate": "2025-08-09T04:00:00+00:00",
                "endDate": "2026-01-01T03:59:59+00:00",
                "status": "draft",
                "budget": 12000.00,
                "budgetSpent": 0.00,
                "budgetRemaining": 12000.00,
                "maxBid": 5.0,
                "targetBid": null,
                "monthlyPacing": null,
                "dailyPacing": null,
                "bidStrategy": "automated",
                "optimizationStrategy": "conversion",
                "isAutoDailyPacing": false,
                "flightSchedule": {
                    "legs": [
                        {
                            "dayOfWeek": "Weekends",
                            "startTime": "00:00",
                            "endTime": "23:59"
                        }
                    ]
                },
                "keywordStrategy": "genericAndBranded",
                "createdAt": "2025-07-24T15:46:45.7793506-04:00",
                "updatedAt": "2025-08-12T08:02:36.9158515-04:00"
            }
        },
    ],
    "metadata": {
        "count": 35,
        "offset": 0,
        "limit": 25
    },
    "warnings": [],
    "errors": []
}
Sample response with uncapped or missing budget
{
  "data": [
    {
      "attributes": {
        "name": "Oscar Mayer Bacon - Giant Eagle",
        "startDate": "2026-01-01",
        "endDate": null,
        "maxBid": null,
        "budget": null,
        "monthlyPacing": 744,
        "dailyPacing": 24.88888889,
        "bidStrategy": "automated",
        "targetRetailerId": "1084",
        "status": "active",
        "targetBid": 0.6,
        "isAutoDailyPacing": true,
        "campaignId": "789229599621738496",
        "budgetSpent": 1576.8,
        "budgetRemaining": null,
        "createdAt": "2025-12-17T20:37:31+00:00",
        "updatedAt": "2026-03-05T11:01:11+00:00",
        "id": "789229817782235136"
      },
      "id": "789229817782235136",
      "type": "RetailMediaAuctionLineItem"
    }
  ]
}

Create an Onsite Sponsored Products Line Item

This endpoint creates a new Onsite Sponsored Products line item in the specified campaign.
Retailer Budgets CampaignsFor retailer-budget campaigns, targetRetailerId must match the campaign’s retailerId. Mismatched values will return a RetailerMismatchWithCampaign error.Learn more about Retailer Budgets here.Note: bidStrategy: "automated" requires maxBid to be set.
Sample Request
cURL
curl -L -X POST '{version}/retail-media/campaigns/{campaignId}/auction-line-items' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <MY_ACCESS_TOKEN>' \
-d '{
  "data": {
    "type": "SponsoredProductsLineItem",
    "attributes": {
      "name": "My Retailer Budget Line Item",
      "targetRetailerId": "123",
      "startDate": "2026-06-01T00:00:00+00:00",
      "bidStrategy": "automated",
      "maxBid": 5.0,
      "optimizationStrategy": "conversion",
      "keywordStrategy": "genericAndBranded"
    }
  }
}'
Sample Response
{
  "data": {
    "id": "100000000000000001",
    "type": "SponsoredProductsLineItem",
    "attributes": {
      "name": "My Retailer Budget Line Item",
      "startDate": "2026-06-01T00:00:00+00:00",
      "endDate": null,
      "status": "draft",
      "targetBid": null,
      "targetRetailerId": "123",
      "budget": null,
      "campaignId": "100000000000000001",
      "budgetSpent": 0.0,
      "budgetRemaining": null,
      "createdAt": "2026-05-29T20:33:29+00:00",
      "updatedAt": "2026-05-29T20:33:29+00:00",
      "maxBid": 5.0,
      "monthlyPacing": null,
      "dailyPacing": null,
      "optimizationStrategy": "conversion",
      "isAutoDailyPacing": false,
      "flightSchedule": null,
      "keywordStrategy": "genericAndBranded",
      "bidStrategy": "automated"
    }
  },
  "warnings": [],
  "errors": []
}

Get a Specific Onsite Sponsored Products Line Item

This endpoint returns the specified Onsite Sponsored Products line item.
  • This endpoint returns null in the budgetRemaining field for line items with uncapped budgets and line items with missing budgets.
  • targetRetailerId is returned in the attributes for retailer budget line items.
Sample Request
curl -L -X GET "https://api.criteo.com/{version}/retail-media/auction-line-items/6854840188706902009" \
    -H "Authorization: Bearer <MY_ACCESS_TOKEN>" \
    -H "Accept: application/json"
import http.client

conn = http.client.HTTPSConnection("api.criteo.com")

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

conn.request("GET", "/preview/retail-media/auction-line-items/6854840188706902009", headers=headers)

res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

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

Response response = client.newCall(request).execute();
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.criteo.com/preview/retail-media/auction-line-items/6854840188706902009');
$request->setMethod(HTTP_Request2::METHOD_GET);
$request->setConfig([
    'follow_redirects' => TRUE
]);
$request->setHeader([
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>',
    'Accept' => 'application/json'
]);

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();
}
Sample Response
{
  "data": {
    "id": "100000000000000001",
    "type": "SponsoredProductsLineItem",
    "attributes": {
      "name": "My Retailer Budget Line Item",
      "startDate": "2026-06-01T00:00:00+00:00",
      "endDate": null,
      "status": "draft",
      "targetBid": null,
      "targetRetailerId": "123",
      "budget": null,
      "campaignId": "100000000000000001",
      "budgetSpent": 0.0,
      "budgetRemaining": null,
      "createdAt": "2026-05-29T20:33:29+00:00",
      "updatedAt": "2026-05-29T20:33:29+00:00",
      "maxBid": 5.0,
      "monthlyPacing": null,
      "dailyPacing": null,
      "optimizationStrategy": "conversion",
      "isAutoDailyPacing": false,
      "flightSchedule": null,
      "keywordStrategy": "genericAndBranded",
      "bidStrategy": "automated"
    }
  },
  "warnings": [],
  "errors": []
}

Sample request with uncapped or missing budget
	
{
  "data": {
    "attributes": {
      "name": "Bagel Bites - Giant Eagle",
      "startDate": "2026-01-01",
      "endDate": null,
      "maxBid": null,
      "budget": null,
      "monthlyPacing": 230,
      "dailyPacing": 5.10567297,
      "bidStrategy": "revenue",
      "targetRetailerId": "1084",
      "status": "active",
      "targetBid": 0.7,
      "isAutoDailyPacing": true,
      "campaignId": "789229599621738496",
      "budgetSpent": 820.72682981,
      "budgetRemaining": null,
      "createdAt": "2025-12-17T21:05:51+00:00",
      "updatedAt": "2026-03-05T11:01:11+00:00",
      "id": "789236949010575360"
    },
    "id": "789236949010575360",
    "type": "RetailMediaAuctionLineItem"
  },
  "warnings": [],
  "errors": []
}

Update a Specific Onsite Sponsored Products Line Item

This endpoint updates the specified Onsite Sponsored Products line item. In this example, we are:
  • renaming the line item and start date, to be scheduled to deliver during Q4.
  • enabling 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.
  • modifying the day scheduling to deliver ads during extended weekend evenings only, i.e., Fridays, Saturdays and Sundays from 18h until 0h (local time)
Also, note the draft state of the line item because products to be promoted have not yet been added. Sample Request
curl -L -X PUT "https://api.criteo.com/{version}/retail-media/auction-line-items/6854840188706902009" \
    -H "Authorization: Bearer <MY_ACCESS_TOKEN>" \
    -H "Content-Type: application/json" \
    -H "Accept: application/json" \
    -d '{
            "data": {
                "id": "6854840188706902009",
                "type": "SponsoredProductsLineItem",
                "attributes": {
                    "name": "Line Item 456 - Q4 Weekends Evenings",
                    "campaignId": "544937665113018368",
                    "targetRetailerId": "6789",
                    "startDate": "2025-10-01T00:00:00-04:00",
                    "endDate": "2025-12-31T23:59:59-04:00",
                    "status": "active",
                    "budget": 12000.00,
                    "maxBid": 5.0,
                    "targetBid": 1.0,
                    "monthlyPacing": 4000.00,
                    "isAutoDailyPacing": true,
                    "flightSchedule": {
                        "legs": [
                            {
                                "dayOfWeek": "friday",
                                "startTime": "18:00",
                                "endTime": "23:59"
                            },
                            {
                                "dayOfWeek": "weekends",
                                "startTime": "18:00",
                                "endTime": "23:59"
                            }
                        ]
                    }
                }
            }
        }'
import http.client
import json

conn = http.client.HTTPSConnection("api.criteo.com")
payload = json.dumps({
    "data": {
        "id": "6854840188706902009",
        "type": "SponsoredProductsLineItem",
        "attributes": {
            "name": "Line Item 456 - Q4 Weekends Evenings",
            "campaignId": "8343086999167541140",
            "targetRetailerId": "6789",
            "startDate": "2025-10-01T00:00:00-04:00",
            "endDate": "2025-12-31T23:59:59-04:00",
            "status": "active",
            "budget": 12000.00,
            "maxBid": 5.0,
            "targetBid": 1.0,
            "monthlyPacing": 4000.00,
            "isAutoDailyPacing": True,
            "flightSchedule": {
                "legs": [
                    {
                        "dayOfWeek": "friday",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    },
                    {
                        "dayOfWeek": "weekends",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    }
                ]
            }
        }
    }
})

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

conn.request("PUT", "/preview/retail-media/auction-line-items/6854840188706902009", payload, headers)

res = conn.getresponse()
data = res.read()
print(data.decode("utf-8"))
OkHttpClient client = new OkHttpClient().newBuilder()
    .build();

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

RequestBody body = RequestBody.create(mediaType, """
{
    "data": {
        "id": "6854840188706902009",
        "type": "SponsoredProductsLineItem",
        "attributes": {
            "name": "Line Item 456 - Q4 Weekends Evenings",
            "campaignId": "8343086999167541140",
            "targetRetailerId": "6789",
            "startDate": "2025-10-01T00:00:00-04:00",
            "endDate": "2025-12-31T23:59:59-04:00",
            "status": "active",
            "budget": 12000.00,
            "maxBid": 5.0,
            "targetBid": 1.0,
            "monthlyPacing": 4000.00,
            "isAutoDailyPacing": true,
            "flightSchedule": {
                "legs": [
                    {
                        "dayOfWeek": "friday",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    },
                    {
                        "dayOfWeek": "weekends",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    }
                ]
            }
        }
    }
}
""");

Request request = new Request.Builder()
    .url("https://api.criteo.com/preview/retail-media/auction-line-items/6854840188706902009")
    .method("PUT", body)
    .addHeader("Authorization", "Bearer <MY_ACCESS_TOKEN>")
    .addHeader("Content-Type", "application/json")
    .addHeader("Accept", "application/json")
    .build();

Response response = client.newCall(request).execute();
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('https://api.criteo.com/preview/retail-media/auction-line-items/6854840188706902009');
$request->setMethod(HTTP_Request2::METHOD_PUT);
$request->setConfig([
    'follow_redirects' => TRUE
]);
$request->setHeader([
    'Authorization' => 'Bearer <MY_ACCESS_TOKEN>',
    'Content-Type' => 'application/json',
    'Accept' => 'application/json'
]);

$request->setBody(json_encode([
    "data" => [
        "id" => "6854840188706902009",
        "type" => "SponsoredProductsLineItem",
        "attributes" => [
            "name" => "Line Item 456 - Q4 Weekends Evenings",
            "campaignId" => "8343086999167541140",
            "targetRetailerId" => "6789",
            "startDate" => "2025-10-01T00:00:00-04:00",
            "endDate" => "2025-12-31T23:59:59-04:00",
            "status" => "active",
            "budget" => 12000.00,
            "maxBid" => 5.0,
            "targetBid" => 1.0,
            "monthlyPacing" => 4000.00,
            "isAutoDailyPacing" => true,
            "flightSchedule" => [
                "legs" => [
                    [
                        "dayOfWeek" => "friday",
                        "startTime" => "18:00",
                        "endTime" => "23:59"
                    ],
                    [
                        "dayOfWeek" => "weekends",
                        "startTime" => "18:00",
                        "endTime" => "23:59"
                    ]
                ]
            ]
        ]
    ]
], JSON_PRETTY_PRINT));

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();
}
Sample Response
{
    "data": {
        "id": "6854840188706902009",
        "type": "SponsoredProductsLineItem",
        "attributes": {
            "name": "Line Item 456 - Q4 Weekends Evenings",
            "campaignId": "544937665113018368",
            "targetRetailerId": "6789",
            "startDate": "2025-10-01T04:00:00+00:00",
            "endDate": "2026-01-01T03:59:59+00:00",
            "status": "draft",
            "budget": 12000.00,
            "budgetSpent": 0.00,
            "budgetRemaining": 12000.00,
            "maxBid": 5.0,
            "targetBid": 1.00000000,
            "monthlyPacing": 4000.00,
            "dailyPacing": 200.00,
            "bidStrategy": "manual",
            "optimizationStrategy": "conversion",
            "isAutoDailyPacing": true,
            "flightSchedule": {
                "legs": [
                    {
                        "dayOfWeek": "friday",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    },
                    {
                        "dayOfWeek": "weekends",
                        "startTime": "18:00",
                        "endTime": "23:59"
                    }
                ]
            },
            "keywordStrategy": "genericAndBranded",
            "createdAt": "2024-09-24T15:47:03.228224+00:00",
            "updatedAt": "2025-08-12T09:34:07.6168328+00:00"
        }
    },
    "warnings": [],
    "errors": []
}

Responses

Response

Title

Description

🔵200

Call completed with success

🔵201

Line item created with success

🔴400

InvalidisAutoDailyPacing

Cannot turn onIsAutoDailyPacingand add adailyPacingvalue. Only one of the two options can be used.

🔴400

Conquesting not enabled

Conquestingis not enabled for the specified retailer. Remove thekeywordStrategyproperty from the creation request.

🔴400

RetailerMismatchWithCampaign

  • Invalid Target Retailer

targetRetailerIdon the line item doesn’t match the parent campaign’sretailerId. Thedetailfield names both IDs: “Line item’s targetRetailerId does not match the retailer-billed campaign’s retailer ID ”. EnsuretargetRetailerIdon the line item matches theretailerIdset on the parent campaign.